Bots Discord3 minutes de lecture

Comment héberger un bot Discord 24/7

Put a discord.js or discord.py bot online, verify a slash-command reply with your PC off, and choose between a free plan, paid hosting and a VPS.

Déployez un robot Discord sans

Choose where your bot will run

A Discord gateway bot needs a process that stays running and can reconnect to Discord. A local PC or Raspberry Pi can do that while it has power and internet. A VPS gives you an always-running machine, with updates, process supervision and backups to manage. A managed worker runs the bot with a console and restart controls in the dashboard.

Bothosting’s free Spark plan gives one bot 256 MB of RAM, 25% CPU and 512 MB of storage. Renew Spark every 7 days for continued service. Paid plans start at $2.25 a month with 1 GB of RAM. For Java or a large cache, check memory before choosing. Read the VPS decision guide et le worker hosting comparison.

Put a test bot online

  1. Create a Discord application and install it in a test server with the bot and application-command scopes. Read the Discord setup guide for the install steps.
  2. Téléchargez le discord.js starter ou discord.py starter. Put the project at the deployment root with its dependency manifest. For existing code, deploy the bot from GitHub.
  3. Choose the matching Discord runtime. Save the application’s token as BOT_TOKEN in Variables and verify the entry file. Stop a local copy using the same token.
  4. Start the deployment and open Console. The JavaScript starter logs BOT_READY. In Discord, select the new app’s /ping command and look for pong. Switch off your development PC and send the command from another device.

Keep the bot online after the first reply

Set a reminder before your free plan renews. On either plan, enable restart on crash for a long-running bot and configure Notifications Discord pour arrêts inattendus. A restart can bring the process back after a brief failure. Repeated errors need a code, token or resource fix.

Keep the project in Git or another backup location, and keep backups of any SQLite files or other data. Restart once after saving a setting, then verify the same value from Discord. If you run a second process that needs the same state, read when to move beyond SQLite.

Find where a startup failed

Read the first Console error from the failed start. If there is no login attempt, check the entry file and dependencies. If login fails, follow the TokenInvalid and LoginFailure guide. If Discord closes the gateway with 4014, check the privileged intents requested by the code.

When Console shows a connection but Discord has no command, check registration and installation. If the bot works and then exits, use the exit reason and resource use in Overview to distinguish a deliberate stop, expired capacity or a crash.