Skip to main content

Introduction

This guide covers creating and deploying Telegram bots on Shard Cloud.

Creating a Telegram Bot

1

Open BotFather

Open Telegram and search for @BotFather.
2

Create New Bot

Send /newbot and follow the prompts to name your bot.
3

Get Token

BotFather will provide your bot token. Save it securely.
Security: Keep your bot token secret. Anyone with it can control your bot.

Creating Your Bot

Setup

Basic Bot Code

index.js

Package.json

package.json

Shard Cloud Configuration

.shardcloud

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, open Telegram, find your bot, and send /ping. It should reply with “Pong!”.

Additional Resources

Troubleshooting

  • Verify your bot token is correct
  • Check that polling is enabled
  • Review logs in the dashboard
Only one instance of your bot can use polling at a time. Stop other instances.