Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more ways to call commands #9

Open
L0neGamer opened this issue Apr 25, 2021 · 3 comments
Open

Add more ways to call commands #9

L0neGamer opened this issue Apr 25, 2021 · 3 comments
Labels
backend issues involving the guts of tablebot enhancement New feature or request

Comments

@L0neGamer
Copy link
Collaborator

L0neGamer commented Apr 25, 2021

This'll require a big-ish rewrite in places but should be fine, right?

Firstly, let the bot commands be called by @ ating the bot followed by a command; for example, @tablebot quote add "this is a quote", or whatever quote syntax is.
Secondly, let an administrator change the prefix for commands so they can prevent overlaps, and let this prefix be multiple characters if they wish; for example, tb!quote add "this is a quote", or ~quote add "this is a quote"
Thirdly, add slash command support. I'm not sure how slash commands work, but it'd be good to have them.

@finnbar
Copy link
Collaborator

finnbar commented Apr 26, 2021

(1) and (2) are really cool ideas, and would require only a minor rewrite - currently the prefix is a single argument retrieved from the environment, but it could be stored in a database and updated by a mod. You'd also need to update the prefix parser in Tablebot.Handler.Command - currently it just checks for chunk prefix (a direct match on the prefix), but you could extend it with chunk prefix <|> (@tablebot parser). Note that Discord won't return this as @tablebot but <@somenumber>, which will need to be found.

I'm not sure discord-haskell supports (3) yet, and as such I don't think it'll be possible. But maybe in future!

@finnbar finnbar added the enhancement New feature or request label Apr 26, 2021
@the-Bruce
Copy link
Member

Unfortunately for 3, the author of discord-haskell has announced that they have no intention of adding that, so we'd either have to find another framework that does (which I don't believe there are any, yet), or write our own. Also, as slash commands do the parsing for you, we'd need to migrate fully to smart parsers to be able to support them transparently (or fully separate slash commands from prefix commands, which makes certain kinds of plugins rather hard to write.

@L0neGamer
Copy link
Collaborator Author

This pr adds application commands and therefore some level of slash commands to the bot.

#118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend issues involving the guts of tablebot enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants