Discord-Bot-Server-Message-Auto-Saver
Discord-Bot-Server-Message-Auto-Saver copied to clipboard
A Few Tips
Hello, I noticed that you code a lot using Discord's API, and I just wanted to offer a few tips for this specific project.
First of all, you probably shouldn't use the invite or login API in your scripts. Using the invite API will lock any user token that uses it outside of the Discord domain unless the account has phone verification, and the login API is strictly bound to the official Discord domain. Instead, try to make workarounds for this (ie. prompt users to join an invite link or use selenium to automate actions in the background). I noticed you used both of these endpoints in your script, and with Discord's current selfbot prevention, some changes may need to be made.
Secondly, you should create a file caching system for message logging. I've been creating my own message logger, and one of the key issues I ran into is that when a user deletes a message, if you didn't previously view any of the image attachments then the links will not work even if you grab them. To work around this, I would have your script download every attachment in each message, upload the files to a cloud system (and return the link), then delete the files off your machine. This way, you can preserve any image someone sends even if they delete it.
Thirdly, you should block out any messages from bots. While this means you won't log bot messages, it also means that you will have far less clutter and your logger can work much faster. Most of the time the bot messages are superfluous anyways, so cutting them out for more speed is worth it in my opinion.
Fourthly, I recommend having your logger send all the message data through a webhook embed. While this takes more effort on the developer's part (and the user's since they need to make a webhook), it allows anyone using the script to more easily view the information. You can do this while also saving the raw data to a backup file, that way the user has both the raw data and the easily readable data. As a side note, webhooks can use any Discord emote, so that just adds onto readability.
Finally, this may seem a little unnecessary, but you should probably put disclaimer warnings on your selfbot projects. While most users should know what they're getting into when they type "Discord selfbot", it's still good to create disclaimers in case anyone gets banned from Discord for using your scripts and decides to throw you under the bus. People who use selfbots should understand the consequences and take any responsibility for using them, the creator shouldn't have to suffer said consequences simply for creating the product that was misused by the consumer.
Anyways, I'm off to spend 8 hours straight banging my head against coding errors. See ya.