mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-04-29 01:15:58 +00:00
furry and gay added + Code fixes
This commit is contained in:
parent
419575ebf7
commit
009881efc2
@ -13,20 +13,20 @@ module.exports = function(bot, msg) {
|
||||
isForumOutput = "This chat is a forum (has topics enabled)";
|
||||
} else {
|
||||
isForumOutput = "This chat is not a forum (doesn't have topics enabled)";
|
||||
}
|
||||
};
|
||||
|
||||
if (chatHandle) {
|
||||
chatHandleOutput = `Chat handle: @${chatHandle}`;
|
||||
} else {
|
||||
chatHandleOutput = `Chat handle: none (private group)`;
|
||||
}
|
||||
};
|
||||
|
||||
// if chatName returns undefined, the chat is not a group or channel
|
||||
if (chatName) {
|
||||
chatNameOutput = `Chat name: ${chatName}\n${chatHandleOutput}\nChat ID: ${chatId}\n\n${isForumOutput}`;
|
||||
} else {
|
||||
chatNameOutput = `Whoops!\nThis command doesn't work in PM.`
|
||||
}
|
||||
};
|
||||
|
||||
const message = chatNameOutput;
|
||||
|
||||
|
24
src/commands/furry.js
Normal file
24
src/commands/furry.js
Normal file
@ -0,0 +1,24 @@
|
||||
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) {
|
||||
return Math.floor(Math.random() * max);
|
||||
}
|
||||
|
||||
const randomValue = getRandomInt(2);
|
||||
|
||||
if (randomValue === 0) {
|
||||
isFurry = `${userName} is not furry`;
|
||||
} else {
|
||||
isFurry = `${userName} is a furry.`;
|
||||
}
|
||||
|
||||
const message = `${isFurry}`;
|
||||
|
||||
bot.sendMessage(chatId, message)
|
||||
.catch(error => console.error('ERROR: Message cannot be sent:', error));
|
||||
console.log(`INFO: /furry executed by ${userName}, ${userId}`)
|
||||
}
|
24
src/commands/gay.js
Normal file
24
src/commands/gay.js
Normal file
@ -0,0 +1,24 @@
|
||||
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) {
|
||||
return Math.floor(Math.random() * max);
|
||||
}
|
||||
|
||||
const randomValue = getRandomInt(2);
|
||||
|
||||
if (randomValue === 0) {
|
||||
isGay = `${userName} is not gay.`;
|
||||
} else {
|
||||
isGay = `${userName} is a gay.`;
|
||||
}
|
||||
|
||||
const message = `${isGay}`;
|
||||
|
||||
bot.sendMessage(chatId, message)
|
||||
.catch(error => console.error('ERROR: Message cannot be sent:', error));
|
||||
console.log(`INFO: /gay executed by ${userName}, ${userId}`)
|
||||
}
|
@ -12,7 +12,7 @@ module.exports = function(bot, msg) {
|
||||
userPremiumOutput = "You have a Telegram Premium subscription.";
|
||||
} else {
|
||||
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}\nYour language: ${userLang}\n\n${userPremiumOutput}`;
|
||||
|
||||
|
@ -21,5 +21,9 @@ bot.on('message', (msg) => {
|
||||
}
|
||||
});
|
||||
|
||||
bot.on('polling_error', (error) => {
|
||||
console.error('Polling error:', error);
|
||||
});
|
||||
|
||||
const date = Date();
|
||||
console.log(`INFO: Lynx started at ${date}\n`)
|
Loading…
x
Reference in New Issue
Block a user