This commit is contained in:
12
main.py
12
main.py
@@ -99,6 +99,16 @@ from handlers.edit_button import edit_button
|
||||
from handlers.del_button import del_button
|
||||
from handlers.share_channel import share_channel_conv
|
||||
|
||||
import logging
|
||||
from telegram.error import BadRequest
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
async def on_error(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
err = context.error
|
||||
# подавляем шумные 400-е, когда контент/markup не меняется
|
||||
if isinstance(err, BadRequest) and "Message is not modified" in str(err):
|
||||
return
|
||||
logger.exception("Unhandled exception", exc_info=err)
|
||||
|
||||
|
||||
|
||||
@@ -130,7 +140,7 @@ def main():
|
||||
loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
application.run_polling()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user