Exemplo n.º 1
0
        public static Task Nav_ShopSort(SocketReaction reaction, MenuIdStructure menuSession)
        {
            if (reaction.Emote.Name == "↩️")
            {
                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = ShopMenu.ShopMainMenu(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "\u0031\ufe0f\u20e3") // Keycap one
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Shop_Sort setting to the chosen value.
                account.Shop_Sort = "title_a_z";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = ShopMenu.ShopSortConfirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "\u0032\ufe0f\u20e3") // Keycap two
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Shop_Sort setting to the chosen value.
                account.Shop_Sort = "title_z_a";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = ShopMenu.ShopSortConfirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "\u0033\ufe0f\u20e3") // Keycap three
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Shop_Sort setting to the chosen value.
                account.Shop_Sort = "cost_low_high";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = ShopMenu.ShopSortConfirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "\u0034\ufe0f\u20e3") // Keycap four
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Shop_Sort setting to the chosen value.
                account.Shop_Sort = "cost_high_low";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = ShopMenu.ShopSortConfirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "\u0035\ufe0f\u20e3") // Keycap five
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Shop_Sort setting to the chosen value.
                account.Shop_Sort = "release_old_new";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = ShopMenu.ShopSortConfirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            else if (reaction.Emote.Name == "\u0036\ufe0f\u20e3") // Keycap six
            {
                // Get the account information of the user.
                var account = UserInfoClasses.GetAccount(menuSession.User);

                // Change the user's Shop_Sort setting to the chosen value.
                account.Shop_Sort = "release_new_old";

                //Update the user's account.
                UserInfoClasses.UpdateAccount(account);

                // Stop the timeout timer associated with the menu
                menuSession.MenuTimer.Stop();

                // Go to a new menu
                _ = ShopMenu.ShopSortConfirm(menuSession.User, menuSession.MenuMessage);
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }