Ejemplo n.º 1
0
    public async Task Help([Remainder] string command)
    {
        SearchResult searchResult = _commands.Search(Context, command);

        if (await IsError(!searchResult.IsSuccess, $"The command `{command}` doesn't exist."))
        {
            return;
        }

        PreconditionResult preCondCheck = await searchResult.Commands[0].Command.CheckPreconditionsAsync(Context);

        if (await IsError(!preCondCheck.IsSuccess, $"The command `{command}` couldn't be executed.\nReason: " + preCondCheck.ErrorReason))
        {
            return;
        }

        Embed embed = EmbedHelper.CommandHelp(Context, searchResult);

        await ReplyAsync(embed : embed, allowedMentions : AllowedMentions.None, messageReference : new(Context.Message.Id));
    }