Class KuracordClient
Inherited Members
Namespace: KSharpPlus.Clients
Assembly: KSharpPlus.dll
Syntax
public sealed class KuracordClient : BaseKuracordClient
Constructors
| Improve this Doc View SourceKuracordClient(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 SourceGatewayUri
Declaration
public static Uri GatewayUri { get; }
Property Value
| Type | Description |
|---|---|
| Uri |
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
| Improve this Doc View SourcePing
Gets the WS latency for this client.
Declaration
public int Ping { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
| Improve this Doc View SourceConnectAsync()
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
DisconnectAsync()
Disconnects from the gateway
Declaration
public async Task DisconnectAsync()
Returns
| Type | Description |
|---|---|
| Task |
Dispose()
Disposes your KuracordClient.
Declaration
public override void Dispose()
Overrides
| Improve this Doc View SourceEditMessageAsync(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. |
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. |
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. |
Finalize()
Declaration
protected void Finalize()
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. |
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. |
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. |
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. |
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. |
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. |
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 |
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 |
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. |
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. |
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. |
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. |
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. |
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. |
GetUserTokenAsync(String, String)
Gets the user's token.
Declaration
public Task<string> GetUserTokenAsync(string email, string password)
Parameters
| Type | Name | Description |
|---|---|---|
| String | Email of the user's account. |
|
| String | password | Password of the user's account. |
Returns
| Type | Description |
|---|---|
| Task<String> | Token string. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
ReconnectAsync(Boolean)
Declaration
public Task ReconnectAsync(bool startNewSession = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | startNewSession |
Returns
| Type | Description |
|---|---|
| Task |
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 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. |
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. |
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. |
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 SourceChannelCreated
Fired when a new channel is created.
Declaration
public event AsyncEventHandler<KuracordClient, ChannelCreateEventArgs> ChannelCreated
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, ChannelCreateEventArgs> |
ChannelDeleted
Fired when a channel is deleted.
Declaration
public event AsyncEventHandler<KuracordClient, ChannelDeleteEventArgs> ChannelDeleted
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, ChannelDeleteEventArgs> |
ChannelUpdated
Fired when a channel is updated.
Declaration
public event AsyncEventHandler<KuracordClient, ChannelUpdateEventArgs> ChannelUpdated
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, ChannelUpdateEventArgs> |
ClientErrored
Fired whenever an error occurs within an event handler.
Declaration
public event AsyncEventHandler<KuracordClient, ClientErrorEventArgs> ClientErrored
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, ClientErrorEventArgs> |
GuildAvailable
Fired when a guild is becoming available.
Declaration
public event AsyncEventHandler<KuracordClient, GuildCreateEventArgs> GuildAvailable
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, GuildCreateEventArgs> |
GuildCreated
Fired when the user joins a new guild.
Declaration
public event AsyncEventHandler<KuracordClient, GuildCreateEventArgs> GuildCreated
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, GuildCreateEventArgs> |
GuildDeleted
Fired when the guild was deleted.
Declaration
public event AsyncEventHandler<KuracordClient, GuildDeleteEventArgs> GuildDeleted
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, GuildDeleteEventArgs> |
GuildDownloadCompleted
Fired when all guilds finish streaming from Kuracord.
Declaration
public event AsyncEventHandler<KuracordClient, GuildDownloadCompletedEventArgs> GuildDownloadCompleted
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, GuildDownloadCompletedEventArgs> |
GuildUpdated
Fired when a guild is updated.
Declaration
public event AsyncEventHandler<KuracordClient, GuildUpdateEventArgs> GuildUpdated
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, GuildUpdateEventArgs> |
Heartbeated
Fired on received heartbeat ACK.
Declaration
public event AsyncEventHandler<KuracordClient, HeartbeatEventArgs> Heartbeated
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, HeartbeatEventArgs> |
MemberJoined
Fired when a new user joins a guild.
Declaration
public event AsyncEventHandler<KuracordClient, MemberJoinedEventArgs> MemberJoined
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, MemberJoinedEventArgs> |
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> |
MemberUpdated
Fired when a guild member is updated.
Declaration
public event AsyncEventHandler<KuracordClient, MemberUpdatedEventArgs> MemberUpdated
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, MemberUpdatedEventArgs> |
MessageCreated
Fired when a message is created.
Declaration
public event AsyncEventHandler<KuracordClient, MessageCreateEventArgs> MessageCreated
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, MessageCreateEventArgs> |
MessageDeleted
Fired when a message is deleted.
Declaration
public event AsyncEventHandler<KuracordClient, MessageDeleteEventArgs> MessageDeleted
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, MessageDeleteEventArgs> |
MessageUpdated
Fired when a message is updated.
Declaration
public event AsyncEventHandler<KuracordClient, MessageUpdateEventArgs> MessageUpdated
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, MessageUpdateEventArgs> |
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
Resumed
Fired whenever a session is resumed.
Declaration
public event AsyncEventHandler<KuracordClient, ReadyEventArgs> Resumed
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, ReadyEventArgs> |
SocketClosed
Fired whenever WebSocket connection is terminated.
Declaration
public event AsyncEventHandler<KuracordClient, SocketCloseEventArgs> SocketClosed
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, SocketCloseEventArgs> |
SocketErrored
Fired whenever a WebSocket error occurs within the client.
Declaration
public event AsyncEventHandler<KuracordClient, SocketErrorEventArgs> SocketErrored
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, SocketErrorEventArgs> |
SocketOpened
Fired whenever WebSocket connection is established.
Declaration
public event AsyncEventHandler<KuracordClient, SocketEventArgs> SocketOpened
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, SocketEventArgs> |
UnknownEvent
Fired when an unknown event gets received.
Declaration
public event AsyncEventHandler<KuracordClient, UnknownEventArgs> UnknownEvent
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, UnknownEventArgs> |
UserUpdated
Fired when properties about the user change.
Declaration
public event AsyncEventHandler<KuracordClient, UserUpdateEventArgs> UserUpdated
Event Type
| Type | Description |
|---|---|
| AsyncEventHandler<KuracordClient, UserUpdateEventArgs> |
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> |