codinglab-io / discord-bot

Discord bot for Codinglab's server.
https://discord.com/invite/codinglab-174169014568878080
MIT License
19 stars 14 forks source link

feat: allow deletion of fxtwitter bot link #86

Closed ayoubqrt closed 11 months ago

ayoubqrt commented 12 months ago

⚠️ This feature needs a new environment variable: FIX_EMBED_TWITTER_VIDEO_EXCLUDED_CHANNEL_ID

For this feature, I use native custom buttons of Discord. I use them for multiple reasons because the UX and the DX is better.

Now this feature is called only when the tweet contains a video. So the bot will reply with the link of the fxtweet. Two buttons will be available, one if the user want to delete the bot's answer, and the other to ignore the buttons (because buttons take a lot a place). If the user has ignored buttons and still want to delete the bot's answer, he can react with the emoji 🚮 (limitation: if the bot restart, it will not work).

The only problem with buttons is that it can't be only displayed to the user that sent the message. The message can ONLY be ephemeral after a user use a slash command.

I used native buttons because there is some limitations with emoji reaction:

ayoubqrt commented 11 months ago

@luca-montaigut @potb @neolectron some of you can review ?

ayoubqrt commented 11 months ago

@potb as I said for the partials, it's mandatory to fetch all the messages because when u have a partial message, u only have the ID. It's a decision to take but for me it's no necessary. Let's try with this version of this feature and we will see

ayoubqrt commented 11 months ago

And sorry for the force push, I need to see for the next time how to manage the fact that you merged master on my branch @potb