CactusDev / CactusBot

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

Remote triggers #179

Open Alkali-Metal opened 7 years ago

Alkali-Metal commented 7 years ago

Currently with the Handler system, there is no way to make an addition to your bot without actually locally hosting it, I personally think some way to have a locally running handler interacting with your remotely hosted bot would be cool and would add more support for community developers, how I was thinking this could be implemented is something similar to, if not, the API and a magic-command for each bot which is owner only and is forced whisper response, which responds with what I would imagine to be the Handler API token and Password.

I am not sure if this is even possible but it would be a really cool tool for developers and people who don't know much about coding using someone else's add-on to make their bot more awesome.

2Cubed commented 7 years ago

Hmm... definitely an interesting idea.

Maybe we could implement this using Sepal and a new type of Packet? When a magic command runs, it can return this new packet, and a new Handler would send the response to Sepal, which can be read by a custom (authenticated) client?

Alkali-Metal commented 7 years ago

So from what I am understanding of what you said it would require a magic command being run to initialize the packet then it would go to Sepal where the authenticated remote handler would be able to read it? Just checking to make sure that I am understanding everything correctly.

2Cubed commented 7 years ago

Yep! Here's a way to simplify the magic command aspect, actually

We could add a !trigger command. When you run !trigger <name> [args...], the contents of what you wrote are sent to subscribing Sepal clients. So, !trigger wither would send a packet through Sepal, which a client would receive and spawn a Wither. And once we have magic aliasing, you could turn that into !wither, as well.

Alkali-Metal commented 7 years ago

Oooooohhh, I see how that would be working! That would be totally coolio!