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.mainCommands, callback_data: 'helpMain' }, { text: Strings.usefulCommands, callback_data: 'helpUseful' }],
[{ text: Strings.interactiveEmojis, callback_data: 'helpInteractive' }, { text: Strings.funnyCommands, callback_data: 'helpFunny' }], [{ 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.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); 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) => { bot.on('callback_query', async (ctx) => {
const callbackData = ctx.callbackQuery.data; const callbackData = ctx.callbackQuery.data;
const Strings = getStrings(ctx.from.language_code); const Strings = getStrings(ctx.from.language_code);
@ -74,6 +84,10 @@ module.exports = (bot) => {
await ctx.answerCbQuery(); await ctx.answerCbQuery();
await ctx.editMessageText(Strings.myLittlePonyDesc, options); await ctx.editMessageText(Strings.myLittlePonyDesc, options);
break; break;
case 'helpAbout':
await ctx.answerCbQuery();
await ctx.editMessageText(Strings.kowalskiAbout, options);
break;
case 'helpBack': case 'helpBack':
await ctx.answerCbQuery(); await ctx.answerCbQuery();
await sendHelpMessage(ctx, true); await sendHelpMessage(ctx, true);

View File

@ -2,6 +2,8 @@
"kowalskiWelcome": "*Hello! I am Kowalski!*\nI was made with love by some nerds who really love programming!\n\n*Before using, you need to read the privacy policy (/privacy) to understand where your data goes when using this bot.*\n\nAlso, you can use /help to see the bot commands!\n\n*Special thanks to @givfnz2 for his many contributions to the bot!*", "kowalskiWelcome": "*Hello! I am Kowalski!*\nI was made with love by some nerds who really love programming!\n\n*Before using, you need to read the privacy policy (/privacy) to understand where your data goes when using this bot.*\n\nAlso, you can use /help to see the bot commands!\n\n*Special thanks to @givfnz2 for his many contributions to the bot!*",
"kowalskiHelp": "*Hey, I'm Kowalski, a simple bot made entirely from scratch in Telegraf and Node.js by some nerds who really love programming.*\n\nClick on the buttons below to see which commands you can use!\n", "kowalskiHelp": "*Hey, I'm Kowalski, a simple bot made entirely from scratch in Telegraf and Node.js by some nerds who really love programming.*\n\nClick on the buttons below to see which commands you can use!\n",
"kowalskiPrivacy": "Check out [this link](https://blog.eleu.me/posts/lynx-privacy-policy) to read the bot's privacy policy.", "kowalskiPrivacy": "Check out [this link](https://blog.eleu.me/posts/lynx-privacy-policy) to read the bot's privacy policy.",
"kowalskiAbout": "Kowalski was originally created by [Lucas Gabriel (lucmsilva)](https://github.com/lucmsilva651), now maintained by several people.\n\nThe bot's purpose is to bring fun to your groups here on Telegram in a relaxed and simple way. The bot also features some very useful commands, which you can see using the help command (/help).\n\nSee the source code: [Click here to go to GitHub](https://github.com/abocn/TelegramBot)",
"aboutBot": "About the bot",
"unKnown": "Unknown", "unKnown": "Unknown",
"varYes": "Yes", "varYes": "Yes",
"varNo": "No", "varNo": "No",

View File

@ -2,9 +2,11 @@
"kowalskiWelcome": "*Olá! Eu sou o Kowalski!*\nFui feito com carinho por uns nerds que gostam de programação!\n\n*Antes de usar, você precisa ler a política de privacidade (/privacy) para entender onde seus dados vão ao usar este bot.*\n\nAlém disso, você pode usar /help para ver os comandos do bot!\n\n*Agradecimento especial ao @givfnz2 pelas suas várias contribuições ao bot!*", "kowalskiWelcome": "*Olá! Eu sou o Kowalski!*\nFui feito com carinho por uns nerds que gostam de programação!\n\n*Antes de usar, você precisa ler a política de privacidade (/privacy) para entender onde seus dados vão ao usar este bot.*\n\nAlém disso, você pode usar /help para ver os comandos do bot!\n\n*Agradecimento especial ao @givfnz2 pelas suas várias contribuições ao bot!*",
"kowalskiHelp": "*Oi, eu sou o Kowalski, um bot simples feito do zero em Telegraf e Node.js por uns nerds que gostam de programação.*\n\nClique nos botões abaixo para ver quais comandos você pode usar!\n", "kowalskiHelp": "*Oi, eu sou o Kowalski, um bot simples feito do zero em Telegraf e Node.js por uns nerds que gostam de programação.*\n\nClique nos botões abaixo para ver quais comandos você pode usar!\n",
"kowalskiPrivacy": "Acesse [este link](https://blog.eleu.me/posts/lynx-privacy-policy) para ler a política de privacidade do bot.", "kowalskiPrivacy": "Acesse [este link](https://blog.eleu.me/posts/lynx-privacy-policy) para ler a política de privacidade do bot.",
"kowalskiAbout": "Kowalski foi feito originalmente por [Lucas Gabriel (lucmsilva)](https://github.com/lucmsilva651), agora sendo mantido por várias pessoas.\n\nA intenção do bot é trazer diversão para os seus grupos aqui no Telegram de uma maneira bem descontraida e simples. O bot também conta com alguns comandos bem úteis, que você consegue ver com o comando de ajuda (/help).\n\nVeja o código fonte: [Clique aqui para ir ao GitHub](https://github.com/abocn/TelegramBot)",
"aboutBot": "Sobre o bot",
"unKnown": "Desconhecido", "unKnown": "Desconhecido",
"varYes": "Sim", "varYes": "Sim",
"varNo": "Não", "varNo": "Nsão",
"varNone": "Nenhum", "varNone": "Nenhum",
"invalidOption": "Ops! Opção inválida!", "invalidOption": "Ops! Opção inválida!",
"kickingMyself": "*Já que você não precisa de mim, vou sair daqui.*", "kickingMyself": "*Já que você não precisa de mim, vou sair daqui.*",