Search Results for

    Show / Hide Table of Contents

    Class KuracordClient

    Inheritance
    Object
    BaseKuracordClient
    KuracordClient
    Inherited Members
    BaseKuracordClient.ApiClient
    BaseKuracordClient.Configuration
    BaseKuracordClient.Logger
    BaseKuracordClient.VersionString
    BaseKuracordClient.CurrentUser
    BaseKuracordClient.UserCache
    BaseKuracordClient.InitializeAsync()
    Namespace: KSharpPlus.Clients
    Assembly: KSharpPlus.dll
    Syntax
    public sealed class KuracordClient : BaseKuracordClient

    Constructors

    | Improve this Doc View Source

    KuracordClient(KuracordConfiguration)

    Initializes a new instance of KuracordClient.

    Declaration
    public KuracordClient(KuracordConfiguration config)
    Parameters
    Type Name Description
    KuracordConfiguration config

    Specifies configuration parameters.

    Properties

    | Improve this Doc View Source

    GatewayUri

    Declaration
    public static Uri GatewayUri { get; }
    Property Value
    Type Description
    Uri
    | Improve this Doc View Source

    Guilds

    Gets a list of guilds that this client is in. Note that the guild objects in this list will not be filled in if the specific guilds aren't available (the GuildAvailable or GuildDownloadCompleted events haven't been fired yet)

    Declaration
    public override IReadOnlyDictionary<ulong, KuracordGuild> Guilds { get; }
    Property Value
    Type Description
    IReadOnlyDictionary<UInt64, KuracordGuild>
    Overrides
    BaseKuracordClient.Guilds
    | Improve this Doc View Source

    Ping

    Gets the WS latency for this client.

    Declaration
    public int Ping { get; }
    Property Value
    Type Description
    Int32

    Methods

    | Improve this Doc View Source

    ConnectAsync()

    Connects to the gateway

    Declaration
    public async Task ConnectAsync()
    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when an invalid token was provided.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    CreateGuildAsync(String, Optional<Stream>)

    Creates a guild.

    Declaration
    public Task<KuracordGuild> CreateGuildAsync(string name, Optional<Stream> icon = default(Optional<Stream>))
    Parameters
    Type Name Description
    String name

    Name of the guild.

    Optional<Stream> icon

    Stream containing the icon for the guild.

    Returns
    Type Description
    Task<KuracordGuild>

    The created guild.

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the guild does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    CreateTextChannelAsync(KuracordGuild, String)

    Creates a new text channel in the guild.

    Declaration
    public Task<KuracordChannel> CreateTextChannelAsync(KuracordGuild guild, string name)
    Parameters
    Type Name Description
    KuracordGuild guild

    The guild where create the channel.

    String name

    Name of the new channel.

    Returns
    Type Description
    Task<KuracordChannel>

    The newly-created channel.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the Administrator permission.

    NotFoundException

    Thrown when the guild does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    CreateTextChannelAsync(UInt64, String)

    Creates a new text channel in the guild.

    Declaration
    public Task<KuracordChannel> CreateTextChannelAsync(ulong guildId, string name)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild where create the channel.

    String name

    Name of the new channel.

    Returns
    Type Description
    Task<KuracordChannel>

    The newly-created channel.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the Administrator permission.

    NotFoundException

    Thrown when the guild does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    DeleteGuildAsync(KuracordGuild, String)

    Deletes the guild. Requires the caller to be the owner of the guild.

    Declaration
    public Task DeleteGuildAsync(KuracordGuild guild, string password)
    Parameters
    Type Name Description
    KuracordGuild guild

    The guild to delete.

    String password

    Your account password.

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client is not the owner of the guild.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    DeleteGuildAsync(UInt64, String)

    Deletes the guild. Requires the caller to be the owner of the guild.

    Declaration
    public Task DeleteGuildAsync(ulong guildId, string password)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild to delete.

    String password

    Your account password.

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client is not the owner of the guild.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    DeleteMessageAsync(KuracordChannel, UInt64)

    Deletes a message.

    Declaration
    public Task DeleteMessageAsync(KuracordChannel channel, ulong messageId)
    Parameters
    Type Name Description
    KuracordChannel channel

    The channel in where the required message to delete is located.

    UInt64 messageId

    ID of the message to be deleted.

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the Administrator permission.

    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    DeleteMessageAsync(KuracordMessage)

    Deletes a message.

    Declaration
    public Task DeleteMessageAsync(KuracordMessage message)
    Parameters
    Type Name Description
    KuracordMessage message

    The message to be deleted.

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the Administrator permission.

    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    DeleteMessageAsync(UInt64, UInt64, UInt64)

    Deletes a message.

    Declaration
    public Task DeleteMessageAsync(ulong guildId, ulong channelId, ulong messageId)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild where the required message to delete is located.

    UInt64 channelId

    ID of the channel in where the required message to delete is located.

    UInt64 messageId

    ID of the message to be deleted.

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the Administrator permission.

    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    DisableCurrentUserAsync()

    Disables current user. THIS ACTION CANNOT BE UNDONE.

    Declaration
    public Task DisableCurrentUserAsync()
    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    NotFoundException

    Thrown when the user does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    DisconnectAsync()

    Disconnects from the gateway

    Declaration
    public async Task DisconnectAsync()
    Returns
    Type Description
    Task
    | Improve this Doc View Source

    Dispose()

    Disposes your KuracordClient.

    Declaration
    public override void Dispose()
    Overrides
    BaseKuracordClient.Dispose()
    | Improve this Doc View Source

    EditMessageAsync(KuracordChannel, UInt64, String)

    Edits the message.

    Declaration
    public Task<KuracordMessage> EditMessageAsync(KuracordChannel channel, ulong messageId, string content)
    Parameters
    Type Name Description
    KuracordChannel channel

    The channel where the required message to edit is located.

    UInt64 messageId

    ID of the message to edit.

    String content

    New content.

    Returns
    Type Description
    Task<KuracordMessage>

    Edited message.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client tried to modify a message not sent by them.

    NotFoundException

    Thrown when the member does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    EditMessageAsync(KuracordMessage, String)

    Edits the message.

    Declaration
    public Task<KuracordMessage> EditMessageAsync(KuracordMessage message, string content)
    Parameters
    Type Name Description
    KuracordMessage message

    The message to edit.

    String content

    New content.

    Returns
    Type Description
    Task<KuracordMessage>

    Edited message.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client tried to modify a message not sent by them.

    NotFoundException

    Thrown when the member does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    EditMessageAsync(UInt64, UInt64, UInt64, String)

    Edits the message.

    Declaration
    public Task<KuracordMessage> EditMessageAsync(ulong guildId, ulong channelId, ulong messageId, string content)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild where the required message to edit is located.

    UInt64 channelId

    ID of the channel where the required message to edit is located.

    UInt64 messageId

    ID of the message to edit.

    String content

    New content.

    Returns
    Type Description
    Task<KuracordMessage>

    Edited message.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client tried to modify a message not sent by them.

    NotFoundException

    Thrown when the member does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    Finalize()

    Declaration
    protected void Finalize()
    | Improve this Doc View Source

    GetChannel(UInt64)

    Gets a channel from cache.

    Declaration
    public KuracordChannel GetChannel(ulong channelId)
    Parameters
    Type Name Description
    UInt64 channelId

    The ID of the channel to get.

    Returns
    Type Description
    KuracordChannel

    Requested channel. Will be null if it was not found in cache.

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    GetChannelAsync(KuracordGuild, UInt64)

    Gets a channel

    Declaration
    public Task<KuracordChannel> GetChannelAsync(KuracordGuild guild, ulong channelId)
    Parameters
    Type Name Description
    KuracordGuild guild

    The guild where the required channel is located.

    UInt64 channelId

    The ID of the channel to get.

    Returns
    Type Description
    Task<KuracordChannel>

    Requested channel.

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    GetChannelAsync(UInt64, UInt64)

    Gets a channel

    Declaration
    public Task<KuracordChannel> GetChannelAsync(ulong guildId, ulong channelId)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild where the required channel is located.

    UInt64 channelId

    The ID of the channel to get.

    Returns
    Type Description
    Task<KuracordChannel>

    Requested channel.

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    GetGuildAsync(UInt64)

    Gets a guild.

    Declaration
    public async Task<KuracordGuild> GetGuildAsync(ulong id)
    Parameters
    Type Name Description
    UInt64 id

    ID of the guild to get.

    Returns
    Type Description
    Task<KuracordGuild>

    The requested Guild.

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the guild does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    GetGuildMemberAsync(KuracordGuild, UInt64)

    Gets the guild member.

    Declaration
    public Task<KuracordMember> GetGuildMemberAsync(KuracordGuild guild, ulong memberId)
    Parameters
    Type Name Description
    KuracordGuild guild

    The guild to get the member.

    UInt64 memberId

    ID of the member to get.

    Returns
    Type Description
    Task<KuracordMember>

    Requested member.

    | Improve this Doc View Source

    GetGuildMemberAsync(UInt64, UInt64)

    Gets the guild member.

    Declaration
    public Task<KuracordMember> GetGuildMemberAsync(ulong guildId, ulong memberId)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild to get the member.

    UInt64 memberId

    ID of the member to get.

    Returns
    Type Description
    Task<KuracordMember>

    Requested member.

    | Improve this Doc View Source

    GetGuildMembersAsync(KuracordGuild)

    Gets the collection with the guild members.

    Declaration
    public Task<IReadOnlyList<KuracordMember>> GetGuildMembersAsync(KuracordGuild guild)
    Parameters
    Type Name Description
    KuracordGuild guild

    The guild to get the members.

    Returns
    Type Description
    Task<IReadOnlyList<KuracordMember>>

    Readonly list with the members of the guild

    | Improve this Doc View Source

    GetGuildMembersAsync(UInt64)

    Gets the collection with the guild members.

    Declaration
    public Task<IReadOnlyList<KuracordMember>> GetGuildMembersAsync(ulong guildId)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild to get the members.

    Returns
    Type Description
    Task<IReadOnlyList<KuracordMember>>

    Readonly list with the members of the guild

    | Improve this Doc View Source

    GetInviteInfoAsync(String)

    Gets an invite info.

    Declaration
    public Task<KuracordInviteGuild> GetInviteInfoAsync(string inviteCode)
    Parameters
    Type Name Description
    String inviteCode

    The invite code.

    Returns
    Type Description
    Task<KuracordInviteGuild>

    The requested Invite.

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the invite does not exists.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    GetMessageAsync(KuracordChannel, UInt64)

    Returns a specific message.

    Declaration
    public Task<KuracordMessage> GetMessageAsync(KuracordChannel channel, ulong messageId)
    Parameters
    Type Name Description
    KuracordChannel channel

    The channel where the required message is located.

    UInt64 messageId

    ID of the message to get.

    Returns
    Type Description
    Task<KuracordMessage>

    Requested message.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the ViewChannels permission.

    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    GetMessageAsync(UInt64, UInt64, UInt64)

    Returns a specific message.

    Declaration
    public Task<KuracordMessage> GetMessageAsync(ulong guildId, ulong channelId, ulong messageId)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild where the required message is located.

    UInt64 channelId

    ID of the channel where the required message is located.

    UInt64 messageId

    ID of the message to get.

    Returns
    Type Description
    Task<KuracordMessage>

    Requested message.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the ViewChannels permission.

    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    GetMessagesAsync(KuracordChannel, UInt32, Nullable<UInt64>)

    Returns a list of messages from the last message in the channel.

    Declaration
    public Task<IReadOnlyList<KuracordMessage>> GetMessagesAsync(KuracordChannel channel, uint limit = 30U, ulong? before = null)
    Parameters
    Type Name Description
    KuracordChannel channel

    The channel to get messages from.

    UInt32 limit
    Nullable<UInt64> before
    Returns
    Type Description
    Task<IReadOnlyList<KuracordMessage>>

    A list of messages from the last message in the channel.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the ViewChannels permission.

    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    GetMessagesAsync(UInt64, UInt64, UInt32, Nullable<UInt64>)

    Returns a list of messages from the last message in the channel.

    ID of the channel to get messages from.
    Declaration
    public Task<IReadOnlyList<KuracordMessage>> GetMessagesAsync(ulong guildId, ulong channelId, uint limit = 30U, ulong? before = null)
    Parameters
    Type Name Description
    UInt64 guildId
    UInt64 channelId
    UInt32 limit
    Nullable<UInt64> before
    Returns
    Type Description
    Task<IReadOnlyList<KuracordMessage>>
    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the ViewChannels permission.

    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    GetUserAsync(UInt64)

    Gets a user.

    Declaration
    public async Task<KuracordUser> GetUserAsync(ulong userId)
    Parameters
    Type Name Description
    UInt64 userId

    ID of the user

    Returns
    Type Description
    Task<KuracordUser>

    User

    Exceptions
    Type Condition
    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    GetUserTokenAsync(String, String)

    Gets the user's token.

    Declaration
    public Task<string> GetUserTokenAsync(string email, string password)
    Parameters
    Type Name Description
    String email

    Email of the user's account.

    String password

    Password of the user's account.

    Returns
    Type Description
    Task<String>

    Token string.

    | Improve this Doc View Source

    JoinGuildAsync(String)

    Joins a guild.

    Declaration
    public Task<KuracordGuild> JoinGuildAsync(string inviteCode)
    Parameters
    Type Name Description
    String inviteCode

    The invite code to the guild to join.

    Returns
    Type Description
    Task<KuracordGuild>

    The requested guild.

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the guild does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    ModifyChannelAsync(KuracordChannel, String)

    Modifies a channel.

    Declaration
    public Task<KuracordChannel> ModifyChannelAsync(KuracordChannel channel, string name)
    Parameters
    Type Name Description
    KuracordChannel channel

    The channel to modify.

    String name

    New channel name.

    Returns
    Type Description
    Task<KuracordChannel>

    Modified channel.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the Administrator permission.

    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    ModifyChannelAsync(KuracordGuild, UInt64, String)

    Modifies a channel.

    Declaration
    public Task<KuracordChannel> ModifyChannelAsync(KuracordGuild guild, ulong channelId, string name)
    Parameters
    Type Name Description
    KuracordGuild guild

    The guild where the channel to modify is located.

    UInt64 channelId

    ID of the channel to modify.

    String name

    New channel name.

    Returns
    Type Description
    Task<KuracordChannel>

    Modified channel.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the Administrator permission.

    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    ModifyChannelAsync(UInt64, UInt64, String)

    Modifies a channel.

    Declaration
    public Task<KuracordChannel> ModifyChannelAsync(ulong guildId, ulong channelId, string name)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild where the channel to modify is located.

    UInt64 channelId

    ID of the channel to modify.

    String name

    New channel name.

    Returns
    Type Description
    Task<KuracordChannel>

    Modified channel.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the Administrator permission.

    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    ModifyGuildAsync(KuracordGuild, String)

    Modifies a guild.

    Declaration
    public Task<KuracordGuild> ModifyGuildAsync(KuracordGuild guild, string name)
    Parameters
    Type Name Description
    KuracordGuild guild

    The guild to modify.

    String name

    New guild name.

    Returns
    Type Description
    Task<KuracordGuild>

    Modified guild.

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the guild does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    ModifyGuildAsync(UInt64, String)

    Modifies a guild.

    Declaration
    public Task<KuracordGuild> ModifyGuildAsync(ulong guildId, string name)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild to modify.

    String name

    New guild name.

    Returns
    Type Description
    Task<KuracordGuild>

    Modified guild.

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the guild does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    ModifyGuildMemberAsync(KuracordGuild, KuracordMember, String)

    Modifies the member.

    Declaration
    public Task<KuracordMember> ModifyGuildMemberAsync(KuracordGuild guild, KuracordMember member, string nickname)
    Parameters
    Type Name Description
    KuracordGuild guild

    The guild where the required member to modify is located.

    KuracordMember member

    The member to modify.

    String nickname

    New member nickname.

    Returns
    Type Description
    Task<KuracordMember>

    Modified member.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the Administrator permission.

    NotFoundException

    Thrown when the member does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    ModifyGuildMemberAsync(KuracordGuild, UInt64, String)

    Modifies the member.

    Declaration
    public Task<KuracordMember> ModifyGuildMemberAsync(KuracordGuild guild, ulong memberId, string nickname)
    Parameters
    Type Name Description
    KuracordGuild guild

    The guild where the required member to modify is located.

    UInt64 memberId

    ID of the member to modify.

    String nickname

    New member nickname.

    Returns
    Type Description
    Task<KuracordMember>

    Modified member.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the Administrator permission.

    NotFoundException

    Thrown when the member does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    ModifyGuildMemberAsync(UInt64, KuracordMember, String)

    Modifies the member.

    Declaration
    public Task<KuracordMember> ModifyGuildMemberAsync(ulong guildId, KuracordMember member, string nickname)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild where the required member to modify is located.

    KuracordMember member

    The member to modify.

    String nickname

    New member nickname.

    Returns
    Type Description
    Task<KuracordMember>

    Modified member.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the Administrator permission.

    NotFoundException

    Thrown when the member does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    ModifyGuildMemberAsync(UInt64, UInt64, String)

    Modifies the member.

    Declaration
    public Task<KuracordMember> ModifyGuildMemberAsync(ulong guildId, ulong memberId, string nickname)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild where the required member to modify is located.

    UInt64 memberId

    ID of the member to modify.

    String nickname

    New member nickname.

    Returns
    Type Description
    Task<KuracordMember>

    Modified member.

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the Administrator permission.

    NotFoundException

    Thrown when the member does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    ReconnectAsync(Boolean)

    Declaration
    public Task ReconnectAsync(bool startNewSession = false)
    Parameters
    Type Name Description
    Boolean startNewSession
    Returns
    Type Description
    Task
    | Improve this Doc View Source

    RegisterUserAsync(String, String, String, Boolean)

    Registers a new user.

    Declaration
    public async Task<KuracordUser> RegisterUserAsync(string username, string email, string password, bool updateCache = false)
    Parameters
    Type Name Description
    String username

    Username for the new user.

    String email

    Email for the new user.

    String password

    Password for the new user.

    Boolean updateCache

    Should the client adds this user to the cache or not. Defaults to false.

    Returns
    Type Description
    Task<KuracordUser>

    User with it's token.

    | Improve this Doc View Source

    SendMessageAsync(KuracordChannel, String)

    Sends a message.

    Declaration
    public Task<KuracordMessage> SendMessageAsync(KuracordChannel channel, string content)
    Parameters
    Type Name Description
    KuracordChannel channel

    Channel to send to.

    String content

    Message content to send.

    Returns
    Type Description
    Task<KuracordMessage>

    The Kuracord Message that was sent.

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    SendMessageAsync(UInt64, UInt64, String)

    Sends a message.

    Declaration
    public Task<KuracordMessage> SendMessageAsync(ulong guildId, ulong channelId, string content)
    Parameters
    Type Name Description
    UInt64 guildId

    ID of the guild where the channel to send to is located.

    UInt64 channelId

    ID of the channel to send to.

    String content

    Message content to send.

    Returns
    Type Description
    Task<KuracordMessage>

    The Kuracord Message that was sent.

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the channel does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    | Improve this Doc View Source

    UpdateCurrentUserAsync(String, String)

    Edits current user.

    Declaration
    public Task<KuracordUser> UpdateCurrentUserAsync(string username, string discriminator = null)
    Parameters
    Type Name Description
    String username

    New username.

    String discriminator

    New discriminator.

    Returns
    Type Description
    Task<KuracordUser>

    Updated user.

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the user does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Kuracord is unable to process the request.

    Events

    | Improve this Doc View Source

    ChannelCreated

    Fired when a new channel is created.

    Declaration
    public event AsyncEventHandler<KuracordClient, ChannelCreateEventArgs> ChannelCreated
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, ChannelCreateEventArgs>
    | Improve this Doc View Source

    ChannelDeleted

    Fired when a channel is deleted.

    Declaration
    public event AsyncEventHandler<KuracordClient, ChannelDeleteEventArgs> ChannelDeleted
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, ChannelDeleteEventArgs>
    | Improve this Doc View Source

    ChannelUpdated

    Fired when a channel is updated.

    Declaration
    public event AsyncEventHandler<KuracordClient, ChannelUpdateEventArgs> ChannelUpdated
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, ChannelUpdateEventArgs>
    | Improve this Doc View Source

    ClientErrored

    Fired whenever an error occurs within an event handler.

    Declaration
    public event AsyncEventHandler<KuracordClient, ClientErrorEventArgs> ClientErrored
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, ClientErrorEventArgs>
    | Improve this Doc View Source

    GuildAvailable

    Fired when a guild is becoming available.

    Declaration
    public event AsyncEventHandler<KuracordClient, GuildCreateEventArgs> GuildAvailable
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, GuildCreateEventArgs>
    | Improve this Doc View Source

    GuildCreated

    Fired when the user joins a new guild.

    Declaration
    public event AsyncEventHandler<KuracordClient, GuildCreateEventArgs> GuildCreated
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, GuildCreateEventArgs>
    | Improve this Doc View Source

    GuildDeleted

    Fired when the guild was deleted.

    Declaration
    public event AsyncEventHandler<KuracordClient, GuildDeleteEventArgs> GuildDeleted
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, GuildDeleteEventArgs>
    | Improve this Doc View Source

    GuildDownloadCompleted

    Fired when all guilds finish streaming from Kuracord.

    Declaration
    public event AsyncEventHandler<KuracordClient, GuildDownloadCompletedEventArgs> GuildDownloadCompleted
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, GuildDownloadCompletedEventArgs>
    | Improve this Doc View Source

    GuildUpdated

    Fired when a guild is updated.

    Declaration
    public event AsyncEventHandler<KuracordClient, GuildUpdateEventArgs> GuildUpdated
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, GuildUpdateEventArgs>
    | Improve this Doc View Source

    Heartbeated

    Fired on received heartbeat ACK.

    Declaration
    public event AsyncEventHandler<KuracordClient, HeartbeatEventArgs> Heartbeated
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, HeartbeatEventArgs>
    | Improve this Doc View Source

    MemberJoined

    Fired when a new user joins a guild.

    Declaration
    public event AsyncEventHandler<KuracordClient, MemberJoinedEventArgs> MemberJoined
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, MemberJoinedEventArgs>
    | Improve this Doc View Source

    MemberLeave

    Fired when a user is removed from a guild (leave/kick/ban).

    Declaration
    public event AsyncEventHandler<KuracordClient, MemberLeaveEventArgs> MemberLeave
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, MemberLeaveEventArgs>
    | Improve this Doc View Source

    MemberUpdated

    Fired when a guild member is updated.

    Declaration
    public event AsyncEventHandler<KuracordClient, MemberUpdatedEventArgs> MemberUpdated
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, MemberUpdatedEventArgs>
    | Improve this Doc View Source

    MessageCreated

    Fired when a message is created.

    Declaration
    public event AsyncEventHandler<KuracordClient, MessageCreateEventArgs> MessageCreated
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, MessageCreateEventArgs>
    | Improve this Doc View Source

    MessageDeleted

    Fired when a message is deleted.

    Declaration
    public event AsyncEventHandler<KuracordClient, MessageDeleteEventArgs> MessageDeleted
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, MessageDeleteEventArgs>
    | Improve this Doc View Source

    MessageUpdated

    Fired when a message is updated.

    Declaration
    public event AsyncEventHandler<KuracordClient, MessageUpdateEventArgs> MessageUpdated
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, MessageUpdateEventArgs>
    | Improve this Doc View Source

    Ready

    Fired when this client has successfully completed its handshake with the websocket gateway.

    Declaration
    public event AsyncEventHandler<KuracordClient, ReadyEventArgs> Ready
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, ReadyEventArgs>
    Remarks

    Guilds will not be populated when this event is fired.
    See also: GuildAvailable, GuildDownloadCompleted

    | Improve this Doc View Source

    Resumed

    Fired whenever a session is resumed.

    Declaration
    public event AsyncEventHandler<KuracordClient, ReadyEventArgs> Resumed
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, ReadyEventArgs>
    | Improve this Doc View Source

    SocketClosed

    Fired whenever WebSocket connection is terminated.

    Declaration
    public event AsyncEventHandler<KuracordClient, SocketCloseEventArgs> SocketClosed
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, SocketCloseEventArgs>
    | Improve this Doc View Source

    SocketErrored

    Fired whenever a WebSocket error occurs within the client.

    Declaration
    public event AsyncEventHandler<KuracordClient, SocketErrorEventArgs> SocketErrored
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, SocketErrorEventArgs>
    | Improve this Doc View Source

    SocketOpened

    Fired whenever WebSocket connection is established.

    Declaration
    public event AsyncEventHandler<KuracordClient, SocketEventArgs> SocketOpened
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, SocketEventArgs>
    | Improve this Doc View Source

    UnknownEvent

    Fired when an unknown event gets received.

    Declaration
    public event AsyncEventHandler<KuracordClient, UnknownEventArgs> UnknownEvent
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, UnknownEventArgs>
    | Improve this Doc View Source

    UserUpdated

    Fired when properties about the user change.

    Declaration
    public event AsyncEventHandler<KuracordClient, UserUpdateEventArgs> UserUpdated
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, UserUpdateEventArgs>
    | Improve this Doc View Source

    Zombied

    Fired on heartbeat attempt cancellation due to too many failed heartbeats.

    Declaration
    public event AsyncEventHandler<KuracordClient, ZombiedEventArgs> Zombied
    Event Type
    Type Description
    AsyncEventHandler<KuracordClient, ZombiedEventArgs>
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2023 KSharpPlus Contributors