SmarttyBot is a multiplatform assistant that relays messages between Discord, Telegram, Slack and Email, and acts on natural language (via Groq) when you address it — running GitLab reports, sending email, cross-posting, and more.
- Set up all your accounts and get the API tokens
- Get a free Groq API key for the natural-language assistant
- Let SmarttyBot make your life easier
- Assistant-first: @mention the bot, reply to it, or call it by name on any platform and it decides what to do — no magic prefixes needed (legacy prefix commands still work)
- Conversation memory: keeps short per-chat context so follow-up questions work ("and the in-progress ones?")
- Natural-language tools parsed by Groq (OpenAI-compatible tool calling): gitlab reports, send email, cross-post, toggle sync
- Two-way channel sync: opt-in mirroring of a Telegram/Discord/Slack channel to its same-named peers
- Discord slash commands (
/answer,/register,/send-email,/sync, …) alongside the classic prefixes - Push delivery: Slack via Socket Mode (no public endpoint) and email via IMAP IDLE (instant, no polling)
- Every channel is optional: run any subset (Telegram, Discord, Slack, Email) — each enables itself only when configured
- Persistent state in an embedded SQLite database (no external DB required)
- Graceful shutdown, structured logging, and a
/healthz+/metricsendpoint - The only limit is your imagination
cmd/smartty_bot entrypoint: config, wiring, signal-based shutdown
internal/config env loading + SQLite database + persisted stores
internal/store generic, mutex-safe, SQLite-backed maps
internal/assistant the LLM brain: Groq tool calling, memory, addressed-trigger
internal/hub cross-platform router (cross-post + opt-in sync)
internal/telegram Telegram client, commands, callbacks
internal/discord Discord client, prefix + slash commands
internal/slack Slack client via Socket Mode
internal/email SMTP send + IMAP IDLE inbox listener
internal/gitlab GitLab API client (replaces the old Python script)
internal/gitlabreport formats GitLab data into replies
internal/health /healthz + /metrics HTTP server
On any platform, address the bot to trigger the LLM:
- @mention it, reply to one of its messages, or start your message with its name (
BOT_NAME, defaultsmartty). - e.g.
@smartty gitlab report for webapp, orsmartty email alice@x.com subject "hi" body "...".
Plain, un-addressed messages are never sent to the LLM (keeps API usage low). In a synced channel they are mirrored to the paired channels instead.
Telegram: -m/-mention <text>, -p/-parse <text>, -r/-register @TelegramUser discordUser, -sync on|off
Discord (prefix or slash): -a/-answer (/answer), -r (/register), -rm (/register-email), -m/-send-email (/send-email), -sync (/sync)
Every channel is optional. Configure only the platforms you want — the bot enables each one solely based on whether its tokens are set, and starts fine with any subset (or none). An unconfigured channel is skipped; a misconfigured one logs its own error without affecting the others.
The natural-language module uses Groq's free, OpenAI-compatible API:
- Create a free API key at https://console.groq.com/keys
- Add it to your
.env. Optionally pin a model (defaults tollama-3.3-70b-versatile):
GROQ_API_KEY="gsk_..."
GROQ_MODEL="llama-3.3-70b-versatile"The supported actions (tools) are defined in internal/assistant/tools.go; add new ones there and dispatch them in internal/assistant/assistant.go.
The report actions talk to the GitLab API directly (no Python needed):
- Create a personal access token with
read_apiscope at https://gitlab.com/-/user_settings/personal_access_tokens
GITLAB_TOKEN="glpat-..."
GITLAB_URL="https://gitlab.com/"- Go to https://telegram.me/botfather on Telegram
- Send
/newbot, choose a name and a unique username ending in "bot" - Copy the access token into
.env - Change
"smartty_bridge_bot"to your bot's username in internal/telegram/commands.go
TELEGRAM_API_KEY="123456TELEGRAMMMMMMAPI"Follow https://discordpy.readthedocs.io/en/stable/discord.html to create a bot, then:
- Go to 'Bot', select 'Reset token', copy it into
.env
DISCORD_API_KEY="DDDIIISSSCCCOOORRRRDDDAAAAPPPIII"EMAIL_ACCOUNT="gmailaccount@gmail.com"
EMAIL_PASWORD="emailPassword"
SMTP_SERVER="smtp.gmail.com"
SMTP_PORT=587
IMAP_SERVER="imap.gmail.com"
IMAP_PORT=993Incoming mail is delivered via IMAP IDLE (instant push); servers without IDLE fall back to polling automatically.
Slack uses Socket Mode, so no public endpoint is required. In your Slack app config: enable Socket Mode, add an app-level token with connections:write, subscribe to the app_mention (and optionally message.channels) events, and install the bot. Then:
SLACK_APP_TOKEN="xapp-..." # app-level token
SLACK_BOT_TOKEN="xoxb-..." # bot tokenSlack stays disabled unless both tokens are set.
See .exampleenv for the full set of variables (including BOT_NAME, PORT and LOG_LEVEL).
SmarttyBot requires Go v1.23+ to run.
git clone https://github.com/omarperezr/SmarttyBot
cd SmarttyBot
cp .exampleenv .env # then fill in your tokens
go build ./cmd/smartty_bot
./smartty_botState is stored in data/smartty.db (SQLite), created automatically on first run.
docker compose up --buildThe .env file supplies the configuration and a named volume persists data/.
go build ./...
go vet ./...
go test -race ./...CI runs formatting, vet, race tests, golangci-lint and a Docker build on every push and pull request.
GNU General Public License v3.0
Free Software, Hell Yeah!
