Esempio n. 1
0
        public async Task RemoveModRole(IRole role)
        {
            var guildMod = await GuildModRepository.Single(gm => gm.RoleId == role.Id && gm.GuildId == Context.Guild.Id);

            if (guildMod == null)
            {
                await ReplyAsync("Role is already not a mod role.");

                return;
            }
            await GuildModRepository.DeleteById(guildMod.Id);

            await ReplyAsync("Removed");
        }
Esempio n. 2
0
        public async Task AddModRole(IRole role)
        {
            var guildMod = await GuildModRepository.Single(gm => gm.RoleId == role.Id && gm.GuildId == Context.Guild.Id);

            if (guildMod != null)
            {
                await ReplyAsync("Role is already a mod role.");

                return;
            }
            await GuildModRepository.Save(new GuildModEntity
            {
                GuildId = Context.Guild.Id,
                RoleId  = role.Id,
            });

            await ReplyAsync("Added");
        }