Skip to content

added Discord Bot functionality for Authentication & Setup #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Antriksh006
Copy link

📝 Description

This PR adds a role-based command permission system, allowing server administrators to assign roles that can execute specific commands. Additionally, it introduces the ability to restrict certain commands to only specific roles and administrators.

🔧 Changes Made

  • Implemented a role-based command restriction system:
    • !setrole <role> <command> → Assigns a role that can use a command.
    • !restrictrole <role> <command> → Restricts a command to only a specific role and administrators.
    • !viewroles → Displays role-based command permissions in an embedded message.
  • Improved permission checking with has_required_role(command_name).
  • Enhanced error handling for invalid role assignments.
  • Ensured admins retain full access regardless of role assignments.
  • Added example commands:
    • !vip → Executable by admins and assigned roles.
    • !mod → Executable by admins and assigned roles.
    • !admin → Admin-only command (not assignable to roles).

📷 Screenshots

image

✅ Checklist

  • I have tested role-based command access.
  • I have added necessary error handling for invalid role configurations.
  • I have ensured backward compatibility for existing commands.
  • I have updated the bot’s role permission logic with better structure.

@Antriksh006
Copy link
Author

you need to add DISCORD_BOT_TOKEN, DISCORD_CLIENT_ID in your .env file

@Vivekgupta008
Copy link
Contributor

Hey @Antriksh006 , have you dispatched your events to event bus and then to corresponding handlers?

@Vivekgupta008
Copy link
Contributor

Like I was working on the discord bot and have raised a pr for that. Please check that out.

@Antriksh006
Copy link
Author

Hey @Antriksh006 , have you dispatched your events to event bus and then to corresponding handlers?

Hey @Vivekgupta008 , I took a look at your PR and it looks like you have done a good chunk of the Ai Bus handling bit. What I have done is just authentication and setup of the discord bot and was looking forward to start working on the Api handler bit. Maybe we collaborate on this?

@Vivekgupta008
Copy link
Contributor

Yes, I would love to collab with you but the discord portion is pretty much covered by #46. I think we can work on top of that one to build more functionalities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants