Discord bots
Build, deploy and keep your bots online.
30 articles
- Discord API rate limits (429) explained for bot developersWhat Discord 429 rate limits are, how discord.js and discord.py handle them for you, and which bot patterns trigger them so you can avoid them.
- Discord bot is online but not responding to commandsYour bot shows online but ignores messages or slash commands. Check intents, message content, permissions, registration and duplicate instances.
- Fix "An invalid token was provided" (TokenInvalid / LoginFailure)Fix discord.js TokenInvalid and discord.py LoginFailure errors: get a fresh bot token, check your .env file and make sure the token actually loads.
- Fix "Cannot find module" and "ModuleNotFoundError" for botsFix missing package errors when your Discord bot starts on Schokr: add packages to package.json or requirements.txt and check file paths and names.
- Fix "This interaction failed" and "The application did not respond"Why Discord shows This interaction failed or The application did not respond for slash commands and buttons, and how to defer slow replies.
- Hosting a Discord music bot: Lavalink, resources and rulesWhat you need to run a Discord music bot: voice libraries, FFmpeg, Lavalink, how much memory and CPU to give it, and content and terms of service to consider.
- How to add buttons and select menus to a Discord botSend buttons and select menus with discord.js v14 (ActionRowBuilder) or discord.py views, handle clicks, and keep them working after a restart.
- How to add slash commands in discord.py (app_commands and tree.sync)Create slash commands with discord.py 2.x app_commands, sync them to one server or globally with tree.sync, and fix commands that don't show up.
- How to create a Discord bot and get its tokenCreate a Discord application in the Developer Portal, add a bot user, copy its token and find the application ID you need for slash commands.
- How to deploy a discord.js bot to SchokrUpload a discord.js bot to an Schokr Node.js server, install dependencies from package.json, set the startup file and keep it running 24/7.
- How to deploy a discord.py bot to SchokrRun a Python Discord bot 24/7 on Schokr: upload your code, list packages in requirements.txt, add a .env file and set the startup file.
- How to fix "Used disallowed intents" (privileged intents)Fix the Used disallowed intents and PrivilegedIntentsRequired errors by enabling Message Content, Server Members or Presence intents in the Developer Portal.
- How to host a Discord bot on Schokr for freeAn overview of running a Discord bot 24/7 on Schokr with the Node.js, Bun or Python runtime: what you need, how much memory to give it, and where to start.
- How to host a TypeScript Discord bot on SchokrDeploy a TypeScript discord.js bot on Schokr: compile to dist with tsc and run it on the Node.js template, or run the .ts files directly with Bun.
- How to host multiple Discord bots on one Schokr teamRun several Discord bots on Schokr's free plan by giving each its own server and splitting your team's 6 GB memory, CPU and disk pool between them.
- How to invite your Discord bot to a serverBuild an OAuth2 invite link with the bot and applications.commands scopes and the right permissions, then add your bot to a Discord server.
- How to make a discord.js bot from scratch (v14)Set up a discord.js v14 project, create a Client with GatewayIntentBits, log in with a token from .env and reply to your first command.
- How to make a discord.py bot from scratch (2.x)Create a discord.py 2.x bot with intents and commands.Bot, load the token from a .env file and respond to your first command.
- How to organise a discord.py bot with cogsSplit a discord.py 2.x bot into cogs and extensions, load them in setup_hook, and fix common errors like ExtensionNotFound and missing setup functions.
- How to read your Discord bot's logs in the Schokr consoleFind errors in your bot's console output on Schokr, read a stack trace, fix missing Python output and save logs to a file you can open later.
- How to reduce your Discord bot's memory usageLower RAM use for discord.js and discord.py bots with fewer intents, cache limits, sweepers and leak checks, so they fit Schokr's free resource pool.
- How to register slash commands in discord.js (global vs guild)Create slash commands with SlashCommandBuilder in discord.js v14, register them globally or to one server, and handle them in interactionCreate.
- How to run a Discord bot with Bun on SchokrHost a discord.js bot with the Bun runtime on Schokr: run TypeScript without a build step, use Bun's built-in .env loading and install with bun install.
- How to schedule recurring tasks in a Discord botRun code on a timer in your bot: node-cron for discord.js and discord.ext.tasks for discord.py, with time zones and error handling explained.
- How to send embeds with discord.js and discord.pyBuild rich Discord embeds with EmbedBuilder in discord.js v14 or discord.Embed in discord.py, plus the field and character limits to stay under.
- How to split discord.js commands into separate filesBuild a simple discord.js v14 command handler that loads each slash command from its own file in a commands folder, registers them and runs them.
- How to store your Discord bot token safely (.env and dotenv)Keep your Discord bot token out of your code with a .env file, dotenv or python-dotenv, and reset the token right away if it ever leaks.
- How to update your Discord bot's code on SchokrUpload new bot code on Schokr and restart with minimal downtime: what to replace, when dependencies reinstall, and how to shut down cleanly.
- How to use a database with your Discord bot (SQLite)Store bot data like settings and XP in SQLite on Schokr with better-sqlite3, bun:sqlite or aiosqlite, or connect to an external database provider.
- Why does my Discord bot keep going offline or crash looping?Stop a Discord bot from crashing or restarting in a loop: catch unhandled errors, fix memory limits and avoid hitting Discord's session start limit.