Class KuracordChannel
Implements
Inherited Members
Namespace: KSharpPlus.Entities.Channel
Assembly: KSharpPlus.dll
Syntax
public class KuracordChannel : SnowflakeObject
Properties
| Improve this Doc View SourceGuild
Gets the guild to which this channel belongs.
Declaration
public KuracordGuild Guild { get; }
Property Value
Type | Description |
---|---|
KuracordGuild |
GuildId
Gets ID of the guild to which this channel belongs.
Declaration
public ulong? GuildId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> |
Mention
Gets this channel's mention string.
Declaration
public string Mention { get; }
Property Value
Type | Description |
---|---|
String |
Name
Gets the name of this channel.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
Type
Gets the type of this channel.
Declaration
public ChannelType Type { get; }
Property Value
Type | Description |
---|---|
ChannelType |
Methods
| Improve this Doc View SourceCloneAsync()
Clones this channel. This operation will create a channel with identical settings to this one. Note that this will not copy messages.
Declaration
public Task<KuracordChannel> CloneAsync()
Returns
Type | Description |
---|---|
Task<KuracordChannel> | Newly-created 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. |
DeleteAsync()
Deletes a channel.
Declaration
public Task DeleteAsync()
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)
Deletes a message.
Declaration
public Task DeleteMessageAsync(ulong messageId)
Parameters
Type | Name | Description |
---|---|---|
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. |
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, String)
Edits the message.
Declaration
public Task<KuracordMessage> EditMessageAsync(ulong messageId, string content)
Parameters
Type | Name | Description |
---|---|---|
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. |
Equals(KuracordChannel)
Checks whether this KuracordChannel is equal to another KuracordChannel.
Declaration
public bool Equals(KuracordChannel e)
Parameters
Type | Name | Description |
---|---|---|
KuracordChannel | e | KuracordChannel to compare to. |
Returns
Type | Description |
---|---|
Boolean | Whether the KuracordChannel is equal to this KuracordChannel. |
Equals(Object)
Checks whether this KuracordChannel is equal to another object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | Object to compare to. |
Returns
Type | Description |
---|---|
Boolean | Whether the object is equal to this KuracordChannel. |
Overrides
| Improve this Doc View SourceGetHashCode()
Gets the hash code for this KuracordChannel.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | The hash code for this KuracordChannel. |
Overrides
| Improve this Doc View SourceGetMessageAsync(UInt64, Boolean)
Returns a specific message.
Declaration
public async Task<KuracordMessage> GetMessageAsync(ulong messageId, bool skipCache = false)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | messageId | ID of the message to get. |
Boolean | skipCache | Whether to always make a REST request. |
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(UInt32, Nullable<UInt64>)
Returns a list of messages from the last message in the channel.
Declaration
public Task<IReadOnlyList<KuracordMessage>> GetMessagesAsync(uint limit = 30U, ulong? before = null)
Parameters
Type | Name | Description |
---|---|---|
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. |
ModifyAsync(String)
Modifies a channel.
Declaration
public Task<KuracordChannel> ModifyAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
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. |
SendMessageAsync(String)
Sends a message.
Declaration
public Task<KuracordMessage> SendMessageAsync(string content)
Parameters
Type | Name | Description |
---|---|---|
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. |
ToString()
Returns a string representation of this channel.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | String representation of this channel. |
Overrides
Operators
| Improve this Doc View SourceEquality(KuracordChannel, KuracordChannel)
Gets whether the two KuracordChannel objects are equal.
Declaration
public static bool operator ==(KuracordChannel e1, KuracordChannel e2)
Parameters
Type | Name | Description |
---|---|---|
KuracordChannel | e1 | First channel to compare. |
KuracordChannel | e2 | Second channel to compare. |
Returns
Type | Description |
---|---|
Boolean | Whether the two channels are equal. |
Inequality(KuracordChannel, KuracordChannel)
Gets whether the two KuracordChannel objects are not equal.
Declaration
public static bool operator !=(KuracordChannel e1, KuracordChannel e2)
Parameters
Type | Name | Description |
---|---|---|
KuracordChannel | e1 | First channel to compare. |
KuracordChannel | e2 | Second channel to compare. |
Returns
Type | Description |
---|---|
Boolean | Whether the two channels are not equal. |