Wolfringo Wolfringo
Wolfringo Wolfringo
Wolfringo (c) 2020 TehGM
DocFX, DiscordFX theme.
Search Results for

    Class CommandContextExtensions

    Extensions for ICommandContext.

    Inheritance
    System.Object
    CommandContextExtensions
    Namespace: TehGM.Wolfringo.Commands
    Assembly: Wolfringo.Commands.dll
    Syntax
    public static class CommandContextExtensions

    Methods

    | Improve this Doc View Source

    GetBotProfileAsync(ICommandContext, CancellationToken)

    Gets profile of the bot user.

    Declaration
    public static Task<WolfUser> GetBotProfileAsync(this ICommandContext context, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    ICommandContext context

    Command context.

    System.Threading.CancellationToken cancellationToken

    Token to cancel server request with.

    Returns
    Type Description
    System.Threading.Tasks.Task<WolfUser>

    Profile of the bot user.

    See Also
    GetRecipientAsync<T>(ICommandContext, CancellationToken)
    GetSenderAsync(ICommandContext, CancellationToken)
    | Improve this Doc View Source

    GetRecipientAsync<T>(ICommandContext, CancellationToken)

    Gets profile of the recipient of the message.

    Declaration
    public static async Task<T> GetRecipientAsync<T>(this ICommandContext context, CancellationToken cancellationToken = default(CancellationToken))
        where T : class, IWolfEntity
    Parameters
    Type Name Description
    ICommandContext context

    Command context.

    System.Threading.CancellationToken cancellationToken

    Token to cancel server request with.

    Returns
    Type Description
    System.Threading.Tasks.Task<T>

    Profile of the message's recipient; if T does not match the message type, null will be returned.

    Type Parameters
    Name Description
    T

    Type of recipient, for example WolfUser or WolfGroup.

    See Also
    GetSenderAsync(ICommandContext, CancellationToken)
    GetBotProfileAsync(ICommandContext, CancellationToken)
    | Improve this Doc View Source

    GetSenderAsync(ICommandContext, CancellationToken)

    Gets profile of the user that sent the command.

    Declaration
    public static Task<WolfUser> GetSenderAsync(this ICommandContext context, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    ICommandContext context

    Command context to get message sender of.

    System.Threading.CancellationToken cancellationToken

    Token to cancel server request with.

    Returns
    Type Description
    System.Threading.Tasks.Task<WolfUser>

    Profile of the user that sent the command

    See Also
    GetRecipientAsync<T>(ICommandContext, CancellationToken)
    GetBotProfileAsync(ICommandContext, CancellationToken)
    | Improve this Doc View Source

    ReplyImageAsync(ICommandContext, IEnumerable<Byte>, CancellationToken)

    Sends an image response message to group or user.

    Declaration
    public static Task<ChatResponse> ReplyImageAsync(this ICommandContext context, IEnumerable<byte> imageBytes, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    ICommandContext context

    Command context.

    System.Collections.Generic.IEnumerable<System.Byte> imageBytes

    Bytes of the image to send.

    System.Threading.CancellationToken cancellationToken

    Token to cancel server request with.

    Returns
    Type Description
    System.Threading.Tasks.Task<ChatResponse>

    Message sending response.

    | Improve this Doc View Source

    ReplyTextAsync(ICommandContext, String, CancellationToken)

    Sends a text message response message to group or user.

    Declaration
    public static Task<ChatResponse> ReplyTextAsync(this ICommandContext context, string text, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    ICommandContext context

    Command context.

    System.String text

    Content of the message.

    System.Threading.CancellationToken cancellationToken

    Token to cancel server request with.

    Returns
    Type Description
    System.Threading.Tasks.Task<ChatResponse>

    Message sending response.

    | Improve this Doc View Source

    ReplyTextAsync(ICommandContext, String, ChatMessageSendingOptions, CancellationToken)

    Sends a text message response message to group or user.

    Declaration
    public static async Task<ChatResponse> ReplyTextAsync(this ICommandContext context, string text, ChatMessageSendingOptions options, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    ICommandContext context

    Command context.

    System.String text

    Content of the message.

    ChatMessageSendingOptions options

    Options configuring how the message should get pre-processed.

    System.Threading.CancellationToken cancellationToken

    Token to cancel server request with.

    Returns
    Type Description
    System.Threading.Tasks.Task<ChatResponse>

    Message sending response.

    | Improve this Doc View Source

    ReplyVoiceAsync(ICommandContext, IEnumerable<Byte>, CancellationToken)

    Sends a voice response message to group or user.

    Declaration
    public static Task<ChatResponse> ReplyVoiceAsync(this ICommandContext context, IEnumerable<byte> voiceBytes, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    ICommandContext context

    Command context.

    System.Collections.Generic.IEnumerable<System.Byte> voiceBytes

    Bytes of the voice to send.

    System.Threading.CancellationToken cancellationToken

    Token to cancel server request with.

    Returns
    Type Description
    System.Threading.Tasks.Task<ChatResponse>

    Message sending response.