sharing channels and more
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-09-06 14:56:46 +09:00
parent 18f91bbd40
commit 506acfcde5
2 changed files with 52 additions and 15 deletions

12
main.py
View File

@@ -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()