Skip to content
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

Implement Bot Admin-only functionality #12

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add function to check if command author is bot admin
someyuck committed Apr 13, 2024
commit 79e91ec6fe6a01b75fe86566c9e274f9819ae837
7 changes: 7 additions & 0 deletions bot/main.py
Original file line number Diff line number Diff line change
@@ -71,6 +71,13 @@ def is_bot_admin(userID: str):
return userID in BOT_ADMINS


def is_author_bot_admin(ctx: commands.Context):
"""Wrapper function for `is_bot_admin`; checks if the user who invoked the command
is a bot admin or not."""
userID = ctx.message.author.id
return is_bot_admin(str(userID))


def get_realname_from_discordid(user_id):
"""Returns the real name of the first user who matches the given ID."""
users = get_users_from_discordid(user_id)