python-matrix-bot-api icon indicating copy to clipboard operation
python-matrix-bot-api copied to clipboard

example_bot.py Hi command floods forever

Open vranki opened this issue 6 years ago • 3 comments

I just tested the example bot with a direct chat and said "Hi".

It replied with

Hi, @<my_id>:matrix.org Hi, @<bot's_own_id>:matrix.org Hi, @<bot's_own_id>:matrix.org Hi, @<bot's_own_id>:matrix.org Hi, @<bot's_own_id>:matrix.org

.. forever until I stopped the bot.

vranki avatar Jan 18 '19 14:01 vranki

Did you properly set the username in example_bot.py?

The bot filters out its own messages from triggering handlers by checking to see if the message was sent by the username that the MatrixBotAPI instance was constructed with.

shawnanastasio avatar Jan 18 '19 18:01 shawnanastasio

I set it as the matrix id (@<bot's_own_id>:matrix.org) .. should it be the full ID or just the username part without homeserver?

vranki avatar Jan 21 '19 09:01 vranki

It should just be the username (w/o server). Perhaps this should be clarified in the documentation

shawnanastasio avatar Jan 22 '19 03:01 shawnanastasio