Skip to content

discord bot using discord.py with custom server prefixes, automatic role assignment, cog-based command modularity, owner-only extension management, and error handling for commands and permissions

Notifications You must be signed in to change notification settings

SorinBetisor/Discord-Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Bot with Prefix Management and Role Assignment

This project is a Python-based Discord bot built with discord.py. The bot features dynamic prefix management, cog-based modularity for commands, and automatic role assignment for new members. It includes several owner-specific commands for loading, unloading, and reloading bot extensions.

Features

  • Dynamic Prefix Management: Each server (guild) can have its own custom command prefix, which is stored and retrieved from a JSON file.
  • Cog-based Commands: Commands are organized into cogs, allowing for modularity and easy management.
  • Automatic Role Assignment: Automatically assigns a predefined role ("Member") to users who join the server.
  • Error Handling: Provides feedback for command errors, including missing arguments, invalid commands, and permission issues.

Getting Started

Prerequisites

  • Python 3.8 or higher
  • discord.py library (pip install discord.py)
  • numpy library (pip install numpy)

Setup

git clone https://github.com/yourusername/discord-bot.git
pip install discord.py numpy

 Create a prefixes.json file in the root directory to store server-specific prefixes. Example content:
 {
 "server_id": "!"
 }

###Owner commands

!load <extension_name>
!unload <extension_name>
!reload <extension_name>

###Handling Errors Common error cases are handled gracefully:

CommandNotFound: Notifies the user when an invalid command is used. MissingRequiredArgument: Prompts the user to provide the required argument. MissingPermissions: Alerts the user if they don't have the required permissions.

###Contributing Feel free to fork the repository, submit issues, and make pull requests to improve this bot. Contributions are welcome!

About

discord bot using discord.py with custom server prefixes, automatic role assignment, cog-based command modularity, owner-only extension management, and error handling for commands and permissions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages