hikari icon indicating copy to clipboard operation
hikari copied to clipboard

Add an example for slash commands

Open Artemis21 opened this issue 2 years ago • 4 comments

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 avatar Oct 04 '21 21:10 Artemis21

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.

FasterSpeeding avatar Oct 04 '21 22:10 FasterSpeeding

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

davfsa avatar Oct 05 '21 05:10 davfsa

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 :shrug:

Artemis21 avatar Oct 05 '21 16:10 Artemis21

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 avatar Oct 05 '21 16:10 davfsa

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 avatar Jan 02 '23 13:01 davfsa