public static void UpdateUserLicenseDuration(ShopUserModel user, int days, double price)
        {
            user.LicenseBuyProcess.Days  = days;
            user.LicenseBuyProcess.Price = price;

            UpdateFile();
        }
        private static ShopUserModel CreateAndCacheUser(string telegramId)
        {
            var newUser = new ShopUserModel {
                Telegram = telegramId
            };

            GetAllUsers().Add(telegramId, newUser);
            UpdateFile();

            return(newUser);
        }
        public static void UpdateSpamLevelWarning(ShopUserModel user, int?level = null)
        {
            if (level.HasValue == false)
            {
                user.SpamWarning++;
            }
            else
            {
                user.SpamWarning = level.Value;
                GetAllUsers()[user.Telegram].SpamWarning = level.Value;
            }

            UpdateFile();
        }
        public static void UpdateUserBuyLicenseKey(ShopUserModel user, string licenseKey)
        {
            user.LicenseBuyProcess.LicenseKey = licenseKey;

            UpdateFile();
        }
        public static void RemoveLicenseKey(ShopUserModel user, string licenseKey)
        {
            user.LicenseKeys.Remove(licenseKey);

            UpdateFile();
        }
        public static void AddLicenseKey(ShopUserModel user, string licenseKey)
        {
            user.LicenseKeys.Add(licenseKey);

            UpdateFile();
        }
        public static void UpdateUserDialogState(ShopUserModel user, EDialogState state)
        {
            user.CurrentDialogState = state;

            UpdateFile();
        }
        public static void UpdateUserLastMessageDate(ShopUserModel user)
        {
            user.LastMessageDate = DateTime.Now;

            UpdateFile();
        }
        public static bool IsUserSpamming(ShopUserModel userModel)
        {
            var seconds = (DateTime.Now - userModel.LastMessageDate).TotalSeconds;

            return(seconds < 0.5);
        }
        public static void UpdatePurchaseUniqueComment(ShopUserModel user, string comment)
        {
            user.LicenseBuyProcess.Comment = comment;

            UpdateFile();
        }