Пример #1
0
        void BackupStats(List <string> write)
        {
            DateTime now    = DateTime.Now;
            TxtFile  backup = new TxtFile($@"{backupDirectoryPath}\{now.Year}-{now.Month}-{now.Day}-UserStats.ini");

            backup.WriteAllLines(write);
        }
Пример #2
0
        private void SaveCommands()
        {
            List <string> write = new List <string>();

            foreach (var c in bot.personalizedCommands.customCommands)
            {
                write.Add($"{c.Key}={c.Value.info}");
            }
            commandText.WriteAllLines(write);
        }
Пример #3
0
        void SaveQuotes()
        {
            List <string> write = new List <string>();

            foreach (var q in quotes)
            {
                write.Add($"{q.Key}&{q.Value}");
            }
            quoteText.WriteAllLines(write);
        }
Пример #4
0
        internal void SaveStats()
        {
            List <string> write = new List <string>();

            foreach (var u in userStats)
            {
                write.Add($"{u.Key}={u.Value.coins}.{u.Value.time}.{u.Value.shards}");
            }
            userStatsTxt.WriteAllLines(write);
            BackupStats(write);
        }
Пример #5
0
        public static void SaveCredentials(string absolutePath)
        {
            TxtFile       file  = new TxtFile(absolutePath);
            List <string> write = new List <string>
            {
                $"Destination:{targetStream}",
                $"BotUsername:{botUsername}",
                $"BotToken:{botToken}",
                $"BotRefreshToken:{botRefreshToken}",
                $"AuthToken:{authToken}",
                $"AuthRefreshToken:{authRefreshToken}",
                $"ClientId:{clientId}",
                $"CurrencyName:{currencyName}"
            };

            file.WriteAllLines(write);
        }
Пример #6
0
 internal void NewSession()
 {
     extraCoins = missedCoins = 0;
     bits       = subs = 0;
     extraCoinsText.WriteLine("0.00");
     if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
     {
         kraken = true;
         krakenText.WriteAllLines(new List <string>
         {
             "Next kraken: 0.00/11",
             "Krakens released: 0"
         });
         nextKraken   = 11;
         totalKrakens = 0;
     }
     else
     {
         kraken = false;
     }
     bot.Log("Automatically starting new session");
 }