GithubHelp home page GithubHelp logo

discord-moderation-bot's Introduction

Discord Moderation Bot

A bot for moderating users on discord!

Requirements

Install python and run: pip install discord.py

Command Info

  • Default prefix: !
  • <argument> = Required argument
  • [argument] = Optional argument
  • Durations can either be a formatted time that looks like the following: (1w2d3h4m5s) or time in seconds.
  • Durations can also use single types like 2m or 1w for example
  • All commands require you to be in a moderator role. See the commands below on how to add or remove a mod role (requires admin permission to add mod roles)
  • Read how to get the User ID here
  • Read how to add your own commands (and reload them on the fly!) here

Commands

  • !mod <add|remove|list> <role ID>

    • Adds, removes the role ID to the list of moderator roles.
    • If you want to list the roles, you do not need the role ID at the end.
  • !mute <user ID> [reason]

    • Permanently mutes the user. Must be unmuted manually.
  • !tempmute <user ID> <duration> [reason]

    • Temporarily mutes the user.
  • !unmute <user ID>

    • Unmutes the user
  • !tempban <user ID> <duration> <reason>

    • Temporarily bans the user from the server
    • Reason is required. If you do not have a reason, you should not be banning them.
  • !unban <user ID>

    • Unbans the user from the server.
  • !reload

    • Reloads the command registry for any changes that were made to commands

How to get user ID

You should follow the discord guide here

But the gist is:

  • Enable developer mode in discord
  • Right click their username in chat or on the sidebar
  • Click Copy ID

Adding your own commands

  1. You'll need to make a new file for your command. The best thing to do is copy reload.py inside the commands directory and rename it to the command name e.g. test.py
  2. Open <your_command>.py in a text editor
  3. Rename the class: ReloadCommand to a different name e.g.TestCommand
  4. Edit the self.cmd variable to be the command you wish to use e.g. test
  5. Inside the self.execute method, add the code that will run the command! 5b. Please see below for info that command executors can obtain for use!
  6. Once you are done, save your file and use the !reload command to reload the command registry! You should be able to sue the new command!

Available keyword arguments

Obtain each using my_var = kwargs.get("key") where key is an option from below

  • command
    • The name of the command. In the example above, this would just be test
  • args
    • A list of arguments following the command. This can be any length so ensure your code has proper checking for argument lengths and stuff
  • storage
    • An instance of the storage handler class. Really should only be used if you know what you are doing! See storage_management.py for the code of that class.
  • instance
    • An instance of the bot, should REALLY not be used but is available if absolutely needed

discord-moderation-bot's People

Contributors

column01 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.