Blaze is a full-featured, AI-powered GroupMe bot designed to run as a Cloudflare Worker with a D1 database. It combines intelligent command routing, advanced moderation, user-level permissions, and seamless integration with Inception AI to deliver a smart, automated group management experience.
- 🧠 AI-powered command understanding – natural language parsing via Inception AI
- 📊 Context-aware responses – weather, news, group history, and more
- 🔍 Message search – search through group history with keywords
- 📝 Summarization – get a quick recap of recent conversations
- 🛡️ Profanity filter – automatic warnings, mute, and kick escalation (3 strikes)
- 🔇 Mute system – timed mutes with strike accumulation
- 📌 Off‑topic detection – enforce a group topic with warning/kick escalation
- 🚫 Block / Unblock – prevent specific users from using bot commands
- 👋 Welcome messages – custom greeting when new members join
- 📋 Multi-level permissions – Regular, Trusted, Admin, Co‑owner, Owner
- 📝 User notes – attach private notes to any member (admins only)
- 📈 Daily reports – activity stats, top chatters, admin actions, name changes
- 🏆 Most active leaderboard – see who’s chatting the most each day
- 👤 User info – view profile, message count, strikes, history, etc.
- 👑 Promote / Demote – manage Trusted, Bot Admin, and Bot Owner levels
- ➕ Add members – by phone number or user ID (with invite tracking)
- 🗂️ Admin action log – all admin commands are recorded for audit
- 🔄 Topic enforcement – set a group topic; off‑topic messages get warnings
- 🌦️ Weather – current conditions (triple fallback)
- 📰 News – top headlines from Google News RSS
- 🔄 Name change tracking – logs when users change their display name
- A Cloudflare account (free tier is sufficient)
- A GroupMe account and a GroupMe bot (create one at GroupMe Developers)
- An Inception API key (sign up at Inception Labs to get one)
-
Create a Cloudflare Worker
- Log in to the Cloudflare Dashboard.
- Navigate to Workers & Pages and create a new Worker.
- Give it a name (e.g.,
blaze-bot).
-
Copy the Script
- Paste the entire Blaze script (
index.js) into the Worker’s code editor.
- Paste the entire Blaze script (
-
Set Up D1 Database
- In the Cloudflare Dashboard, go to D1 and create a new database (e.g.,
blaze-db). - Note the database name.
- Bind the database to your Worker:
- In your Worker’s settings, go to Variables → D1 Database Bindings.
- Add a binding with the name
DB(this is what the script expects) and select your newly created D1 database.
- In the Cloudflare Dashboard, go to D1 and create a new database (e.g.,
-
Configure Environment Variables
-
In the same Variables section, add the following plain text environment variables:
Variable Description TKNGroupMe access token (from dev.groupme.com) GIDGroup ID (the numeric ID of your group) BIDBot ID (from your bot’s page) INCEPTION_API_KEYYour Inception API key -
Optional: You can also set these in your
wrangler.tomlif you prefer deploying with Wrangler.
-
-
Deploy the Worker
- Click Save and Deploy. The worker will be live at a URL like
https://your-worker-name.your-subdomain.workers.dev.
- Click Save and Deploy. The worker will be live at a URL like
-
Connect GroupMe Bot
- Go back to GroupMe Developers and find your bot.
- Set the Callback URL to your Worker’s URL (the one you just deployed).
- Save the changes.
-
Test It
- In your group, type
blaze statusorblaze daily. The bot should respond.
- In your group, type
Note: The D1 tables (
bot_stateandadmin_log) are created automatically on the first request – no manual SQL is required.
All commands are triggered with the prefix blaze (case‑insensitive).
For many commands, you can also simply speak naturally and the AI will interpret your intent.
| Command | Description | Required Level |
|---|---|---|
blaze status |
Show bot and group status | Anyone |
blaze daily / report |
Generate daily activity report | Anyone |
blaze most active / top |
Show top 5 active users since midnight | Anyone |
blaze admins |
List all group admins | Anyone |
blaze search <keyword> |
Search message history for keyword |
Anyone |
blaze add <phone> or blaze add <user_id> |
Add a member by phone number or user ID | Admin+ |
blaze explain / summarize |
Summarize recent conversation | Anyone |
blaze set topic <topic> |
Set the group topic (enforces on‑topic messages) | Admin+ |
blaze removetopic / clear topic |
Remove the active topic | Admin+ |
blaze welcome <message> |
Set welcome message (use {username} placeholder) |
Admin+ |
blaze note <user> <note> |
Add a private note about a user | Admin+ |
blaze filter on / off |
Enable / disable profanity filter | Admin+ |
blaze forgive <user> |
Reset all strikes/mutes for a user | Admin+ |
blaze sync |
Show current admins in the bot’s internal list | Admin+ |
blaze block <user> |
Block user from using bot commands | Trusted+ |
blaze unblock <user> |
Unblock user | Trusted+ |
blaze whois <user> / find <user> |
Show detailed user profile (ID, level, message count, strikes, notes, etc.) | Anyone |
blaze am I trusted / my level |
Check your own permission level | Anyone |
| Natural language queries | Ask questions about the group, weather, news, etc. (AI handles it) | Anyone |
Note: When a command is not explicitly matched, the bot passes your message to the AI, which can decide to take actions like kicking, muting, or answering questions based on context.
| Level | Privileges |
|---|---|
| Owner | Full control (token owner or group owner). Can promote to Bot Owner. |
| Co‑owner | Same as Owner (GroupMe co‑owner roles). |
| Admin | Can kick, mute, promote, set topic, welcome, filter, add members, etc. |
| Trusted | Can block/unblock users from bot commands. |
| Regular | Default – can chat, search, see stats, and use AI. |
The bot automatically recognizes GroupMe‑assigned roles (admin, co‑owner, owner) but also maintains its own lists (trusted, bot_admins, bot_owners) for fine‑grained control.
The Worker uses a D1 database with two tables:
Stores the entire bot state as a JSON blob under key bot_state. Includes:
- Trusted lists, bot admins, bot owners
- Mutes, profanity strikes, topic warnings
- User notes, known names, blocked users
- Active topic, welcome message, filter state, etc.
Logs every admin action with timestamp, admin name, and action description.
No manual schema creation required – the worker creates them on start.
- AI Model: The script uses
mercury-2from Inception. Change the constantINCEPTION_MODELif needed. - Message Limit:
MSG_LIMITcontrols how long a bot message can be before splitting (default 400 chars). - Profanity Regex: Modify
PROFANITYin the code to adjust the filter list. - Weather Fallbacks: The
getWeather()function uses three services – you can add or replace them.
- The worker responds to
GETrequests with a JSON status overview (shows which env variables are set). - Check Cloudflare Worker logs for any errors.
- All API calls to GroupMe and Inception are logged on failure.
Gort (hosted on botsol.net) is a popular GroupMe bot framework that provides a basic command system with a web dashboard, but it lacks built-in AI and advanced moderation features out-of-the-box. Here’s how Blaze compares:
| Feature / Aspect | Blaze (this bot) | Gort (botsol.net) |
|---|---|---|
| Hosting | Self‑hosted on Cloudflare Workers (free tier) | Hosted by botsol.net (paid plans) |
| AI Integration | Built‑in Inception AI for natural language and tools | No AI – relies on predefined commands |
| Permission System | Five levels (Regular, Trusted, Admin, Co‑owner, Owner) with custom roles | Basic role system (owner, admin, user) |
| Moderation | Profanity filter, off‑topic detection, auto‑mute/kick, strike system | Only manual kick/ban via commands |
| Data Storage | D1 SQLite database – full state, logs, notes | Limited per‑group settings, no custom notes |
| Custom Commands | AI can interpret many phrasings; extensible via code | Requires writing Gort‑specific command files |
| Welcome Messages | Yes, with placeholders | Yes, but limited customization |
| Activity Reports | Daily report with admin log, top chatters, etc. | Basic stats only |
| Cost | Free (Cloudflare free tier has 100k requests/day) | Monthly subscription or credits |
| Customization | Full source code – modify anything | Limited to dashboard options and plugin API |
| Learning Curve | Requires Cloudflare and basic JavaScript knowledge | Easier for non‑developers (dashboard UI) |
Verdict: If you want a plug‑and‑play bot with minimal setup and don’t need AI or advanced moderation, Gort is a good choice. But if you prefer full control, AI‑powered intelligence, advanced user management, and zero recurring costs, Blaze on Cloudflare is the superior option.
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is open‑source. You may use, modify, and distribute it under the terms of the MIT License.
Built with ❤️ for the GroupMe community.