User installed command events not being received.
My application has
User Install
enabled in the developer portal and both integration_types
and contexts
are also added to the commands that should be used by users and the types of channels they can be used in.
Kord doesn't official support User Apps but I modified the outgoing payload to add the two fields which does work, and some checks once an interaction is received to determine if it's an user app or server app integration type.
The issue is I only receive events if the bot was installed to the guild. Previously (several hours ago), I did receive events for user installed apps in other guilds, DMs, and Group DMs.
I've tried deleting the commands and adding them back, tried unauthorising the app and authorising them again, and removing the two fields above to add them back. Nothing seems to fix this issue.
If code is useful:
Why might this be happening?11 Replies
i haven't yet looked into user-installed apps, but let me know if you figure it out
I receive user installed app interactions just fine
I did previously, but now I don't receive them at all. I tested it with a node.js app and I do receive them so it's something with Kord that isn't working
I even wrote some code to limit sub commands to guilds while others can be used everywhere. User apps worked then since I had to test the code after writing it, but now I just don't receive events
Is there something different with your listeners that might point me in the right direction?
I use kordex
ah, i setup a custom system because i prefer this method of defining commands
is there a generic InteractionCreateEvent i can listen to? or even a raw event?
It's called InteractionCreateEvent
You can also turn the log level to trace
That way you can see whether the event comes in
I do receive the user app interaaction by the generic InteractionCreateEvent
I'm not sure how to do that exactly
I am in bed rn, so simply Google how to setup an slf4j impl and how to configure that
Can't give a detailed explanation rn
That's all good, I can figure that out. At least I know I'm receiving the event but Kord isn't processing it anymore
Ah I found the issue, apparently you can't call
ChatInputCommandInteraction#getChannel()
as a user app, it throws a 403. Since I use reflection in my system it silently went by when using Callable#callSuspendBy()
. I thought the JVM would still throw an error but I suppose not.
I thought of allowing the user to enable/disable other users from using interactions with them but it appears you can't get the channel to see if it's a DM channel or the members in it. It makes sense since it's ran by the user but it also respects the permissions the user has, so if they can see the channel, then the user app interaction should be able to as well?
Talking to advaith about this, user apps can only access what is in the interaction. I thought it could get some basic info like the channel it was in but the routes are bot only and the bot can't be present in DMs/guilds it wasn't added to