Added Privacy Policy + changed commands layout to comply with new logger

This commit is contained in:
Lucas Gabriel 2024-06-02 12:54:12 +00:00
parent 612a48ca7f
commit bc97336b67
11 changed files with 47 additions and 27 deletions

View File

@ -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}`);
}

View File

@ -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}`);
}

View File

@ -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}`);
}

View File

@ -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}`);
}

View File

@ -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}`);
}

40
src/commands/privacy.js Normal file
View File

@ -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));
};

View File

@ -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}`);
}

View File

@ -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}`);
}

View File

@ -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}`);
};

View File

@ -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}`);
}

View File

@ -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;
}