A simple permission manager for Discord bots.
Project description
ezpermissions
A simple and efficient Discord permission checker that helps you validate user permissions effortlessly! ๐
โจ Features
- ๐ง Quick Setup โ Easily integrate permission checks into your bot.
- ๐ Full Permission Coverage โ Supports all Discord permissions.
- โ True_ & False_ Checks โ Validate if a user has or lacks a permission.
- ๐ฆ Lightweight & Easy to Use โ No complex setup required.
๐ Installation
Prerequisites
Make sure you have Python 3.8+ installed.
python --version
Install ezpermissions
pip install ezpermissions
๐ Usage
To use ezpermissions in your bot, import and apply permission checks:
import discord
from discord.ext import commands
from ezpermissions import permissions
bot = commands.Bot(command_prefix="!")
@bot.command()
@permissions.Administrator.True_ # โ
Requires Administrator permission
async def admin_only(ctx):
await ctx.send("โ
You have Administrator permission!")
@bot.command()
@permissions.ManageMessages.False_ # โ Requires NOT having Manage Messages
async def non_moderators(ctx):
await ctx.send("โ
You do NOT have Manage Messages permission!")
bot.run("YOUR_BOT_TOKEN")
๐ง Available Permission Checks
ezpermissions provides decorators for all Discord permissions:
| Permission | True_ (Has) | False_ (Lacks) |
|---|---|---|
| Administrator | @permissions.Administrator.True_ |
@permissions.Administrator.False_ |
| Manage Guild | @permissions.ManageGuild.True_ |
@permissions.ManageGuild.False_ |
| Manage Roles | @permissions.ManageRoles.True_ |
@permissions.ManageRoles.False_ |
| Ban Members | @permissions.BanMembers.True_ |
@permissions.BanMembers.False_ |
| Kick Members | @permissions.KickMembers.True_ |
@permissions.KickMembers.False_ |
| Send Messages | @permissions.SendMessages.True_ |
@permissions.SendMessages.False_ |
| Read Message History | @permissions.ReadMessageHistory.True_ |
@permissions.ReadMessageHistory.False_ |
| And More! | Supports all permissions | ๐ |
๐ Project Structure
๐ฆ YourBotProject
โโโ ๐ cogs/ # Stores command files (if using cogs)
โ โโโ __init__.py
โ โโโ example.py # Example cog
โโโ ๐ main.py # Main bot file
โโโ ๐ permissions.py # ezpermissions integration
โโโ ๐ requirements.txt # Installed dependencies
๐ฏ Contributing
We welcome contributions! Feel free to submit a pull request or open an issue.
๐ License
ezpermissions is open-source and licensed under the MIT License.
๐ฌ Need Help?
- ๐ Official Discord.py Documentation
- ๐ ๏ธ Open an issue if you run into problems!
Happy coding! ๐ฉโจ
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ezpermissions-1.0.0.tar.gz.
File metadata
- Download URL: ezpermissions-1.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4a1c36ab4065710113d5f3c9085ccb79b84a23673266e477e1c3a33538756a8
|
|
| MD5 |
876c6079a051298d31b2185ab89d2817
|
|
| BLAKE2b-256 |
fa27f9c4b96b68f88737c349354c8c8d075f84ab7c8a8efa9187271951418a2c
|
File details
Details for the file ezpermissions-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ezpermissions-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe90135b794f8d8ddae61c574b65ca3420863040fc70556e50af5fe205e0cca7
|
|
| MD5 |
393a0b421f133bfd5436d01d683ebf64
|
|
| BLAKE2b-256 |
24f5d8bcff1821a025046c65dc7266cedaaf28e2634ebbf8a75852d9b410fab2
|