Ejemplo n.º 1
0
        void AddUse(ulong userID, string commandName)
        {
            if (!storedData.MaxUses.ContainsKey(userID))
            {
                storedData.MaxUses.Add(userID, new List <MaxUses>());
            }

            var foundUses = storedData.MaxUses[userID].SingleOrDefault(x => x.CommandName.ToLower() == commandName.ToLower());

            if (foundUses != null)
            {
                foundUses.Uses++;
                return;
            }

            var maxUses = new MaxUses(commandName, 1);

            storedData.MaxUses[userID].Add(maxUses);
            SaveData();
        }
Ejemplo n.º 2
0
        void AddUse(ulong userID, string commandName)
        {
            if (!storedData.MaxUses.ContainsKey(userID))
            {
                storedData.MaxUses.Add(userID, new List <MaxUses>());
            }
            var search = storedData.MaxUses[userID].Where(x => x.CommandName.ToLower() == commandName.ToLower());

            if (search.Any())
            {
                search.First().Uses++;
                SaveData();
                return;
            }

            var maxUses = new MaxUses(commandName, 1);

            storedData.MaxUses[userID].Add(maxUses);
            SaveData();
        }