mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 09:22:03 +00:00
Use ListItem by default in ContentType helper.
This commit is contained in:
parent
7c19634379
commit
e90ca7cfae
2 changed files with 14 additions and 14 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from aiogram.utils.helper import Item, HelperMode, Helper
|
from aiogram.utils.helper import Item, HelperMode, Helper, ListItem
|
||||||
from .audio import Audio
|
from .audio import Audio
|
||||||
from .base import Deserializable
|
from .base import Deserializable
|
||||||
from .chat import Chat
|
from .chat import Chat
|
||||||
|
|
@ -259,18 +259,18 @@ class ContentType(Helper):
|
||||||
"""
|
"""
|
||||||
mode = HelperMode.lower_case
|
mode = HelperMode.lower_case
|
||||||
|
|
||||||
TEXT = Item() # text
|
TEXT = ListItem() # text
|
||||||
AUDIO = Item() # audio
|
AUDIO = ListItem() # audio
|
||||||
DOCUMENT = Item() # document
|
DOCUMENT = ListItem() # document
|
||||||
GAME = Item() # game
|
GAME = ListItem() # game
|
||||||
PHOTO = Item() # photo
|
PHOTO = ListItem() # photo
|
||||||
STICKER = Item() # sticker
|
STICKER = ListItem() # sticker
|
||||||
VIDEO = Item() # video
|
VIDEO = ListItem() # video
|
||||||
VOICE = Item() # voice
|
VOICE = ListItem() # voice
|
||||||
NEW_CHAT_MEMBERS = Item() # new_chat_members
|
NEW_CHAT_MEMBERS = ListItem() # new_chat_members
|
||||||
LEFT_CHAT_MEMBER = Item() # left_chat_member
|
LEFT_CHAT_MEMBER = ListItem() # left_chat_member
|
||||||
INVOICE = Item() # invoice
|
INVOICE = ListItem() # invoice
|
||||||
SUCCESSFUL_PAYMENT = Item() # successful_payment
|
SUCCESSFUL_PAYMENT = ListItem() # successful_payment
|
||||||
|
|
||||||
UNKNOWN = 'unknown'
|
UNKNOWN = 'unknown'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ async def save_sticker(message: types.Message):
|
||||||
# Wait next message
|
# Wait next message
|
||||||
# It can only be a sticker
|
# It can only be a sticker
|
||||||
msg = await dp.next_message(message,
|
msg = await dp.next_message(message,
|
||||||
content_types=[ContentType.STICKER],
|
content_types=ContentType.STICKER,
|
||||||
otherwise=handle_bad_message,
|
otherwise=handle_bad_message,
|
||||||
include_cancel=True)
|
include_cancel=True)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue