Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

138 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MMMeadBot

This is a Discord bot built with discord.js and TypeScript. The bot pulls commands from a MongoDB database and generates responses based on a list of commands that start with !. It can assign users roles and provides a welcome message when a new member joins the server.

Features

  • Command Handling: Responds to commands starting with !.
  • Role Assignment: Assigns roles to users.
  • Welcome Message: Sends a welcome message to new members.

Getting Started

Prerequisites

Ensure you have the following installed on your development machine:

  • Node.js (>= 14.x)
  • npm or yarn
  • MongoDB instance (local or remote)

Installation

  1. Clone the repository

    git clone https://github.com/ljreaux/MMMeadBot.git
    cd MMMeadBot
  2. Install dependencies

    npm install
    # or
    yarn install

Configuration

  1. Create a .env file in the root of the project and add the following environment variables:

     ```dotenv
     TOKEN=<your-discord-bot-token>
     CLIENT_ID=<your-discord-client-id>
     GUILD_ID=<your-discord-guild-id>
     WELCOME_CHANNEL=<your-welcome-channel-id>
     BOT_SPAM_CHANNEL=<your-bot-spam-channel-id>
     GENERAL_CHANNEL=<your-general-channel-id>
     ADMIN_CHANNEL=<your-admin-channel-id>
     HONEYPOT_CHANNEL=<your-honeypot-channel-id>
     # Optional comma-separated role IDs that must never be banned:
     HONEYPOT_EXEMPT_ROLE_IDS=<role-id>,<role-id>
     MONGO_URI=<your-mongodb-connection-string>
     ```
    

    Replace the placeholders with your Discord bot token, application and server IDs, channel IDs, and MongoDB connection string.

    HONEYPOT_CHANNEL is an enforcement channel: an ordinary human member who posts there is immediately banned, their messages from the preceding 24 hours are deleted, and a detailed incident embed is sent to ADMIN_CHANNEL. Bots, webhooks, the server owner, members with moderation permissions, and members whose roles are listed in HONEYPOT_EXEMPT_ROLE_IDS are not banned. Protected-member posts and failed ban attempts are still reported. The bot needs View Channel and Read Message History in the honeypot, Ban Members with a role above the members it must ban, and View Channel, Send Messages, and Embed Links in the admin channel.

Running the Bot

  • npm start
    # or
    yarn start

Usage

  • Commands: Use !list to trigger a command to get a list of available commands.
  • Role Assignment: The bot can automatically assign roles based on predefined commands.
  • Welcome Message: The bot sends a welcome message whenever a new member joins the server.

Contributing

  1. Fork the repository.
  2. Create a new branch: git checkout -b my-feature-branch
  3. Make your changes and commit them: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-feature-branch
  5. Submit a pull request.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages