Learn how to create chatbots with the IMB language
IMB (I Make Bot) is a simple, platform-agnostic language for defining chatbots. Write your bot logic once in . imb files and run it on any messaging platform with adapters.
🚀 Quick tip: Try the Interactive Playground to test IMB bots in your browser!
Download the IMB binary for your platform:
Or build from source if you have Rust installed:
cargo build --releaseon /start {
reply "Hello! I'm your bot 👋"
}
on /help {
reply "Send /start to begin"
}[telegram]
bot_token=YOUR_TELEGRAM_BOT_TOKENGet a token from @BotFather on Telegram.
imb run bot.imb --adapter telegramDefine bot responses to user commands using the on keyword:
on /command {
reply "Response text"
}Use # for single-line comments:
# This is a comment
on /start {
reply "Hello!"
}Use \n for line breaks in responses:
on /help {
reply "Available commands:\n/start - Start bot\n/help - Show this help\n/about - About this bot"
}Here's a complete bot with multiple commands:
# Welcome message
on /start {
reply "👋 Welcome! Use /help to see commands."
}
# Help command
on /help {
reply "Available:\n/start - Start bot\n/help - Show commands\n/about - About this bot"
}
# About command
on /about {
reply "Built with IMB - Interactive Message Bot"
}
# FAQ example
on /faq {
reply "Frequently Asked Questions:\n\nQ: What is IMB?\nA: A simple bot language\n\nQ: How to get started?\nA: Check /help"
}The IMB compiler provides several commands:
imb run bot.imb --adapter telegramimb compile bot.imb -o bot.jsonimb check bot.imbCurrently supported adapters: