CactusDev / CactusBot

An open source, community-written service-agnostic chat bot
MIT License
30 stars 6 forks source link

Bot responds to its own messages #101

Closed 2Cubed closed 7 years ago

2Cubed commented 7 years ago

When the bot sends messages, its handlers receive them afterwards. This makes the bot vulnerable to cyclic command responses (!a -> !b, !b -> !a), responding to itself for "spamming" (!cactus twitter, Please do not post links., etc.), and so on.

pylang commented 7 years ago

@2Cubed Do message packets/json have something similar to an author key? You could tell CB not to respond to "self" for example.

2Cubed commented 7 years ago

@pylang They do! However, it's possible that the author is not exactly the same as the self written in config. (For example, Discord config is just an authkey, NxWYTOQxdrweuoyxEFIOWjxzYxFOY3jY-ish, which means that we can't really match it against that. Rather, we'd need to use some data that Discord responds with upon connection.) It's not impossible to fix, but until the larger things are done, it's more work than it's worth to look into.

pylang commented 7 years ago

Well discerned good sir : )

Innectic commented 7 years ago

Fixed: https://github.com/CactusDev/CactusBot/pull/122