Closed PersonMeetup closed 3 years ago
Are you uploading (tweeting) a duplicate tweet? Twitter will not allow the same account to tweet identical content within 24 hours.
Yes, but not on purpose. The code is supposed to tweet only once, and I bet it gets around the identical content filter with the inclusion of the photo in the second tweet. Let me know if you need any other details.
Did I answer your question? The code you attached does not check if it is tweeting duplicate content. You would need to fix that.
Alright, I'll look into seeing if any content is duplicated then, sorry about that.
There's still some confusion though. As I stated, this only happens with the Linux Lite build I'm using to host the bots on (running the same code on Windows does not produce this problem), and it seems like it only happens with the bot's code. Could just be some jank that comes from running Python code on Linux, but who knows.
If you have access to the bot's code, you might just search the code for 'statuses/update' and see if it checks for duplicates before tweeting. But for this to work, the bot would need to save every tweet from the past 24 hours to check against.
I would guess it should be as simple as keeping a cache of sent tweet ids available, so that should be doable. Probably would be more in-depth compared to logging functions as well, since those didn't report 2 tweets being sent out.
Saving the tweet id is not going to work. Try tweeting "blah blah" twice. The second will not go through even though their tweet ids are different.
Alright, I've managed to fix the bot so that it's not creating duplicate tweets anymore (I had the discord file handle downloading images instead), but now I'm coming to the problem that media isn't being sent out with the status message anymore. If wanted I can give the updated code, but other than that I'm going to be closing the issue since the original problem has been solved. (Thanks for trying to help btw. Feel like I might have been annoying to respond to.)
Honestly, the solution might be to take a hammer to Linux.
I'm hosting a Discord Bot that forwards messages to a Twitter account on a build of Linux Lite. I've recently added functionality that allows for images to be posted with tweets as well, but I've found that I get duplicate tweets. I expect that this is an error on my end as the example code provided in the repo works fine, but I don't understand why this is occurring. I have tested the bot on Windows, and it works correctly.
For reference, here is my code.