So I've been coding my discord bot and wanted to add a function to give an user a specific role like you are a player in a game and you type in a "cheat code" it grants you the cheater role. How can I do this? Thanks for helping.
For anybody finding this in the future here is how I give a user a role:
var user = Context.User;
var role = Context.Guild.Roles.FirstOrDefault(x => x.Name == "RoleName");
await (user as IGuildUser).AddRoleAsync(role);
Hope this helps!