flaree / flare-cogs

Various cogs written for Red-DiscordBot
MIT License
76 stars 69 forks source link

[forward] Fix Optional recipient #191

Closed Lifeismana closed 1 year ago

Lifeismana commented 1 year ago

this pr fixes 2 thing linked to the fact that recipient is now optional in dpy2:

flaree commented 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.

Lifeismana commented 1 year ago

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)

flaree commented 1 year ago

Will take it as is, if it turns out to be problematic then I'll address it then. Thanks for the PR