cbrxyz / pi-bot

🤖 Scioly.org's resident bot
9 stars 5 forks source link

Add reply support for auto-censor #318

Open cbrxyz opened 3 years ago

cbrxyz commented 3 years ago

Auto-censor should show message that was replied to

Nydauron commented 3 years ago

We'll prob have to wait for the API to allow replies to be applied for webhooks.

cbrxyz commented 3 years ago

For full reply support, yes, but I just thought for now the webhook would prepend the original censored message with something like: Replied to user: Message text is here

Nydauron commented 3 years ago

It would also require Message objects to contain a reply attribute to distinguish if the message is a reply in the first place. As of 1.6.0, the API only offers Message.reply() which replies to the message object directly. I don't even know if reply data can even be fetched currently. Probably best to hold off on this til Discord decides to update with these features.

cbrxyz commented 3 years ago

Yep, looks like you are right on that one. Thanks for looking into that!

pandabear189 commented 2 years ago

It would also require Message objects to contain a reply attribute to distinguish if the message is a reply in the first place. As of 1.6.0, the API only offers Message.reply() which replies to the message object directly. I don't even know if reply data can even be fetched currently. Probably best to hold off on this til Discord decides to update with these features.

Using, Message.reference is an option: https://discordpy.readthedocs.io/en/latest/api.html#discord.Message.reference

Nydauron commented 2 years ago

Looking at the 2.0 docs now, it looks like they finally made WebsocketMessage inherit discord.Message finally, so reply() is implemented. We can just use that.

https://discordpy.readthedocs.io/en/latest/api.html#discord.WebhookMessage.reply

pandabear189 commented 2 years ago

Looking at the 2.0 docs now, it looks like they finally made WebsocketMessage inherit discord.Message finally, so reply() is implemented. We can just use that.

https://discordpy.readthedocs.io/en/latest/api.html#discord.WebhookMessage.reply

Isn't webhook message the webhook you sent? I don't think webhooks can reply to other messages yet

cbrxyz commented 2 years ago

It looks like Eric is correct. Doesn’t appear to be implemented yet in the Discord API.