Build A Skillful Telegram Bot
Build A Skillful Telegram Bot
Create your own AI-powered Telegram bot in minutes using our template. This guide will walk you through setting up and deploying your first Skillful AI agent on Telegram.
Prerequisites
PrerequisitesBefore you begin, you'll need:
A Telegram account
A Skillful AI API key
Node.js installed on your computer
1. Create a Telegram Bot
1. Create a Telegram BotOpen Telegram and search for "@BotFather"
Start a chat with BotFather
Send the
/newbotcommandFollow the prompts to:
Choose a name for your bot (e.g., "My Skillful Bot")
Choose a username (must end in 'bot', e.g., "my_skillful_bot")
BotFather will provide you with a token - save this for later
2. Set Up Your Project
2. Set Up Your ProjectUsing a code editor like Visual Studio Code, we can create a new project with:
# Create a new project directory
mkdir my-telegram-bot
cd my-telegram-bot
# Install the template
npm install @skillfulai/telegram-template3. Configure Environment Variables
3. Configure Environment VariablesCreate a .env file in your project root:
TELEGRAM_TOKEN=your_telegram_bot_token # From BotFather
SKILLFUL_API_KEY=your_skillful_api_key # Your Skillful AI API key
AGENT_NAME=Wojak # Name of the agent you want to use4. Create Your Bot
4. Create Your BotCreate a file named index.js and add the following code to it:
const SkillfulTelegramBot = require('@skillfulai/telegram-template');
// Initialize and start the bot
const bot = new SkillfulTelegramBot();
bot.initialize().then(() => {
console.log('Bot is running...');
}).catch(error => {
console.error('Failed to start bot:', error);
});5. Run Your Bot
5. Run Your BotStart your bot:
node index.jsThat's it! Your bot is now running. Open Telegram and search for your bot's username to start chatting.
Available Commands
Available CommandsYour bot comes with several built-in commands:
/start- Get a welcome message and overview/info- View detailed agent information/skills- See all available capabilities/clear- Reset the conversation/status- Check bot status
Testing Your Bot
Testing Your BotTry these interactions to test your bot:
Send
/startto see the welcome messageUse
/skillsto view available capabilitiesAsk general questions to test conversation
Use
/infoto see technical details
Troubleshooting
TroubleshootingIf you encounter issues:
Check that your tokens are correct in
.envEnsure your Skillful AI API key is valid
Verify the agent name exists in your account
Check the console for any error messages
Next Steps
Next StepsNow that your bot is running, you can:
Customize the agent's personality
Add more skills through the Skillful AI dashboard
Modify the template code to add custom features
Deploy to a hosting service for 24/7 availability
Need help? Join our Discord community
Last updated