public async Task Edit(string roleColour) { var guildUser = (SocketGuildUser)Context.User; var firstRole = guildUser .Roles .Where(x => x.Id != Constants.NSFW_ROLE) .FirstOrDefault(); if (firstRole == default) { await ReplyAsync("You have no roles to edit :("); return; } var guildRole = Context.Guild.GetRole(firstRole.Id); var colour = StringToDiscordColourHelper.FromName(roleColour); await guildRole.ModifyAsync(role => role.Color = colour); }
public Task Add(string roleName, string roleColour) { var colour = StringToDiscordColourHelper.FromName(roleColour); return(TryCreateAndAssignRole(roleName, colour)); }
public Task Edit(string roleName, string roleColour) { var colour = StringToDiscordColourHelper.FromName(roleColour); return(AttemptToEditRole(roleName, colour)); }