Slash Commands, Message Components, and Interactions#31
Conversation
- Mappings & REST methods for application command - Mappings & REST methods for interactions - Mappings for message components - INTERACTION_CREATE gateway event
- Update examples to conform this changes
greenbigfrog
left a comment
There was a problem hiding this comment.
Some thoughts I noticed during a first quick glance.
8d21237 to
f082168
Compare
…into interactions
…into interactions
ccff49b to
4b56412
Compare
|
Working on to add support for permissions v2, but I'm not sure how I should implement Relevant doc: https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions |
The request method already takes headers as an argument. diff --git a/src/discordcr/rest.cr b/src/discordcr/rest.cr
index 5fcb123..6ef619d 100644
--- a/src/discordcr/rest.cr
+++ b/src/discordcr/rest.cr
@@ -22,7 +22,9 @@ module Discord
mutexes = (@mutexes ||= Hash(RateLimitKey, Mutex).new)
global_mutex = (@global_mutex ||= Mutex.new)
- headers["Authorization"] = @token
+ unless headers["Authorization"]?
+ headers["Authorization"] = @token
+ end
headers["User-Agent"] = USER_AGENT
headers["X-RateLimit-Precision"] = "millisecond"and then within the edit_application_permissions method, just pass in a custom authorization header with a bearer token. |
|
Oh, you're right. Seems like I just didn't read the code. |
Co-authored-by: Splatterxl <splatterxl@outlook.ie>
|
Hi :) Sorry that it's been so long since there's been any activity! Would it be possible to add a couple of specs for this? Otherwise, I didn't see any issues with the code, but I'm also the most junior developer on hand, so take that with a grain of salt. |
|
Hi, thanks for taking your time to look through my PR. And yes, I can definitely add some specs for it, but I can't exactly tell when it will be ready. I think I will have some time by the end of this month, so hopefully it will be ready in the next month or so. |
Awesome! I mean, after the response time to your PR taking a couple weeks is definitely no problem! Thanks for your support for the library! :) |
|
I've added some specs for the structs that require custom json parsing, please let me know if there's anything missing! |
|
@PixeLInc do you think you'll have time to review this at some point? I don't feel confident/knowledgeable enough to truly approve this. |
|
Everything seems to be good and functional. Any idea why I'd get a 401 when trying to bulk overwrite global application commands though? |
|
Thanks for looking through the PR! |
|
@soya-daizu I knew it had to be something stupid like that. Of course adding the |
EDIT(Oct. 2022): I'm still around and the branch is still being maintained with support of the newer interaction related features. Please report any issues if you found any!
Now that #19 and #20 are being kinda dead, here's my attempt to implement all these features. The added lines are about a quarter of that in #19 and #20 combined, and while some part of the code may not be the best, at least I will try to be active as I can and address any problems pointed out.
This is the first time for me to implement all this stuff while reading docs, and the changes ended up pretty big still, so I would like to have some feedback first.
Some notes about the changes:
PartialApplicationCommandidand other fields that are not used when registeringPartialGuildMemberdeafandmutefields