Skip to content
This repository was archived by the owner on Dec 27, 2025. It is now read-only.

Commit 5c973a3

Browse files
committed
Combine migrate_to and migrate_from in a single handler.
2 parents 670290c + 9e60a9b commit 5c973a3

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

bot.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,11 @@ async def group_upgrade_to(message: types.Message):
125125
:param message: Telegram message with "migrate_to_chat_id" field not empty
126126
"""
127127
await bot.send_message(message.migrate_to_chat_id, f"Group upgraded to supergroup.\n"
128+
f"Old ID: <code>{message.chat.id}</code>\n"
128129
f"New ID: <code>{message.migrate_to_chat_id}</code>")
129130
logs.track("Group migrate")
130131

131132

132-
@dp.message_handler(content_types=["migrate_from_chat_id"])
133-
async def group_upgrade_from(message: types.Message):
134-
"""
135-
When group is upgraded to supergroup, sends previous ID (why not?)
136-
:param message: Telegram message with "migrate_from_chat_id" field not empty
137-
"""
138-
await bot.send_message(message.chat.id, f"Group upgraded to supergroup.\n"
139-
f"Previous ID: <code>{message.migrate_from_chat_id}</code>")
140-
141-
142133
@dp.message_handler(lambda message: message.chat.type == "private", content_types=types.ContentTypes.ANY)
143134
async def private_chat(message: types.Message):
144135
"""

0 commit comments

Comments
 (0)