goopypanther / saucebot-discord

17 stars 13 forks source link

Bot spamming posts #26

Open FloydianSystem opened 2 years ago

FloydianSystem commented 2 years ago

There's been an overabundance of issues regarding saucebot posting the image when the link was already embeded, or clogging up chat three times over. Furthermore, there's a compatibility issue with PluralKit where the posts embeded by PK proxies are then reposted by saucebot.

Example: image

goopypanther commented 2 years ago

Two different issues here, I'm rolling the first one into #27.

I assume the "clogging three times over" occurs when a pluralkit user posts a tweet, saucebot posts its image preview because it detects the tweet is sensitive (which use to usually mean no discord embed was generated) and then pluralkit deletes the original discord message and recreates one with webhooks. Discord generates its normal image embed for this new message (it does this for some sensitive posts and not others, though it sounds like twitter might have recently fixed things to make it work for all tweets again). Saucebot then responds to the new message created by pluralkit and posts another image preview for a total of 3 copies of the same pic. Ugh.

A similar thing can happen for other types of posts by pluralkit users because pluralkit sometimes erases the initial post and replaces it so fast the discord servers never send the notification of the original post to saucebot, other times saucebot receives notifications for both posts and responds to both. It would be easy to ignore all webhook generated posts but this would break saucebot for pluralkit users the majority of the time unless they knew to switch off pluralkit for the posts they wanted saucebot to be able to preview for them.

I don't really know what to do for this, implementing a fix for twitter's behavior would at least reduce this to 2 copies of the same image but intelligently handling pluralkit posts seems to require a lot of changes to how saucebot works (the bot is basically stateless and has no capacity to understand "recent messages" or the order that messages arrive in, or messages being deleted).