Skip to content

A feature-rich WhatsApp bot built using whatsmeow for managing groups, reminders, moderation, and more.

License

Notifications You must be signed in to change notification settings

datfooldive/wa-bot-go

Repository files navigation

WhatsApp Bot

A feature-rich WhatsApp bot built using whatsmeow for managing groups, reminders, moderation, and more.

Features

  • Group Management: Promote/demote members, kick users, and manage group settings.
  • Automated Replies: Create custom automated responses to specific messages.
  • Reminders: Schedule reminders for yourself or group members.
  • Moderation: Filter bad words, warn users, and log message deletions.
  • AFK Status: Set an AFK status that notifies others when mentioned.
  • Sticker Creation: Convert images and videos into stickers.
  • Per-user Sticker Pack Metadata: Set your own sticker pack name, publisher, and default emoji.
  • Message Logging: Log messages for moderation or archival purposes.
  • Polls: Create and manage polls with options and voting.
  • Welcome/Leave Messages: Customize messages for new members and those who leave.
  • Bad Word Filter: Manage a list of prohibited words with filters.
  • Customizable Tag Groups: Create and manage custom mentionable groups.
  • Group Bridge: Bridge two groups together, allowing messages to be forwarded between them.

Requirements

  • Go 1.16+
  • PostgreSQL database
  • WhatsApp account with active phone number

Installation

  1. Clone the repository:

    git clone https://github.com/datfooldive/wa-bot.git
    cd wa-bot
  2. Copy the sample config file and update it with your details:

    cp config.json.example config.json
  3. Run database migrations:

    go run main.go --migrate
  4. Start the bot:

    go run main.go

    Scan the QR code with your WhatsApp app to authenticate.

Configuration

Edit config.json to customize the bot:

{
  "prefix": "!",
  "database_url": "postgres://user:password@localhost/dbname"
}

Commands

Use the prefix (default: !) followed by the command:

General

  • help - Shows the command list.
  • info - Shows system information.
  • afk - Set your status to AFK.
  • ping - Check if the bot is alive.
  • sticker - Create a sticker from an image.
  • createpack - Create or update your sticker pack metadata. Usage: /createpack packName|Publisher[|emoji]
  • mypack - Show your current sticker pack metadata.
  • delpack - Delete your saved sticker pack metadata.
  • tomedia - Convert a sticker to an image or video.
  • ocr - Extract text from an image.
  • ai - Interact with the AI (Gemini). Usage: /ai <your_prompt>

Fun

  • meme - Generate a meme by replying to an image.
  • brat - Generate a brat meme.
  • msticker - Create a sticker with meme text from an image.
  • image - Generate an image from a text prompt using pollutions.ai.

Group Management

  • groupjid - Get the JID of the current group.
  • tagall - Tag all members in the group.
  • everyone - Tag all members in the group with a message.
  • promote - Promote a user to admin.
  • demote - Demote an admin to a regular member.
  • kick - Kick a user from the group.
  • delete - Delete a message from the chat.
  • setgroupname - Set the group name.
  • setgroupdesc - Set the group description.
  • setgroupicon - Set the group icon by replying to an image.
  • groupbridge - Bridge the current group with another group. Usage: /groupbridge <target_jid>
  • delgroupbridge - Delete a group bridge from the current group to a target group. Usage: /delgroupbridge <target_jid>
  • confirmbridge - Confirm a pending group bridge request. Usage: /confirmbridge <request_id>
  • stats - Show group statistics.

Polls

  • poll - Create a poll. Usage: /poll "Question" | "Option 1" | "Option 2" ...
  • vote - Vote in a poll. Usage: /vote <poll_id>|<option_number>
  • pollresults - Get the results of a poll. Usage: /pollresults <poll_id>
  • closepoll - Close a poll. Usage: /closepoll <poll_id>

Reminders

  • setreminder - Set a reminder. Usage: /setreminder |
  • unsetreminder - Unset a reminder. Usage: /unsetreminder
  • listreminders - List your active reminders in the group.

Moderation

  • addbadword - Add a word to the bad word list.
  • delbadword - Delete a word from the bad word list.
  • listbadwords - List all bad words.
  • clearbadwords - Clear all bad words from the group.
  • enablebadword - Enable bad word filter for the group.
  • disablebadword - Disable bad word filter for the group.
  • badwordstatus - Check the status of the bad word filter for the group.
  • warn - Warn a user. Usage: /warn @user
  • warnings - Check a user's warnings. Usage: /warnings @user
  • clearwarnings - Clear a user's warnings. Usage: /clearwarnings @user
  • setkickwarn - Set the number of warnings to kick a user.
  • enableantidelete - Enable the anti-delete feature.
  • disableantidelete - Disable the anti-delete feature.
  • report - Report a message to the group admins.
  • mute - Mute a user for a specified duration.
  • unmute - Unmute a user.
  • enablemessagelog - Enable message logging for the group.
  • disablemessagelog - Disable message logging for the group.

Welcome/Leave Messages

  • welcomeenable - Enable welcome messages for the group.
  • welcomedisable - Disable welcome messages for the group.
  • welcomestatus - Check the status of welcome messages for the group.
  • setwelcomemessage - Set the welcome message for the group. Reply to a message to use its content.
  • leaveenable - Enable leave messages for the group.
  • leavedisable - Disable leave messages for the group.
  • leavestatus - Check the status of leave messages for the group.
  • setleavemessage - Set the leave message for the group. Reply to a message to use its content.

Customizable Tag Groups

  • createtag - Create a custom tag.
  • addtag - Add members to a custom tag. Use 'me' to add yourself.
  • removetag - Remove members from a custom tag. Use 'me' to remove yourself.
  • deletetag - Delete a custom tag.
  • tag - Tag all members of a custom tag.
  • listtags - List all custom tags in the group.

Automated Replies

  • addcustomreply - Add a custom reply. Usage: /addcustomreply |
  • delcustomreply - Delete a custom reply. Usage: /delcustomreply
  • listcustomreplies - List all custom replies for the group.
  • enablecustomreply - Enable the custom reply feature for the group.
  • disablecustomreply - Disable the custom reply feature for the group.
  • customreplystatus - Check the status of the custom reply feature for the group.

Owner

  • registergroup - Manually register the current group to the database.
  • silentmassregister - Silently registers all groups the bot has joined.
  • checkgroup - Check if the current group is registered in the database.
  • broadcast - Broadcast a message to all groups.

Developer

  • debug - Shows debug information about the message.

Author

License

This project is open-sourced software licensed under the MIT license.

About

A feature-rich WhatsApp bot built using whatsmeow for managing groups, reminders, moderation, and more.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages