/// <summary>
        /// Not currently used
        /// </summary>
        /// <param name="arg1"></param>
        /// <param name="arg2"></param>
        /// <param name="arg3"></param>
        /// <returns></returns>
        private Task ContextCommandExecuted(ContextCommandInfo arg1, Discord.IInteractionContext arg2, Discord.Interactions.IResult arg3)
        {
            if (!arg3.IsSuccess)
            {
                switch (arg3.Error)
                {
                case InteractionCommandError.UnmetPrecondition:
                    // implement
                    break;

                case InteractionCommandError.UnknownCommand:
                    // implement
                    break;

                case InteractionCommandError.BadArgs:
                    // implement
                    break;

                case InteractionCommandError.Exception:
                    // implement
                    break;

                case InteractionCommandError.Unsuccessful:
                    // implement
                    break;

                default:
                    break;
                }
            }

            return(Task.CompletedTask);
        }
    private Task ContextCommandExecuted(ContextCommandInfo context, IInteractionContext arg2, IResult result)
    {
        if (!result.IsSuccess)
        {
            switch (result.Error)
            {
            case InteractionCommandError.UnmetPrecondition:
                // implement
                break;

            case InteractionCommandError.UnknownCommand:
                // implement
                break;

            case InteractionCommandError.BadArgs:
                // implement
                break;

            case InteractionCommandError.Exception:
                // implement
                break;

            case InteractionCommandError.Unsuccessful:
                // implement
                break;

            default:
                break;
            }
        }

        return(Task.CompletedTask);
    }
示例#3
0
 /// <summary>
 /// Retrieves the Context Command result and acts accordingly in case of error.
 /// </summary>
 /// <param name="_">The received <see cref="ContextCommandInfo"/>.</param>
 /// <param name="arg2">The interaction context.</param>
 /// <param name="arg3">The interaction result.</param>
 /// <returns>A task that represents the asynchronous execution operation. The task contains the result of the command execution.</returns>
 public async Task HandleContextCommandAsync(ContextCommandInfo _, IInteractionContext arg2, IResult arg3) => await HandleCommandAsync(arg2, arg3);