mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 09:22:03 +00:00
Converting group to supergroup event
Ability to handle group converting events by content_type. I.e. ```@dp.message_handler(content_types=types.ContentType.MIGRATE_FROM_CHAT_ID)```
This commit is contained in:
parent
f8f6eef5f6
commit
4b29adf430
1 changed files with 8 additions and 0 deletions
|
|
@ -109,6 +109,10 @@ class Message(base.TelegramObject):
|
||||||
return ContentType.SUCCESSFUL_PAYMENT[0]
|
return ContentType.SUCCESSFUL_PAYMENT[0]
|
||||||
if self.connected_website:
|
if self.connected_website:
|
||||||
return ContentType.CONNECTED_WEBSITE[0]
|
return ContentType.CONNECTED_WEBSITE[0]
|
||||||
|
if self.migrate_from_chat_id:
|
||||||
|
return ContentType.MIGRATE_FROM_CHAT_ID[0]
|
||||||
|
if self.migrate_to_chat_id:
|
||||||
|
return ContentType.MIGRATE_TO_CHAT_ID[0]
|
||||||
else:
|
else:
|
||||||
return ContentType.UNKNOWN[0]
|
return ContentType.UNKNOWN[0]
|
||||||
|
|
||||||
|
|
@ -691,6 +695,8 @@ class ContentType(helper.Helper):
|
||||||
:key: INVOICE
|
:key: INVOICE
|
||||||
:key: SUCCESSFUL_PAYMENT
|
:key: SUCCESSFUL_PAYMENT
|
||||||
:key: CONNECTED_WEBSITE
|
:key: CONNECTED_WEBSITE
|
||||||
|
:key: MIGRATE_TO_CHAT_ID
|
||||||
|
:key: MIGRATE_FROM_CHAT_ID
|
||||||
:key: UNKNOWN
|
:key: UNKNOWN
|
||||||
:key: ANY
|
:key: ANY
|
||||||
"""
|
"""
|
||||||
|
|
@ -713,6 +719,8 @@ class ContentType(helper.Helper):
|
||||||
INVOICE = helper.ListItem() # invoice
|
INVOICE = helper.ListItem() # invoice
|
||||||
SUCCESSFUL_PAYMENT = helper.ListItem() # successful_payment
|
SUCCESSFUL_PAYMENT = helper.ListItem() # successful_payment
|
||||||
CONNECTED_WEBSITE = helper.ListItem() # connected_website
|
CONNECTED_WEBSITE = helper.ListItem() # connected_website
|
||||||
|
MIGRATE_TO_CHAT_ID = helper.ListItem() # migrate_to_chat_id
|
||||||
|
MIGRATE_FROM_CHAT_ID = helper.ListItem() # migrate_from_chat_id
|
||||||
|
|
||||||
UNKNOWN = helper.ListItem() # unknown
|
UNKNOWN = helper.ListItem() # unknown
|
||||||
ANY = helper.ListItem() # any
|
ANY = helper.ListItem() # any
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue