Learn about bots
Bots stay connected to Discord, Telegram or WhatsApp around the clock. Learn what they need to run, what they cost and why they go offline.
Featured
- CostsHow much does it cost to host a Discord bot?The cost of hosting a Discord bot depends on RAM, uptime, database and outside services. Learn how to estimate your own bill and where the money goes.
- ComparisonsRunning a bot on your phone or PC vs hosting itA bot on your PC or phone (Termux) goes offline when the device shuts down, sleeps or loses its network. Compare the three options and when each one fits.
- How-to guidesHow to host a Discord bot 24/7To keep a Discord bot online 24/7, run its process on an always-on machine with automatic restarts. Compare your PC, a VPS with pm2 or systemd, and bot hosting.
Concepts3
- What is Lavalink? Hosting a Discord music botLavalink is a standalone audio server that plays music for Discord bots outside the bot process. Learn how it works, what it needs and how to host it.
- What is a Discord bot and how does it work?A Discord bot is a program that uses a bot account to receive events and act in servers. See how the Gateway, the API, intents and commands fit together.
- What is Discord sharding and when does your bot need it?Sharding splits your bot's Discord connection into several sessions, each handling part of the servers. It is required from 2,500 servers. Learn how it works.
How-to guides11
- How to host a Discord bot 24/7To keep a Discord bot online 24/7, run its process on an always-on machine with automatic restarts. Compare your PC, a VPS with pm2 or systemd, and bot hosting.
- How to host a Telegram bot 24/7To keep a Telegram bot online 24/7, run its process on an always-on server using long polling or a webhook. See working code and the common errors.
- How to host a discord.js botTo host a discord.js bot, create the app in the Developer Portal, keep the token in an environment variable and run the process on an always-on machine.
- How to host a discord.py botHosting a discord.py bot means running its script on an always-on machine with the token in an environment variable. See the code, requirements.txt and errors.
- How to host a WhatsApp bot 24/7To keep a WhatsApp bot running 24/7, run the process on an always-on server and keep its session on disk. See working code for Baileys and the official Cloud API.
- Discord bot token: where to find it and how to keep it safeA Discord bot token lives on the Bot tab of the Developer Portal and works as the bot's password. Learn where to find it, how to store it and what to do if it leaks.
- How to monitor your bot's uptime and get alertsMonitor bot uptime with a heartbeat the bot sends to an external monitor, which alerts you on Discord or Telegram as soon as the signal stops.
- How to make your first Discord bot and put it onlineTo make a Discord bot, register an app in the Developer Portal, write the code with discord.js, invite the bot to your server and host the process. Full walkthrough.
- How to create a WhatsApp bot (and which approach to pick)To create a WhatsApp bot, pick between an unofficial library such as Baileys and Meta's Cloud API. See working code, pairing steps and the most common mistakes.
- How to create a Telegram bot with BotFather and get its tokenCreate a Telegram bot by sending /newbot to @BotFather, choosing a name and a username ending in bot, and copying the token. Includes a working Python test.
- How to host Evolution API (WhatsApp)To host Evolution API you need Node.js, PostgreSQL or MySQL, Redis and an always-on process. Follow the steps, from the .env file to the first message.
Problems and errors8
- Why your Discord bot keeps going offline (and how to fix it)A Discord bot goes offline when the process dies, the token is invalid, an intent is disabled or memory runs out. Learn to diagnose each cause and fix it.
- Discord 429 Too Many Requests: rate limits and Cloudflare bans explainedA Discord 429 error means your bot hit a rate limit. Learn the three kinds of limits, how to read the headers, how to fix it and avoid a temporary IP ban.
- Discord bot online but not responding to commandsA Discord bot that shows online but ignores commands usually has the Message Content intent off, unregistered commands, missing permissions or a slow reply.
- Discord bot intents error: what privileged intents areThe Discord bot intents error (close code 4014) happens when your code requests a privileged intent that is off in the portal. Here is how to enable it and fix it.
- Telegram bot not responding: webhook and polling pitfallsA silent Telegram bot is usually a bad token, a stopped process, two instances or a broken webhook. Diagnose it with getMe and getWebhookInfo, then fix it.
- WhatsApp bot banned or not working: risks and preventionA WhatsApp bot can be banned for spam, user reports or for running on an unofficial library. Learn to tell a ban from a dropped session and how to lower the risk.
- WhatsApp bot keeps disconnecting: sessions and QR codesA WhatsApp bot that keeps disconnecting or asks for a QR code again has almost always lost its session. Learn the causes, Baileys disconnect codes and fixes.
- Discord music bot stopped playing YouTube: what changedMusic bots stopped playing YouTube because YouTube blocks automated access and extraction libraries keep breaking. See the causes and the alternatives.
Costs4
- How much does it cost to host a Discord bot?The cost of hosting a Discord bot depends on RAM, uptime, database and outside services. Learn how to estimate your own bill and where the money goes.
- Free bot hosting: sleep, limits and hidden trade-offsFree bot hosting often puts your process to sleep, caps monthly hours or disappears. See the real limits of Render, Oracle Cloud, Glitch and Heroku.
- How much RAM does a Discord bot need?A small Discord bot runs fine on 256 to 512 MB of RAM. See what makes memory grow, how to measure your bot and how to trim the cache.
- Official WhatsApp API: what it is, what it costs and when it pays offThe official WhatsApp API (Cloud API) charges per delivered template message, with no Meta monthly fee. See what is billed, how to estimate it and when it pays off.
Comparisons4
- Running a bot on your phone or PC vs hosting itA bot on your PC or phone (Termux) goes offline when the device shuts down, sleeps or loses its network. Compare the three options and when each one fits.
- Baileys vs whatsapp-web.js vs the official WhatsApp APIBaileys and whatsapp-web.js are unofficial libraries, and the Cloud API is Meta's official interface. Compare connection, ban risk, cost and hosting.
- Discord webhook vs bot: which one to useA Discord webhook only posts messages to one channel through a URL; a bot reads events, answers commands and stays online. See the differences and when to use each.
- Telegram bot webhook vs long pollingLong polling pulls updates from Telegram and needs no public URL; a webhook receives an HTTPS POST. Compare both and see the code to switch between them.
Which to choose3
- Best programming language for a Discord botJavaScript with discord.js and Python with discord.py fit most Discord bots. See the criteria, pros and cons, and when Java, C#, Go or Rust make sense.
- Best Telegram bot library: python-telegram-bot, aiogram, grammY or TelegrafIn Python, python-telegram-bot and aiogram are the safe picks; in JavaScript, grammY. See the criteria, the same bot in each library and which one to use.
- Which database should your Discord bot use?SQLite fits a small single-process Discord bot. PostgreSQL or MongoDB fit when you have several processes, lots of writes or frequent deploys. Here is how to choose.