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 an example for slash commands #815

Closed
Artemis21 opened this issue Oct 4, 2021 · 5 comments
Closed

Add an example for slash commands #815

Artemis21 opened this issue Oct 4, 2021 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@Artemis21
Copy link

Would it be possible to add an example of a slash command bot to the examples folder? I notice that this library seems to support them, but I can't find any documentation on how to use them (maybe I am missing something?).

Even if there is documentation I have not been able to find that does provide a high level overview of using slash commands, I think it would be helpful for the sake of completeness to add an example for them. Slash commands are a major feature that I imagine many (if not the majority of) new bots aim to use.

Related: #771

@Artemis21 Artemis21 added the enhancement New feature or request label Oct 4, 2021
@FasterSpeeding
Copy link
Collaborator

This isn't an answer to this issue since examples isn't generally within my realm but if you want a higher level experience with slash commands I'd generally point you towards one of the command handler extensions to this lib (since it doesn't ship a builtin command client) (these are listed in the additional resource part of the readme).

What might be helpful is to point people towards these wrapping command client within the docs more.

@davfsa
Copy link
Member

davfsa commented Oct 5, 2021

The thing with slash commands is that there is a lot of work that has to go into it to properly handle it. It's not as easy as it was with message commands.

Maybe its worth having a dummy README to examples with Lightbulb and Tanjun for that, as snab suggested

@Artemis21
Copy link
Author

Ok, so this library provides low level basic API wrappers for slash commands, and recommends using third party libraries which build upon that to provide slash command frameworks? Nice. Maybe that could be more prominently clarified in the README/website but idk 🤷

@davfsa
Copy link
Member

davfsa commented Oct 5, 2021

Ok, so this library provides low level basic API wrappers for slash commands, and recommends using third party libraries which build upon that to provide slash command frameworks? Nice. Maybe that could be more prominently clarified in the README/website but idk 🤷

Its not that, its just that gateway based slash commands can be quite hard to manage, as they are not meant to be used like that. We provide an implementation for a rest bot, as they don't have different ways of being implemented. You just listen to the incoming calls and act based on them.

I guess examples could be made for gateway based slash commands as well as REST based, with the gateway based one might have a lot of edge cases that will need to be handled.

@davfsa davfsa added documentation Improvements or additions to documentation and removed enhancement New feature or request labels Nov 9, 2021
@davfsa
Copy link
Member

davfsa commented Jan 2, 2023

Sort of sorted out by the addition of https://github.com/hikari-py/hikari/blob/master/examples/slash.py. The rest of this PR would fall under #835.

@davfsa davfsa closed this as completed Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants