public RockPaperScissors() { if (SaveAndLoad.FileExists("rockPaperScissors", "rockPaperScissorsSave.json")) { SaveAndLoad.LoadFile(out users, "rockPaperScissors", "rockPaperScissorsSave.json"); } }
public FernRemember() { if (SaveAndLoad.FileExists("Remember", "Remembered.json")) { SaveAndLoad.LoadFile(out remembered, "Remember", "Remembered.json"); } }
public ReactionRoles() { if (SaveAndLoad.FileExists(Directory.GetCurrentDirectory(), reactionRolesPath)) { SaveAndLoad.LoadFile(out rolesForServers, Directory.GetCurrentDirectory(), reactionRolesPath); } if (SaveAndLoad.FileExists(Directory.GetCurrentDirectory(), reactionMessages)) { SaveAndLoad.LoadFile(out messagesForReactions, Directory.GetCurrentDirectory(), reactionMessages); } }
void RemindMeSetup(SocketMessage message, string lowercase) { if (SaveAndLoad.FileExists(UserPath, message.Author.Id.ToString() + ".json")) { message.Author.SendFileAsync("You already have a remind me user."); return; } User user = new User() { username = message.Author.Username, discrim = message.Author.DiscriminatorValue, userID = message.Author.Id, }; SaveAndLoad.SaveFile(user, UserPath, message.Author.Id.ToString() + ".json"); }
private void Init() { int data_version = 18; //await Voc.InitAsync(); if (!SaveAndLoad.FileExists("setting.txt")) { SaveAndLoad.SaveText("setting.txt", ""); } Voc.setting = Voc.GetDoc("setting", false); if (!Voc.setting.exists("website")) { Voc.setting.add("website", "http://joe59491.azurewebsites.net"); } if (!Voc.setting.exists("sound_url")) { Voc.setting.add("sound_url", "http://dictionary.reference.com/browse/"); } if (!Voc.setting.exists("sound_url2")) { Voc.setting.add("sound_url2", "http://static.sfdict.com/staticrep/dictaudio"); } if (!Voc.setting.exists("sound_type")) { Voc.setting.add("sound_type", ".mp3"); } if (!Voc.setting.exists("data_version")) { Voc.setting.add("data_version", "0"); } Voc.SavingSetting(); if (!SaveAndLoad.FileExists("favorite.txt")) { SaveAndLoad.SaveText("favorite.txt", ""); } Voc.favorite = Voc.GetDoc("favorite", false); if (!SaveAndLoad.FileExists("words.txt") || int.Parse(Voc.setting["data_version"]) < data_version) { Voc.DumpAppFile("words.txt"); } if (!SaveAndLoad.FileExists("root.txt") || int.Parse(Voc.setting["data_version"]) < data_version) { Voc.DumpAppFile("root.txt"); } if (!SaveAndLoad.FileExists("prefix.txt") || int.Parse(Voc.setting["data_version"]) < data_version) { Voc.DumpAppFile("prefix.txt"); } if (!SaveAndLoad.FileExists("suffix.txt") || int.Parse(Voc.setting["data_version"]) < data_version) { Voc.DumpAppFile("suffix.txt"); } if (!SaveAndLoad.FileExists("note.txt") || int.Parse(Voc.setting["data_version"]) < data_version) { Voc.DumpAppFile("note.txt"); } if (int.Parse(Voc.setting["data_version"]) < data_version) { Voc.setting["data_version"] = data_version.ToString(); } Voc.words = Voc.GetDoc("words", true); var tmp = Voc.words.val("apple"); foreach (var x in Voc.words.data) { var y = x; } Voc.root = Voc.GetDoc("root", true); Voc.prefix = Voc.GetDoc("prefix", true); Voc.suffix = Voc.GetDoc("suffix", true); Voc.note = Voc.GetDoc("note", true); }