示例#1
0
        public async Task RoleUnSetAsync(params SocketRole[] roles)
        {
            ulong     name = Context.Guild.Id;
            GuildData data;

            if (!GuildManager.CheckGuildData(name))
            {
                await ReplyAsync("No GuildData for this Guild!");

                return;
            }
            else
            {
                data = GuildManager.GetGuildData(name).Result;
            }

            foreach (SocketRole role in roles)
            {
                if (data.AssignableRoles.Contains(role.Id))
                {
                    data.AssignableRoles.Remove(role.Id);
                    await ReplyAsync($"Unset Role {role.Name} from self-apply!");
                }
            }
            await GuildManager.SetGuildData(data);
        }
示例#2
0
        public async Task SetLogAsync(SocketChannel channel)
        {
            ulong chanID = channel.Id;

            if (GuildManager.CheckGuildData(Context.Guild.Id))
            {
                GuildData data = await GuildManager.GetGuildData(Context.Guild.Id);

                data.LogChannel = chanID;
                await GuildManager.SetGuildData(data);
            }
            else
            {
                GuildData data = new GuildData
                {
                    GuildID    = Context.Guild.Id,
                    LogChannel = chanID
                };
                await GuildManager.SetGuildData(data);
            }
        }