The problem is, it keeps getting all these events I don't need. Finally, I realized I could do this:
event.event.unsigned.age < 6000
to check if an event is from the past 60 seconds. This is good enough, but it doesn't seem to always work. For instance, it always greets t2bot's Discord Bridge user (@_discord_bot:t2bot.io) when it starts up, and I don't know why.
My desired behavior is to make the bot start up, mark everything as read, then from that point on respond to room join events.
Hi, I'm trying to make a very simple bot that greets users when they enter a room. Source code: https://gitlab.com/alexgleason/solarus-welcome-bot/blob/master/bot.js
Concept:
The problem is, it keeps getting all these events I don't need. Finally, I realized I could do this:
to check if an event is from the past 60 seconds. This is good enough, but it doesn't seem to always work. For instance, it always greets t2bot's Discord Bridge user (
@_discord_bot:t2bot.io
) when it starts up, and I don't know why.My desired behavior is to make the bot start up, mark everything as read, then from that point on respond to room join events.