Prerequisites
Before you begin, ensure you have the following installed:- Node.js version 16 or higher
- dfx version 0.14 or higher (installation guide)
- Git for cloning the repository
- At least 12 XDR worth of cycles for deployment (0.5 XDR for canister creation + 10 XDR for bot registration + operational overhead)
If you don’t have cycles yet, you can get free cycles from the cycles faucet or purchase them through an exchange.
Step 1: Clone and Set Up
Clone the repository and install dependencies:Start the Internet Computer locally
Step 2: Test Locally
Start the development server to test your bot:mo-dev which provides:
- Live reload on code changes
- Automatic redeployment
- Type checking
Step 3: Deploy to Mainnet
When you’re ready to deploy to the Internet Computer mainnet:Create the canister with cycles
Create your bot canister with sufficient cycles:This allocates 12 trillion cycles (12 XDR) to your canister:
- 0.5 XDR for canister creation
- 10 XDR for OpenChat bot registration
- 1.5 XDR for operations
Add yourself as a custodian
Add your principal as a custodian to manage the bot:Get your principal ID with:
dfx identity get-principalStep 4: Join a Group and Send a Message
Now that your bot is registered, let’s join a group and send a test message:Join a group
Join an OpenChat group using its canister ID:Replace
GROUP_CANISTER_ID with the canister ID of an OpenChat group. If the group is private, you’ll need an invite code:Example: TallyBot Workflow
If you want to use TallyBot to track governance proposals:tallyUpdate endpoint, they’ll be posted to this channel.
Verify Your Bot
Check that everything is working:Next Steps
Bot Initialization Guide
Learn more about bot initialization, avatars, and configuration
Sending Messages
Explore message types, threading, and advanced messaging patterns
TallyBot
Set up TallyBot to track governance proposal voting
API Reference
Dive into the complete API documentation
Troubleshooting
Bot initialization fails with insufficient cycles
Bot initialization fails with insufficient cycles
Ensure your canister has at least 10 XDR (10 trillion cycles) available. Check with:If needed, top up your canister:
Cannot join private groups
Cannot join private groups
Private groups require either:
- An invite code from a group admin
- Being pre-added by a group admin through the OpenChat UI
Messages not appearing in OpenChat
Messages not appearing in OpenChat
Verify:
- Bot is registered:
dfx canister call OCBot getBotStatus --network ic - Bot has joined the group/channel
- You’re calling the correct canister ID
- Check logs for errors:
dfx canister call OCBot getLogs '(null)' --network ic
For local development, omit the
--network ic flag to interact with your local replica instead of mainnet.