find intro by index

This commit is contained in:
Timofey Gelazoniya 2022-10-20 17:44:54 +03:00
parent 94a475ab21
commit d1d925052d
Signed by: zeldon
GPG Key ID: 047886915281DD2A
1 changed files with 4 additions and 2 deletions

View File

@ -34,19 +34,21 @@ const balabolaMessage = `Выбери стилизацию ответа:
7: синопсис
более подробно команда help`;
const BALABOLA_INTROS = [0, 24, 25, 11, 6, 8, 9];
filter.hear(/^(?:продолжи)\s(.*)?$/i, async ctx => {
await ctx.send(balabolaMessage, {
keyboard: selectStyleKeyboard(ctx)
});
});
filter.hear(/^(?:пр)\s(0|24|25|11|6|8|9)\s(.*)?$/i, async ctx => {
filter.hear(/^(?:пр)\s(1|2|3|4|5|6|7)\s(.*)?$/i, async ctx => {
const intro = ctx.$match[1];
const query = ctx.$match[2];
await ctx.send('генерирую!!');
const result = await balabolaQueue.add(() => balabola(query, +intro));
const result = await balabolaQueue.add(() => balabola(query, BALABOLA_INTROS[+intro - 1]));
await ctx.send(result);
});