예제 #1
0
파일: Info.cs 프로젝트: Spoertm/Clubber
    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));
    }