public void EnsureSeedData() { if (!BotConfig.Any()) { var botc = new BotConfig(); BotConfig.Add(botc); SaveChanges(); } }
////Uncomment this to db initialisation with dotnet ef migration add [module] //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) //{ // optionsBuilder.UseSqlite("Filename=./data/NadekoBot.db"); //} public void EnsureSeedData() { if (!BotConfig.Any()) { var bc = new BotConfig(); bc.ModulePrefixes.AddRange(new HashSet <ModulePrefix>() { new ModulePrefix() { ModuleName = "Administration", Prefix = "." }, new ModulePrefix() { ModuleName = "Searches", Prefix = "~" }, new ModulePrefix() { ModuleName = "Translator", Prefix = "~" }, new ModulePrefix() { ModuleName = "NSFW", Prefix = "~" }, new ModulePrefix() { ModuleName = "ClashOfClans", Prefix = "," }, new ModulePrefix() { ModuleName = "Help", Prefix = "-" }, new ModulePrefix() { ModuleName = "Music", Prefix = "!!" }, new ModulePrefix() { ModuleName = "Trello", Prefix = "trello" }, new ModulePrefix() { ModuleName = "Games", Prefix = ">" }, new ModulePrefix() { ModuleName = "Gambling", Prefix = "$" }, new ModulePrefix() { ModuleName = "Permissions", Prefix = ";" }, new ModulePrefix() { ModuleName = "Pokemon", Prefix = ">" }, new ModulePrefix() { ModuleName = "Utility", Prefix = "." }, new ModulePrefix() { ModuleName = "CustomReactions", Prefix = "." }, new ModulePrefix() { ModuleName = "PokeGame", Prefix = ">" } }); bc.RaceAnimals.AddRange(new HashSet <RaceAnimal> { new RaceAnimal { Icon = "🐼", Name = "Panda" }, new RaceAnimal { Icon = "🐻", Name = "Bear" }, new RaceAnimal { Icon = "🐧", Name = "Pengu" }, new RaceAnimal { Icon = "🐨", Name = "Koala" }, new RaceAnimal { Icon = "🐬", Name = "Dolphin" }, new RaceAnimal { Icon = "🐞", Name = "Ladybird" }, new RaceAnimal { Icon = "🦀", Name = "Crab" }, new RaceAnimal { Icon = "🦄", Name = "Unicorn" } }); bc.EightBallResponses.AddRange(new HashSet <EightBallResponse> { new EightBallResponse() { Text = "Most definitely yes" }, new EightBallResponse() { Text = "For sure" }, new EightBallResponse() { Text = "Totally!" }, new EightBallResponse() { Text = "Of course!" }, new EightBallResponse() { Text = "As I see it, yes" }, new EightBallResponse() { Text = "My sources say yes" }, new EightBallResponse() { Text = "Yes" }, new EightBallResponse() { Text = "Most likely" }, new EightBallResponse() { Text = "Perhaps" }, new EightBallResponse() { Text = "Maybe" }, new EightBallResponse() { Text = "Not sure" }, new EightBallResponse() { Text = "It is uncertain" }, new EightBallResponse() { Text = "Ask me again later" }, new EightBallResponse() { Text = "Don't count on it" }, new EightBallResponse() { Text = "Probably not" }, new EightBallResponse() { Text = "Very doubtful" }, new EightBallResponse() { Text = "Most likely no" }, new EightBallResponse() { Text = "Nope" }, new EightBallResponse() { Text = "No" }, new EightBallResponse() { Text = "My sources say no" }, new EightBallResponse() { Text = "Dont even think about it" }, new EightBallResponse() { Text = "Definitely no" }, new EightBallResponse() { Text = "NO - It may cause disease contraction" } }); BotConfig.Add(bc); this.SaveChanges(); } }
public void EnsureSeedData() { if (!BotConfig.Any()) { var bc = new BotConfig(); bc.RaceAnimals.AddRange(new HashSet <RaceAnimal> { new RaceAnimal { Icon = "🐼", Name = "Panda" }, new RaceAnimal { Icon = "🐻", Name = "Bear" }, new RaceAnimal { Icon = "🐧", Name = "Pengu" }, new RaceAnimal { Icon = "🐨", Name = "Koala" }, new RaceAnimal { Icon = "🐬", Name = "Dolphin" }, new RaceAnimal { Icon = "🐞", Name = "Ladybird" }, new RaceAnimal { Icon = "🦀", Name = "Crab" }, new RaceAnimal { Icon = "🦄", Name = "Unicorn" } }); bc.EightBallResponses.AddRange(new HashSet <EightBallResponse> { new EightBallResponse() { Text = "Most definitely yes" }, new EightBallResponse() { Text = "For sure" }, new EightBallResponse() { Text = "Totally!" }, new EightBallResponse() { Text = "Of course!" }, new EightBallResponse() { Text = "As I see it, yes" }, new EightBallResponse() { Text = "My sources say yes" }, new EightBallResponse() { Text = "Yes" }, new EightBallResponse() { Text = "Most likely" }, new EightBallResponse() { Text = "Perhaps" }, new EightBallResponse() { Text = "Maybe" }, new EightBallResponse() { Text = "Not sure" }, new EightBallResponse() { Text = "It is uncertain" }, new EightBallResponse() { Text = "Ask me again later" }, new EightBallResponse() { Text = "Don't count on it" }, new EightBallResponse() { Text = "Probably not" }, new EightBallResponse() { Text = "Very doubtful" }, new EightBallResponse() { Text = "Most likely no" }, new EightBallResponse() { Text = "Nope" }, new EightBallResponse() { Text = "No" }, new EightBallResponse() { Text = "My sources say no" }, new EightBallResponse() { Text = "Dont even think about it" }, new EightBallResponse() { Text = "Definitely no" }, new EightBallResponse() { Text = "NO - It may cause disease contraction" } }); BotConfig.Add(bc); this.SaveChanges(); } }
public void EnsureSeedData() { if (!BotConfig.Any()) { var bc = new BotConfig(); bc.RaceAnimals.AddRange(new HashSet <RaceAnimal> { new RaceAnimal { Icon = "🐼", Name = "Panda" }, new RaceAnimal { Icon = "🐻", Name = "Bear" }, new RaceAnimal { Icon = "🐧", Name = "Pengu" }, new RaceAnimal { Icon = "🐨", Name = "Koala" }, new RaceAnimal { Icon = "🐬", Name = "Dolphin" }, new RaceAnimal { Icon = "🐞", Name = "Ladybug" }, new RaceAnimal { Icon = "🦀", Name = "Crab" }, new RaceAnimal { Icon = "🦄", Name = "Unicorn" } }); bc.EightBallResponses.AddRange(new HashSet <EightBallResponse> { new EightBallResponse() { Text = "Most definitely yes" }, new EightBallResponse() { Text = "For sure" }, new EightBallResponse() { Text = "Totally!" }, new EightBallResponse() { Text = "Of course!" }, new EightBallResponse() { Text = "As I see it, yes" }, new EightBallResponse() { Text = "My sources say yes" }, new EightBallResponse() { Text = "Yes" }, new EightBallResponse() { Text = "Most likely" }, new EightBallResponse() { Text = "Perhaps" }, new EightBallResponse() { Text = "Maybe" }, new EightBallResponse() { Text = "Not sure" }, new EightBallResponse() { Text = "It is uncertain" }, new EightBallResponse() { Text = "Totes" }, new EightBallResponse() { Text = "Roll a d20" }, new EightBallResponse() { Text = "Don't count on it" }, new EightBallResponse() { Text = "Probably not" }, new EightBallResponse() { Text = "Very doubtful" }, new EightBallResponse() { Text = "Most likely no" }, new EightBallResponse() { Text = "Crit fail! `1d20` = (1) = 1. Rocks fall, you die." }, new EightBallResponse() { Text = "No" }, new EightBallResponse() { Text = "My sources say no" }, new EightBallResponse() { Text = "Dont even think about it" }, new EightBallResponse() { Text = "Definitely no" }, new EightBallResponse() { Text = "NO - Absolutely not!" } }); BotConfig.Add(bc); this.SaveChanges(); } }
public void EnsureSeedData() { if (BotConfig.Any()) { return; } var bc = new BotConfig(); bc.EightBallResponses.AddRange(new HashSet <EightBallResponse> { new EightBallResponse { Text = "Most definitely yes" }, new EightBallResponse { Text = "For sure" }, new EightBallResponse { Text = "Totally!" }, new EightBallResponse { Text = "Of course!" }, new EightBallResponse { Text = "As I see it, yes" }, new EightBallResponse { Text = "My sources say yes" }, new EightBallResponse { Text = "Yes" }, new EightBallResponse { Text = "Most likely" }, new EightBallResponse { Text = "Perhaps" }, new EightBallResponse { Text = "Maybe" }, new EightBallResponse { Text = "Not sure" }, new EightBallResponse { Text = "It is uncertain" }, new EightBallResponse { Text = "Ask me again later" }, new EightBallResponse { Text = "Don't count on it" }, new EightBallResponse { Text = "Probably not" }, new EightBallResponse { Text = "Very doubtful" }, new EightBallResponse { Text = "Most likely no" }, new EightBallResponse { Text = "Nope" }, new EightBallResponse { Text = "No" }, new EightBallResponse { Text = "My sources say no" }, new EightBallResponse { Text = "Dont even think about it" }, new EightBallResponse { Text = "Definitely no" }, new EightBallResponse { Text = "NO - It may cause disease contraction" } }); BotConfig.Add(bc); SaveChanges(); }