public IBotServerConfiguration GetServerConfig(ulong id, ChatTypes chatType, string name = "") { var result = GuildConfigs.FirstOrDefault(x => x.Id == id && (x.ChatType ?? ChatTypes.Discord) == chatType); if (result == null) { result = new ServerConfiguration() { Id = id, ChatType = chatType, Name = name }; GuildConfigs.Add(result); } result.ChatType = chatType; return(result); }
private void CreateGuild(ulong guildId) { GuildConfig guildConfig = new GuildConfig(guildId); GuildConfigs.Add(guildConfig.GuildId, guildConfig); }