feat: Made an exception if no channel is found. And if there is no channel in the database
This commit is contained in:
parent
1872544b5a
commit
098b520138
1 changed files with 6 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
from aiogram import types, Router
|
from aiogram import types, Router
|
||||||
|
from aiogram.exceptions import TelegramBadRequest
|
||||||
|
|
||||||
from bot import bot
|
from bot import bot
|
||||||
from database.database import pg_con
|
from database.database import pg_con
|
||||||
|
@ -57,5 +58,8 @@ async def register_message_reaction(event: types.MessageReactionUpdated):
|
||||||
event.chat.id
|
event.chat.id
|
||||||
)
|
)
|
||||||
|
|
||||||
if reaction_count_message[0] >= reaction_count_chat[0]:
|
try:
|
||||||
|
if reaction_count_message[0] >= reaction_count_chat[0] and reaction_count_chat[1] is not None:
|
||||||
await bot.copy_message(message_id=event.message_id, from_chat_id=event.chat.id, chat_id=reaction_count_chat[1])
|
await bot.copy_message(message_id=event.message_id, from_chat_id=event.chat.id, chat_id=reaction_count_chat[1])
|
||||||
|
except TelegramBadRequest:
|
||||||
|
return
|
Reference in a new issue