Discord Bots19 articles
Hosting a Discord bot: uploads, tokens, dependencies and staying online.
Getting your bot online for the first timeFrom a folder on your computer to a process that stays running without you.Keeping your bot token out of troubleThe token is the bot. Anyone who has it is the bot. Treat it accordingly.Dependencies: package.json and requirements.txtHow the server knows what to install, and why «it works on my machine» stops here.Your bot shows offline in DiscordWorking through it in the order that finds the cause fastest.Privileged intents, and the errors they causeWhy your bot cannot read messages, see members, or starts with a «disallowed intents» crash.Your slash commands do not appearRegistration is separate from your code running, and that is the whole confusion.How much memory does a Discord bot need?Honest numbers, and the two things that actually move them.Keeping the bot up: restarts, crashes and schedulesWhat to automate, what to fix, and how to tell which is which.Rate limits: what they are and how to stop hitting themDiscord throttles bots that ask for too much too fast. The fix is usually in your loop.Storing data your bot needs to rememberJSON files, SQLite and MySQL — which one, and when to move up.Updating your bot without breaking itA routine for pushing changes that does not end with a broken bot and no way back.Permissions: why your bot cannot do the thingRole position, channel overrides and the hierarchy rule that catches everyone.Logging that tells you what happened after it happenedConsole output disappears at the next restart. This is what to do instead.Sharding: what it is and when you are forced into itA threshold most bots never reach, and what changes when yours does.Python or JavaScript for a Discord bot?Both are fine. Here is what actually differs when you have to host it.Music bots, and why they keep breakingThe most requested feature and the least stable one. Here is what you are taking on.Embeds: the limits nobody reads until they hit oneWhy a message that worked in testing fails in production with real data.Making a bot do something on a timerDaily posts, reminders and cleanup — and the three ways timers go wrong.Webhooks: posting to Discord without a bot at allThe simplest thing in Discord, and the one people build a whole bot to avoid learning.