Skip to content

message handler not firing for a message containing media #570

@DavMrc

Description

@DavMrc

Context

  • Operating System: Windows 10
  • Python Version: 3.8.5
  • aiogram version: 2.11.2

I am encountering an issue in the simplest callback: it does activate when the message is text only, but fails whenever any media is attached. This includes photos, videos, audios, stickers and GIFs, with or without caption.

I hope I'm not missing out on something.

import aiogram


class TelegramBot(object):
    def __init__(self):
        self.bot = aiogram.Bot(token="TOKEN")
        self.dispatcher = aiogram.Dispatcher(bot=self.bot)
        self.dispatcher.register_message_handler(self.on_msg,)

    async def on_msg(self, msg: aiogram.types.Message):
        print("Message received in telegram")

Expected Behavior

The callback is fired for every type of message.

Current Behavior

The callback is fired only for text messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    question issueIt's not really an issue, but a question

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions