Added chatinfo + typo fixes + whois update
This commit is contained in:
parent
318dce8e0b
commit
6d1a1ae745
3 changed files with 32 additions and 4 deletions
|
@ -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}`)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue