diff --git a/src/commands/chatinfo.js b/src/commands/chatinfo.js index 27b0f02..d176dac 100644 --- a/src/commands/chatinfo.js +++ b/src/commands/chatinfo.js @@ -1,7 +1,5 @@ module.exports = function(bot, msg) { const chatId = msg.chat.id; - const userName = msg.from.first_name; - const userId = msg.from.id; const chatName = msg.chat.title; const chatHandle = msg.chat.username; const isForum = msg.chat.is_forum; @@ -32,5 +30,4 @@ module.exports = function(bot, msg) { bot.sendMessage(chatId, message, { parse_mode: 'Markdown' }) .catch(error => console.error('WARN: Message cannot be sent:', error)); - console.log(`INFO: /chatinfo executed by ${userName}, ${userId}`); } diff --git a/src/commands/customize.js b/src/commands/customize.js index 310cc46..00e6c2b 100644 --- a/src/commands/customize.js +++ b/src/commands/customize.js @@ -1,7 +1,5 @@ module.exports = function(bot, msg) { const chatId = msg.chat.id; - const userName = msg.from.first_name; - const userId = msg.from.id; const opts = { reply_to_message_id: msg.message_id, @@ -20,5 +18,4 @@ module.exports = function(bot, msg) { bot.sendMessage(chatId, message, opts,{ parse_mode: 'Markdown' }) .catch(error => console.error('WARN: Message cannot be sent:', error)); - console.log(`INFO: /customize executed by ${userName}, ${userId}`); } diff --git a/src/commands/furry.js b/src/commands/furry.js index d150ace..f62e96b 100644 --- a/src/commands/furry.js +++ b/src/commands/furry.js @@ -1,7 +1,6 @@ module.exports = function(bot, msg) { const chatId = msg.chat.id; const userName = msg.from.first_name; - const userId = msg.from.id; let isFurry = ""; function getRandomInt(max) { @@ -20,5 +19,4 @@ module.exports = function(bot, msg) { bot.sendMessage(chatId, message, { parse_mode: 'Markdown' }) .catch(error => console.error('WARN: Message cannot be sent:', error)); - console.log(`INFO: /furry executed by ${userName}, ${userId}`); } diff --git a/src/commands/gay.js b/src/commands/gay.js index 7331044..e4285be 100644 --- a/src/commands/gay.js +++ b/src/commands/gay.js @@ -1,7 +1,6 @@ module.exports = function(bot, msg) { const chatId = msg.chat.id; const userName = msg.from.first_name; - const userId = msg.from.id; let isGay = ""; function getRandomInt(max) { @@ -20,5 +19,4 @@ module.exports = function(bot, msg) { bot.sendMessage(chatId, message, { parse_mode: 'Markdown' }) .catch(error => console.error('WARN: Message cannot be sent:', error)); - console.log(`INFO: /gay executed by ${userName}, ${userId}`); } diff --git a/src/commands/help.js b/src/commands/help.js index cc24f51..3d8efb9 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -1,7 +1,5 @@ module.exports = function(bot, msg) { const chatId = msg.chat.id; - const userName = msg.from.first_name; - const userId = msg.from.id; const lynxFullPhoto = 'https://graph.org/file/a77382dab4d62ba626806.jpg'; const message = `*Hello! I'm Lynx!*\n\nI'm a simple bot made entirely from scratch in Node.js by Lucas Gabriel (lucmsilva).\n\n` + @@ -12,11 +10,10 @@ module.exports = function(bot, msg) { • */gay* - check if you are gay • */help* - send this message • */start* - start the bot - • */whois* - send some information about yourself\n\n` + - `*See my source code in:* [GitHub Repository](https://github.com/lucmsilva651/lynx)\n\n` + + • */whois* - send some information about yourself\n\n` + + `*See my source code in:* [GitHub Repository](https://github.com/lucmsilva651/lynx)\n\n` + `Thanks to all users, testers, contributors, and others. Without you, perhaps this bot wouldn't be possible ❤️`; bot.sendPhoto(chatId, lynxFullPhoto, { caption: message, parse_mode: 'Markdown' }) .catch(error => console.error('WARN: Message cannot be sent:', error)); - console.log(`INFO: /help executed by ${userName}, ${userId}`); } diff --git a/src/commands/privacy.js b/src/commands/privacy.js new file mode 100644 index 0000000..7657312 --- /dev/null +++ b/src/commands/privacy.js @@ -0,0 +1,40 @@ +module.exports = function(bot, msg) { + const chatId = msg.chat.id; + + const message = `*Privacy Policy for Lynx Telegram Bot (@LynxBR_bot)*\n` + + `Before using, you will need to read the privacy policy ` + + `to understand where your data goes when using this bot.\n\n` + + `*1. Data Collection and Use*\n` + + `All text messages sent to the Lynx bot, along with ` + + `their respective identifiers (username and ID), are ` + + `collected in a secure environment for the developers. ` + + `This data is used solely for the purpose of improving ` + + `and debugging the bot and is retained for a period `+ + `of 60 days before being completely deleted.\n\n` + + `*2. Data Sharing*\n` + + `Message data, including text and identifiers, is not ` + + `shared with any companies or third-party entities.\n\n` + + `*3. Legal Compliance*\n` + + `In the event of legal action, data will be provided ` + + `in accordance with applicable laws and regulations.\n\n` + + `*4. User-Generated Content*\n` + + `We (the creators, developers, and hosts of the bot) ` + + `are not responsible for any content generated by users, ` + + `whether it is triggered by our bot or another.\n\n` + + `*5. Blocklist System*\n` + + `We have implemented a blocklist system via user ID. If ` + + `a user generates inappropriate content or misuses the bot, ` + + `they will be permanently blocked. If the use of alternative ` + + `or secondary accounts by a blocked user is detected, those ` + + `accounts will also be blocked.\n\n` + + `*6. Source Code*\n` + + `If you wish to review the source code, please visit:` + + `[https://github.com/lucmsilva651/lynx](https://github.com/lucmsilva651/lynx/).\n\n` + + `*7. Terms Modification*\n` + + `These terms may be changed or invalidated at any time, with or without prior notice.\n\n` + + `*8. Immediate Cancellation of Terms*\n` + + `In case of usage block, as mentioned above, the terms will be immediately cancelled for the user.`; + + bot.sendMessage(chatId, message, { parse_mode: 'Markdown', disable_web_page_preview: true }) + .catch(error => console.error('WARN: Message cannot be sent:', error)); +}; diff --git a/src/commands/random.js b/src/commands/random.js index c0e8e28..631a134 100644 --- a/src/commands/random.js +++ b/src/commands/random.js @@ -1,7 +1,5 @@ module.exports = function(bot, msg) { const chatId = msg.chat.id; - const userName = msg.from.first_name; - const userId = msg.from.id; function getRandomInt(max) { return Math.floor(Math.random() * max); @@ -13,6 +11,5 @@ module.exports = function(bot, msg) { bot.sendMessage(chatId, message, { parse_mode: 'Markdown' }) .catch(error => console.error('WARN: Message cannot be sent:', error)); - console.log(`INFO: /random executed by ${userName}, ${userId}`); } \ No newline at end of file diff --git a/src/commands/start.js b/src/commands/start.js index 543f4b1..3601a01 100644 --- a/src/commands/start.js +++ b/src/commands/start.js @@ -1,12 +1,12 @@ module.exports = function(bot, msg) { const chatId = msg.chat.id; - const userName = msg.from.first_name; - const userId = msg.from.id; const lynxProfilePhoto = 'https://graph.org/file/10452df450f13ffb968c5.jpg'; - const message = `*Hello! I am Lynx!*\nI was made with love by Lucas Gabriel (lucmsilva)!\n\nSee /help for the bot commands!`; + const message = `*Hello! I am Lynx!*\nI was made with love by Lucas Gabriel (lucmsilva)!\n\n` + + `*Before using, you will need to read the privacy policy (/privacy) ` + + `to understand where your data goes when using this bot.*\n\n` + + `Also, you can use /help to show the bot commands!`; bot.sendPhoto(chatId, lynxProfilePhoto, { caption: message, parse_mode: 'Markdown' } ) .catch(error => console.error('WARN: Message cannot be sent:', error)); - console.log(`INFO: /start executed by ${userName}, ${userId}`); } diff --git a/src/commands/stats.js b/src/commands/stats.js index 8d53134..498ba05 100644 --- a/src/commands/stats.js +++ b/src/commands/stats.js @@ -2,8 +2,6 @@ const os = require('os'); module.exports = function (bot, msg) { const chatId = msg.chat.id; - const userName = msg.from.first_name; - const userId = msg.from.id; function formatUptime(uptime) { const hours = Math.floor(uptime / 3600); @@ -47,5 +45,4 @@ module.exports = function (bot, msg) { bot.sendMessage(chatId, message, { parse_mode: 'Markdown' }) .catch(error => console.error('WARN: Message cannot be sent:', error)); - console.log(`INFO: /stats executed by ${userName}, ${userId}`); }; diff --git a/src/commands/whois.js b/src/commands/whois.js index 9014443..b818f4f 100644 --- a/src/commands/whois.js +++ b/src/commands/whois.js @@ -25,5 +25,4 @@ module.exports = function(bot, msg) { bot.sendMessage(chatId, message, { parse_mode: 'Markdown' }) .catch(error => console.error('WARN: Message cannot be sent:', error)); - console.log(`INFO: /whois executed by ${userName}, ${userId}`); } diff --git a/src/main.js b/src/main.js index 79edaf8..118e34a 100644 --- a/src/main.js +++ b/src/main.js @@ -22,7 +22,7 @@ bot.on('message', (msg) => { const messageText = msg.text; if (isBlocked(userId)) { - console.log(`WARN: Blocked user ${userName}, ${userId} tried to access the bot with the command/message ${messageText}.`); + console.log(`WARN: Blocked user ${userName}, ${userId} tried to access the bot with the command or message "${messageText}".\n`); return; }