Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.72k stars 2.3k forks source link

Add a start_dm option to SimpleMenu #6282

Closed Flame442 closed 8 months ago

Flame442 commented 8 months ago

In order to support [p]help with a button menu in DMs, SimpleMenu needs to be able to be sent as a DM to a particular user [Ref]. The current SimpleMenu.start method accepts a Context object, which is incompatible with this behavior. SimpleMenu should be given a new method .start_dm(user: discord.User), which sends the menu as a direct message to that user.

Developer note: SimpleMenu currently stores self.ctx in .start, however it does not appear to ever be used. The other two attributes set by .start (message and author) will be possible to set in this method.

Unblocks #5375

yeetbruises commented 8 months ago

I would like to take on this issue as my first GitHub contribution. I have experience in python discord bots so I think I could solve this.

Jackenmen commented 8 months ago

@Flame442 any reason we shouldn't consider expanding .start() to allow passing discord.User instead of creating another method? It's mostly just an alternative design but I feel like it may be a bit more aligned with how we generally do these kinds of APIs in Red wherever it makes sense?

Flame442 commented 8 months ago

I don't have strong opinions about which option is better, see https://github.com/Cog-Creators/Red-DiscordBot/pull/5375#issuecomment-1874660248 for where I asked Trusty what he thought the best approach was.

yeetbruises commented 8 months ago

Thank you :)

Flame442 commented 8 months ago

(Context deleted) If you need help working on the issue, please ask in the #coding channel of the red server (without pinging any particular user).