2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-30 05:37:59 +00:00

don't try to delete private messages

This commit is contained in:
Pouria Ezzati 2017-09-28 15:41:36 +03:30
parent 4326065f42
commit cbdac3c48e

View File

@ -17,7 +17,8 @@ const middlewareHandler = async ({ chat, from, message, reply }, next) => {
message &&
message.text &&
message.text[0] === '/' &&
message.text[1].match(/\w/)
message.text[1].match(/\w/) &&
chat.type !== 'private'
) {
try {
await bot.telegram.deleteMessage(chat.id, message.message_id);