Added help section to bot

This commit is contained in:
Lucas Gabriel 2024-12-10 23:57:16 -03:00 committed by GitHub
parent 35eecc0fff
commit f2020c21c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 2 deletions

View file

@ -11,7 +11,8 @@ async function sendHelpMessage(ctx, isEditing) {
[{ text: Strings.mainCommands, callback_data: 'helpMain' }, { text: Strings.usefulCommands, callback_data: 'helpUseful' }],
[{ text: Strings.interactiveEmojis, callback_data: 'helpInteractive' }, { text: Strings.funnyCommands, callback_data: 'helpFunny' }],
[{ text: Strings.lastFm, callback_data: 'helpLast' }, { text: Strings.animalCommands, callback_data: 'helpAnimals' }],
[{ text: Strings.ytDlp, callback_data: 'helpYouTube' }, { text: Strings.myLittlePony, callback_data: 'helpMLP' }]
[{ text: Strings.ytDlp, callback_data: 'helpYouTube' }, { text: Strings.myLittlePony, callback_data: 'helpMLP' }],
[{ text: Strings.aboutBot, callback_data: 'helpAbout' }]
]
}
};
@ -28,6 +29,15 @@ module.exports = (bot) => {
await sendHelpMessage(ctx);
});
bot.command("about", spamwatchMiddleware, async (ctx) => {
const Strings = getStrings(ctx.from.language_code);
ctx.reply(Strings.kowalskiAbout, {
parse_mode: 'Markdown',
disable_web_page_preview: true,
reply_to_message_id: ctx.message.message_id
});
})
bot.on('callback_query', async (ctx) => {
const callbackData = ctx.callbackQuery.data;
const Strings = getStrings(ctx.from.language_code);
@ -74,6 +84,10 @@ module.exports = (bot) => {
await ctx.answerCbQuery();
await ctx.editMessageText(Strings.myLittlePonyDesc, options);
break;
case 'helpAbout':
await ctx.answerCbQuery();
await ctx.editMessageText(Strings.kowalskiAbout, options);
break;
case 'helpBack':
await ctx.answerCbQuery();
await sendHelpMessage(ctx, true);