IMB Documentation

Learn how to create chatbots with the IMB language

What is IMB?

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!

Installation

Download the IMB binary for your platform:

Or build from source if you have Rust installed:

cargo build --release

Quick Start

1. Create a bot file (bot.imb)

on /start {
    reply "Hello! I'm your bot 👋"
}

on /help {
    reply "Send /start to begin"
}

2. Create a config file (imb-conf.ini)

[telegram]
bot_token=YOUR_TELEGRAM_BOT_TOKEN

Get a token from @BotFather on Telegram.

3. Run your bot

imb run bot.imb --adapter telegram

Language Syntax

Commands

Define bot responses to user commands using the on keyword:

on /command {
    reply "Response text"
}

Comments

Use # for single-line comments:

# This is a comment
on /start {
    reply "Hello!"
}

Multi-line Strings

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"
}

Complete Example

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"
}

CLI Usage

The IMB compiler provides several commands:

Run a bot

imb run bot.imb --adapter telegram

Compile to JSON IR

imb compile bot.imb -o bot.json

Check syntax

imb check bot.imb

Platform Support

Currently supported adapters:

  • Telegram - Full support for Telegram bots
  • More adapters coming soon (Discord, Slack, WhatsApp)

Next Steps