Open cnpryer opened 3 years ago
What roles do we allow to run these commands?
@mod for everything @everyone for /assign me
The Message
object contains the Author
property, which points to a User
.
Getting a User's roles for a guild seems a bit complicated.
Here's the list of steps I think needs to be done.
Channel
object using the Channel ID and get the Guild ID from the Channel
Members
list for the Guild
using Guild.Members
and match the User
in the memberlistMember.Roles
property and determine if the user has the mod
role.Do you see an easier way for now?
I’ll look into this. One thing I’ve noticed is that well designed bots reduce the amount of requests sent to discord’s API. I wonder if certain data exists in the interaction we receive.
A little off topic but we’d want to make sure we have some kind of fundamental design for handling making requests and avoiding them. Maybe we keep this in mind as we start building out our discord API usage.
/kick user: [user] reason: [reason]
/ban user: [user] reason: [reason]
/warn user: [user] reason: [reason]
/assign user: [user] role: [role]
/assign me role: [role]