コード例 #1
0
 /// <summary>Creates all guild cooldowns of the guilds previously saved in the file. </summary>
 public void CreateAllGuildCooldownsAndInvocations()
 {
     guildIDs = GetAllGuildIDs();
     for (int i = 0; i < guildIDs.Count; i++)
     {
         _cooldown.CreateAllPairs(guildIDs[i]);
         _invoke.CreateAllPairs(guildIDs[i]);
     }
 }
コード例 #2
0
        private void CreateGuildFiles(ulong guildID)
        {
            if (categoryList == null || !categoryList.Any())
            {
                GenerateNewCategoryList();
            }

            for (int i = 0; i < categoryList.Count; i++)
            {
                string filePath = $"GuildAccounts/{guildID}/{categoryList[i]}.json";
                if (File.Exists(filePath))
                {
                    continue;
                }

                var categoryObject = _guildFilesGeneration.GetAndCreateObject(categoryList[i], guildID);
                _cooldown.CreateAllPairs(guildID);

                var rawData = JsonConvert.SerializeObject(categoryObject, Formatting.Indented);
                File.WriteAllText(filePath, rawData);
            }
        }