Exemplo n.º 1
0
        public async Task <int> RemoveGuild(ulong guildid)
        {
            bool result = GuildSettings.Remove(GuildSettings.First(xr => xr.Id == guildid));

            await this.SQLConn.OpenAsync();

            var command = new SQLiteCommand($"DELETE FROM config WHERE id = {guildid}", this.SQLConn);
            var Out     = await command.ExecuteNonQueryAsync();

            this.SQLConn.Close();
            return(Out);
        }
Exemplo n.º 2
0
        public async Task <DiscordUrieGuild> FindGuildSettings(DiscordGuild SearchForGuild)
        {
            if (GuildSettings.Any(xr => xr.Id == SearchForGuild.Id))
            {
                return(GuildSettings.First(xr => xr.Id == SearchForGuild.Id));
            }
            else
            {
                DiscordUrieGuild NewDefaultServer = await this.SettingsInstance.CreateGuildDefaultSettings(SearchForGuild);

                GuildSettings.Add(NewDefaultServer);
                await NewDefaultServer.SaveGuild(this.SQLConn);

                return(NewDefaultServer);
            }
        }