Skip to content

Commit

Permalink
Converting group to supergroup event
Browse files Browse the repository at this point in the history
Ability to handle group converting events by content_type. 
I.e. 
```@dp.message_handler(content_types=types.ContentType.MIGRATE_FROM_CHAT_ID)```
  • Loading branch information
Olegt0rr authored May 21, 2018
1 parent f8f6eef commit 4b29adf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions aiogram/types/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ def content_type(self):
return ContentType.SUCCESSFUL_PAYMENT[0]
if self.connected_website:
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:
return ContentType.UNKNOWN[0]

Expand Down Expand Up @@ -691,6 +695,8 @@ class ContentType(helper.Helper):
:key: INVOICE
:key: SUCCESSFUL_PAYMENT
:key: CONNECTED_WEBSITE
:key: MIGRATE_TO_CHAT_ID
:key: MIGRATE_FROM_CHAT_ID
:key: UNKNOWN
:key: ANY
"""
Expand All @@ -713,6 +719,8 @@ class ContentType(helper.Helper):
INVOICE = helper.ListItem() # invoice
SUCCESSFUL_PAYMENT = helper.ListItem() # successful_payment
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
ANY = helper.ListItem() # any
Expand Down

0 comments on commit 4b29adf

Please sign in to comment.