예제 #1
0
        public static async Task <bool> AttemptChargeDallarForCommand(CommandContext Context, Decimal Amount)
        {
            if (!await PromptUserToSpendDallarOnCommand(Context, Amount))
            {
                return(false);
            }

            if (!DallarHelpers.UserPayAmountToFeeAccount(Context.User, Amount))
            {
                return(false);
            }

            return(true);
        }
예제 #2
0
        public static async Task <bool> PromptUserToSpendDallarOnCommand(CommandContext Context, decimal Amount)
        {
            // If user can't afford command, immediately fail
            if (!DallarHelpers.CanUserAffordTransactionAmount(Context.User, Amount))
            {
                await PromptUserToDeleteMessage(Context, $"You can not afford the cost of the {Context.Command.Name} command. You need {Amount} Dallar.");

                return(false);
            }

            if (!await PromptUserToConfirm(Context, $"{Context.User.Mention}: Please confirm spending {Amount} Dallar on the `{Context.Command.Name}` command. This fee will be sent to the server owner hosting Dallar Bot to help with operating costs."))
            {
                DiscordHelpers.DeleteNonPrivateMessage(Context);
                return(false);
            }

            return(true);
        }