mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Changed ChatType from CHANNEL to SUPERGROUP to avoid confusion (#533)
Channels require a separate channel_post_handler, so this example is currently broken and confusing
This commit is contained in:
parent
c153d681fb
commit
901270449f
1 changed files with 3 additions and 3 deletions
|
|
@ -19,12 +19,12 @@ bot = Bot(token=API_TOKEN)
|
|||
dp = Dispatcher(bot)
|
||||
|
||||
|
||||
@dp.message_handler(chat_type=[ChatType.PRIVATE, ChatType.CHANNEL])
|
||||
@dp.message_handler(chat_type=[ChatType.PRIVATE, ChatType.SUPERGROUP])
|
||||
async def send_welcome(message: types.Message):
|
||||
"""
|
||||
This handler will be called when user sends message in private chat or channel
|
||||
This handler will be called when user sends message in private chat or supergroup
|
||||
"""
|
||||
await message.reply("Hi!\nI'm hearing your messages in private chats and channels")
|
||||
await message.reply("Hi!\nI'm hearing your messages in private chats and supergroups")
|
||||
|
||||
# propagate message to the next handler
|
||||
raise SkipHandler
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue