shawnanastasio / python-matrix-bot-api

A Python API for making Matrix bots (https://matrix.org).
GNU General Public License v3.0
92 stars 34 forks source link

example_bot.py Hi command floods forever #19

Open vranki opened 5 years ago

vranki commented 5 years ago

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

It replied with

Hi, @: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.

shawnanastasio commented 5 years ago

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.

vranki commented 5 years ago

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?

shawnanastasio commented 5 years ago

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