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

ban and unban users with id before they join

This commit is contained in:
Pouria Ezzati
2017-11-22 21:44:17 +03:30
parent 15b92ad1b6
commit b0dd4578ea
4 changed files with 23 additions and 7 deletions

View File

@@ -76,6 +76,11 @@ const banHandler = async ({ chat, message, reply, telegram, me, state }) => {
logError(err);
}
if (userToBan.first_name === '') {
return reply(`🚫 ${link(state.user)} <b>banned a user with id</b> ` +
`<code>${userToBan.id}</code> <b>for:</b>\n\n${reason}`, replyOptions);
}
return reply(`🚫 ${link(state.user)} <b>banned</b> ${link(userToBan)} ` +
`<b>for:</b>\n\n${reason}`, replyOptions);
};