Reputation: 3
I would like require a certain role on the user in order for them to use/execute specific commands.
Is there an easy way to do this for individual commands?
Upvotes: 0
Views: 1506
Reputation: 799
This is using Discord.Net 1.0
var User = Context.User as SocketGuildUser;
var role = Context.Guild.Roles.FirstOrDefault(x => x.Name == "ROLENAME");
if (User.Roles.Contains(role))
{
// do stuff
}
Upvotes: 1