fix: error in voice (or thread ?) text channel#4
Conversation
Update Interaction.lua to not error when trying to save a new message in voice (and thread?) text channels because channel parent doesn't exist
|
This is a breaking change, this method can only be returning a Message object or an error tuple. Any other ideas? |
|
The thing is, everything worked fine, the interaction got responded to and stuff though only when it tries to log the new message in the channel it errors. So we should either as you said fully implement support for those channels or check the channel type when trying to put the message in the cache (I assume that's what its doing) and act accordingly |
|
I am aware it works just fine, but errors when trying to construct a message object. We don't have to check the channel type at all, just check if _channel is nil, and if it is do The side effect of this is that you cannot tell when the interaction has actually succeeded but failed to construct the message object on client side, or if it legit failed at Discord side. Users can still match for the returned error message I guess, really not cool :( Discordia is currently accepting similar PRs, so we may want to look into something like SinisterRectus/Discordia#355. |
|
I guess technically we also have another solution, simply ignore any Interaction received with no Or alternatively, we could also do the same as above, but instead of checking for _channel after making the request, we could make _sendFollowup fail before |
|
@Ta-noshii For now, you can ignore all interactions that does not have a channel object to prevent your bot from crashing, that is, do not |
|
Thanks! |
Update Interaction.lua to not error when trying to save a new message in voice (and thread?) text channels because channel parent doesn't exist