Exemple #1
0
        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);
        }
Exemple #2
0
        public Task Add(string roleName, string roleColour)
        {
            var colour = StringToDiscordColourHelper.FromName(roleColour);

            return(TryCreateAndAssignRole(roleName, colour));
        }
Exemple #3
0
        public Task Edit(string roleName, string roleColour)
        {
            var colour = StringToDiscordColourHelper.FromName(roleColour);

            return(AttemptToEditRole(roleName, colour));
        }