I did some searching but was only able to find a Hubot adapter - is there any way to create a bot that could be used to accomplish relatively complex tasks such as running a forum game? I’ve seen some forums running on other platforms use bots to great effect in this manner, and was wondering if it is possible to set up a similar system on Discourse.
If this needs to be moved, please feel free to do so, but this seemed to be the most appropriate place to ask.
API tokens can only be handed out by administrators (or manually sussed out of browser cookies, but you’re not supposed to do that). If somebody wants to add a bot, they’re supposed to ask a staff member, who will give them the token.
User API is doable but it requires a rather complex protocol. Simplest thing is to have admins issue admin api keys that are tied to a specific user (bot user in this case)
API keys can be linked to users, but they’re created in the Admin page. I (being a non-admin) can’t just click a button and get an API key for Meta like I can on (for example) GitHub.
What kind of bots are you building out of curiosity?
If you’re not building on top of Hubot, I’d recommend taking the same approach as I did with the Hubot adapter, and listen with the message bus for notifications.
You can get a pretty good idea of how to use the Discourse API for getting messages, and responding by looking at the adapter source, too.
The basic idea is to build a bot to automatically run a small game of Mafia. Ideally, it would have several functions, such as counting votes, carrying out player actions, and automatically progressing through the game’s day and night cycles without requiring somebody to do so manually.
I won’t have time to work on this for a few months because school, so I’m just gathering information at this point. Should streamline the process later.