Discord.Net
Discord.Net copied to clipboard
will someone PLEASE tell me how to check if a user has a certain role
i have read every single article on every single google page and no solution works. for the love of god please help me i have destroyed my second monitor because i have been trying to do this shit for 7 hours
get the user in the guild then do user.RoleIds.Contains(Id), don't think you read the docs
I have this (this is just made quickly as I was to lazy to make it properly but it does work)
var user = (Context.User as SocketGuildUser)!;
var role = Context.Guild.GetRole(ROLE_ID);
if (user.Roles.Contains(role))
{
// do your thing here
}