Skip to content

Conversation

@Frozo13
Copy link

@Frozo13 Frozo13 commented Dec 15, 2021

No description provided.

/help — this message
/language — change language
/audio — convert all files to audio
/max_quality - automatically download videos in maximum quality
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вместо этого, давай сделаем /chooseResolution, который по дефолту false

import report from '@/helpers/report'
import sendHelp from '@/handlers/sendHelp'
import startMongo from '@/helpers/startMongo'
import { resolutionMenu } from './menus/resolutionMenu'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не используй относительные импорты, только @

export default async function handleMaxQuality(ctx: Context) {
ctx.dbchat.autoMaxQuality = !ctx.dbchat.autoMaxQuality
await ctx.dbchat.save()
return ctx.reply(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use replyWithLocalization

if (ctx.dbchat.autoMaxQuality) {
return createDownloadJobAndRequest(ctx, url)
} else {
const waitMessage = await ctx.reply(ctx.i18n.t('check_resolutions'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use replyWithLocalization

@@ -0,0 +1 @@
declare module 'random-token'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нам это точно нужно? Мы же делаем require

shortId!: string
@prop({ required: true })
url!: string
@prop({ required: true, type: () => [Number] })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно обойтись без этого поля?

}

const ShortUrlModel = getModelForClass(ShortUrl, {
schemaOptions: { timestamps: true },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Давай использовать @modelOptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants