private void LoadCommands() { var list = commandText.ReadAllLines(); foreach (var l in list) { var split = l.Split(new[] { '=' }); bot.personalizedCommands.customCommands.Add(split[0], bot.personalizedCommands.CreateCustomCommand(split[1])); } }
void LoadQuotes() { var lines = quoteText.ReadAllLines(); foreach (var l in lines) { var split = l.Split(new[] { '&' }); quotes.Add(int.Parse(split[0]), split[1]); } }
void LoadStats() { var lines = userStatsTxt.ReadAllLines(); foreach (var l in lines) { var split1 = l.Split(new[] { '=' }); string username = split1[0]; var split2 = split1[1].Split(new[] { '.' }); int coins, time, shards; coins = int.Parse(split2[0]); time = int.Parse(split2[1]); shards = int.Parse(split2[2]); if (coins > 0 || time > 0) { userStats.Add(username.ToLower(), new UserStats(coins, time, shards)); } } }
//Read credentials from file public static void ReadCredentials(string absolutePath) { TxtFile file = new TxtFile(absolutePath); var lines = file.ReadAllLines(); for (int i = 0; i < lines.Count; i++) { var split = lines[i].Split(new[] { ':' }); switch (split[0].ToLower()) { case "botname": case "botusername": { botUsername = split[1]; } break; case "bottoken": { botToken = split[1]; } break; case "destination": { targetStream = split[1]; } break; case "clientid": { clientId = split[1]; } break; case "authtoken": case "authenticationtoken": { authToken = split[1]; } break; case "currencyname": { currencyName = split[1]; } break; case "botrefreshtoken": { botRefreshToken = split[1]; } break; case "authrefreshtoken": { authRefreshToken = split[1]; } break; default: break; } } }