Skip to content
Yitz890Public

About

A Better alternative to Gort on group me

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🔥 Blaze — Ultra-Smart GroupMe Bot

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.


✨ Features

Core Intelligence

  • 🧠 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

Moderation & Safety

  • 🛡️ 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

User Management

  • 📋 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.

Administrative Tools

  • 👑 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

Miscellaneous

  • 🌦️ Weather – current conditions (triple fallback)
  • 📰 News – top headlines from Google News RSS
  • 🔄 Name change tracking – logs when users change their display name

🚀 Getting Started (Setup Guide)

Prerequisites

  • 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)

Step‑by‑Step Installation

  1. 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).
  2. Copy the Script

    • Paste the entire Blaze script (index.js) into the Worker’s code editor.
  3. 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.
  4. Configure Environment Variables

    • In the same Variables section, add the following plain text environment variables:

      Variable Description
      TKN GroupMe access token (from dev.groupme.com)
      GID Group ID (the numeric ID of your group)
      BID Bot ID (from your bot’s page)
      INCEPTION_API_KEY Your Inception API key
    • Optional: You can also set these in your wrangler.toml if you prefer deploying with Wrangler.

  5. Deploy the Worker

    • Click Save and Deploy. The worker will be live at a URL like https://your-worker-name.your-subdomain.workers.dev.
  6. 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.
  7. Test It

    • In your group, type blaze status or blaze daily. The bot should respond.

Note: The D1 tables (bot_state and admin_log) are created automatically on the first request – no manual SQL is required.


💬 Command Reference

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.


🛡️ Permission Levels

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.


📦 Database Schema

The Worker uses a D1 database with two tables:

bot_state

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.

admin_log

Logs every admin action with timestamp, admin name, and action description.

No manual schema creation required – the worker creates them on start.


🔧 Customization & Extension

  • AI Model: The script uses mercury-2 from Inception. Change the constant INCEPTION_MODEL if needed.
  • Message Limit: MSG_LIMIT controls how long a bot message can be before splitting (default 400 chars).
  • Profanity Regex: Modify PROFANITY in the code to adjust the filter list.
  • Weather Fallbacks: The getWeather() function uses three services – you can add or replace them.

🧪 Testing & Debugging

  • The worker responds to GET requests 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.

🆚 Comparison with botsol.net/gort

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.


🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.


📄 License

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.

About

A Better alternative to Gort on group me

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages