From 924ca1aae45424edb1d55528c3fa9f5ec76e1011 Mon Sep 17 00:00:00 2001 From: Luquinhas Date: Tue, 15 Apr 2025 01:06:50 -0300 Subject: [PATCH] Add variable bot privacy policy link + change config.env.example style --- config.env.example | 13 ++++++++++--- src/commands/main.js | 5 +++-- src/locales/english.json | 2 +- src/locales/portuguese.json | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/config.env.example b/config.env.example index 9773d37..452211b 100644 --- a/config.env.example +++ b/config.env.example @@ -1,5 +1,12 @@ -botSource = "https://github.com/change-this/to-your-repo/" -botToken = "InsertYourBotTokenHere" -botAdmins = 0000000000, 00000000, 00000000 +# links for source and privacy +botPrivacy = "https://blog.lucmsilva.com/posts/lynx-privacy-policy" +botSource = "https://github.com/ABOCN/TelegramBot" + +# insert token here +botToken = "" + +# misc (botAdmins isnt a array here!) +maxRetries = 9999 +botAdmins = 00000000, 00000000, 00000000 lastKey = "InsertYourLastFmApiKeyHere" weatherKey = "InsertYourWeatherDotComApiKeyHere" \ No newline at end of file diff --git a/src/commands/main.js b/src/commands/main.js index 6333296..4341b56 100644 --- a/src/commands/main.js +++ b/src/commands/main.js @@ -16,8 +16,9 @@ module.exports = (bot) => { bot.command('privacy', spamwatchMiddleware, async (ctx) => { const Strings = getStrings(ctx.from.language_code); - ctx.reply( - Strings.botPrivacy, { + const message = Strings.botPrivacy.replace("{botPrivacy}", process.env.botPrivacy); + + ctx.reply(message, { parse_mode: 'Markdown', disable_web_page_preview: true, reply_to_message_id: ctx.message.message_id diff --git a/src/locales/english.json b/src/locales/english.json index b2fb10a..2a143b9 100644 --- a/src/locales/english.json +++ b/src/locales/english.json @@ -1,7 +1,7 @@ { "botWelcome": "*Hello! I'm {botName}!*\nI was made with love by some nerds who really love programming!\n\n*By using {botName}, you affirm that you have read to and agree with the privacy policy (/privacy). This helps you understand where your data goes when using this bot.*\n\nAlso, you can use /help to see the bot commands!", "botHelp": "*Hey, I'm {botName}, 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", - "botPrivacy": "Check out [this link](https://blog.lucmsilva.com/posts/lynx-privacy-policy) to read the bot's privacy policy.", + "botPrivacy": "Check out [this link]({botPrivacy}) to read the bot's privacy policy.", "botAbout": "*About the bot*\n\nThe bot base 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\nSpecial thanks to @givfnz2 for his many contributions to the bot!\n\nSee the source code: [Click here to go to GitHub]({sourceLink})", "aboutBot": "About the bot", "varStrings": { diff --git a/src/locales/portuguese.json b/src/locales/portuguese.json index 6b492f2..07872cc 100644 --- a/src/locales/portuguese.json +++ b/src/locales/portuguese.json @@ -1,7 +1,7 @@ { "botWelcome": "*Olá! Eu sou o {botName}!*\n\n*Ao usar o {botName}, você afirma que leu e concorda com a política de privacidade (/privacy). Isso ajuda você a entender onde seus dados vão ao usar este bot.*\n\nAlém disso, você pode usar /help para ver os meus comandos!", "botHelp": "*Oi, eu sou o {botName}, um bot simples feito do zero em Telegraf e Node.js por uns nerds que gostam de programação.*\n\nVeja o código fonte: [Clique aqui para ir ao GitHub]({sourceLink})\n\nClique nos botões abaixo para ver quais comandos você pode usar!\n", - "botPrivacy": "Acesse [este link](https://blog.lucmsilva.com/posts/lynx-privacy-policy) para ler a política de privacidade do bot.", + "botPrivacy": "Acesse [este link]({botPrivacy}) para ler a política de privacidade do bot.", "botAbout": "*Sobre o bot*\n\nA base deste bot foi feita 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\nAgradecimento especial ao @givfnz2 pelas suas várias contribuições ao bot!\n\nVeja o código fonte: [Clique aqui para ir ao GitHub]({sourceLink})", "aboutBot": "Sobre o bot", "varStrings": {