Skip to main content

Introduction

This guide covers creating and deploying Discord bots on Shard Cloud with examples in both Node.js and Python.

Creating a Discord Bot Application

1

Create Application

Go to the Discord Developer Portal and click “New Application”. Give your bot a name and create it.
2

Get Bot Token

Navigate to the “Bot” tab and click “Reset Token” to generate your bot token. Copy and save it securely.
3

Enable Intents

In the “Bot” tab, scroll to “Privileged Gateway Intents” and enable:
  • Presence Intent
  • Server Members Intent
  • Message Content Intent
Security: Never share your bot token publicly. It grants full control over your bot.

Creating Your Bot

Setup

Basic Bot Code

index.js

Package.json

package.json

Shard Cloud Configuration

.shardcloud

Inviting Your Bot

  1. Go to the Developer Portal
  2. Select your bot → OAuth2URL Generator
  3. Check “bot” scope
  4. Select required permissions
  5. Copy and open the generated URL to invite your bot

Deploying

1

Prepare Your Files

Ensure you have:
  • Your bot code file
  • package.json (Node.js) or requirements.txt (Python)
  • .shardcloud
2

Exclude Unnecessary Files

Remove: node_modules/, __pycache__/, venv/
3

Create ZIP Archive

Compress your project folder.
4

Upload to Shard Cloud

Go to Shard Cloud Dashboard and upload.

Testing

After deployment, test your bot by sending !ping in a server where your bot is present. It should reply with “Pong!”.

Additional Resources

Troubleshooting

  • Verify your bot token is correct
  • Check that intents are enabled in Developer Portal
  • Review logs in the Shard Cloud dashboard
Re-invite your bot with the necessary permissions enabled.