Closed Lifeismana closed 1 year ago
I feel that if the channel is None from a get the it shouldn't do an API request, we can probably just assume. Otherwise depending on a bots size that can be a sizeable amount of requests.
Indeed that could make quite a lot of request. What do you want to assume ? because if we discard the message get_channel returns None, (which is the case for every dm the bot receives (for my small testing)) we won't forward anything or if we don't display the recipient, we'll also forward ephemeral messages that the bot sends via an interaction.
One solution could be to make it toggleable & by default at off, and instead of displaying the user, we display the channel id and add a command to easily fetch the recipient from the channel id (but then we would still have the problem of ephemeral messages)
Will take it as is, if it turns out to be problematic then I'll address it then. Thanks for the PR
this pr fixes 2 thing linked to the fact that recipient is now optional in dpy2:
Ephemeral message sent in response to an interaction don't have a guild since their channel is a DMChannel but its id is one of a GuildChannel, so if we fetch it, we'll get a channel that doesn't have a recipient, the way i fixed that is by discarding the message if its fetched channel isn't a DMChannel
This pr was tested without problems with an account that wasn't the bot owner