2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-09-05 00:25:19 +00:00

added styling format for messages

This commit is contained in:
Pouria Ezzati
2017-09-24 14:28:18 +03:30
parent 5cb22a6b5c
commit 1036ad5f88
12 changed files with 48 additions and 35 deletions

View File

@@ -22,21 +22,22 @@ const banHandler = async ({ chat, message, reply, telegram }) => {
const reason = message.text.split(' ').slice(1).join(' ').trim();
if (reason.length === 0) {
return reply('Need a reason to ban');
return reply(' <b>Need a reason to ban.</b>', replyOptions);
}
if (!message.reply_to_message) {
return reply('Reply to a message');
return reply(' <b>Reply to a message.</b>', replyOptions);
}
bot.telegram.deleteMessage(chat.id, message.reply_to_message.message_id);
if (await isAdmin(userToBan)) {
return reply('Can\'t ban other admin');
return reply(' <b>Can\'t ban other admins.</b>', replyOptions);
}
if (await isBanned(userToBan)) {
return reply('User is already banned.');
return reply(`🚫 ${link(userToBan)} <b>is already banned.</b>`,
replyOptions);
}
try {
@@ -56,7 +57,7 @@ const banHandler = async ({ chat, message, reply, telegram }) => {
logError(process.env.DEBUG)(err);
}
return reply(`${link(userToBan)} has been <b>banned</b>.\n\n` +
return reply(`🚫 ${link(userToBan)} <b>got banned</b>.\n\n` +
`Reason: ${reason}`, replyOptions);
};