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:
Aleksandr 2021-03-20 20:23:30 +03:00 committed by GitHub
parent c153d681fb
commit 901270449f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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