Added chatinfo + typo fixes + whois update

This commit is contained in:
Lucas Gabriel 2024-05-25 12:37:34 -03:00
parent 318dce8e0b
commit 6d1a1ae745
No known key found for this signature in database
GPG key ID: D9B075FC6DC93985
3 changed files with 32 additions and 4 deletions

View file

@ -5,6 +5,7 @@ module.exports = function(bot, msg) {
const userHandle = msg.from.username;
const isBot = msg.from.is_bot;
const userPremium = msg.from.is_premium;
const userLang = msg.from.language_code;
let userPremiumOutput = "";
if (userPremium) {
@ -13,9 +14,9 @@ module.exports = function(bot, msg) {
userPremiumOutput = "You don't have a Telegram Premium subscription.";
}
const message = `Your name is: ${userName}\nYour username is: ${userHandle}\nYour ID is: ${userId}\nYou are a bot: ${isBot}\n\n${userPremiumOutput}`;
const message = `Your name is: ${userName}\nYour username is: @${userHandle}\nYour ID is: ${userId}\nYou are a bot: ${isBot}\nYour language: ${userLang}\n\n${userPremiumOutput}`;
bot.sendMessage(chatId, message)
.catch(error => console.error('ERROR: Message cannot be send:', error));
.catch(error => console.error('ERROR: Message cannot be sent:', error));
console.log(`INFO: /whois executed by ${userName}, ${userId}`)
}