简体   繁体   中英

How to get a telegram bot work in a channel?

I can't get it to work through properties like command or just content_types. No errors show up.

@dp.message_handler(commands=["start"])
async def start(msg:Message):
    if msg.chat.type == ChatType.CHANNEL:
        await msg.answer(msg)

I made so bot sent a message to the channel. Still nothing.

PS It works with getUpdates

In the Dispatcher class there is a decorator called "channel_post_handler".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM