Class KuracordMessage
Represents a Kuracord text message.
Implements
Inherited Members
Namespace: KSharpPlus.Entities.Channel.Message
Assembly: KSharpPlus.dll
Syntax
public class KuracordMessage : SnowflakeObjectProperties
| Improve this Doc View SourceAttachments
Gets files attached to this message.
Declaration
public IReadOnlyList<KuracordAttachment> Attachments { get; }Property Value
| Type | Description | 
|---|---|
| IReadOnlyList<KuracordAttachment> | 
Author
Gets the user that sent the message.
Declaration
public KuracordUser Author { get; }Property Value
| Type | Description | 
|---|---|
| KuracordUser | 
Channel
Gets the channel in which the message was sent.
Declaration
public KuracordChannel Channel { get; }Property Value
| Type | Description | 
|---|---|
| KuracordChannel | 
ChannelId
Gets the ID of the channel in which the message was sent.
Declaration
public ulong ChannelId { get; }Property Value
| Type | Description | 
|---|---|
| UInt64 | 
Content
Gets the message's content.
Declaration
public string Content { get; }Property Value
| Type | Description | 
|---|---|
| String | 
EditedTimestamp
Gets the message's edit timestamp. Will be null if the message was not edited.
Declaration
public DateTimeOffset? EditedTimestamp { get; }Property Value
| Type | Description | 
|---|---|
| Nullable<DateTimeOffset> | 
Guild
Gets the guild in which the message was sent.
Declaration
public KuracordGuild Guild { get; }Property Value
| Type | Description | 
|---|---|
| KuracordGuild | 
IsEdited
Gets whether this message was edited.
Declaration
public bool IsEdited { get; }Property Value
| Type | Description | 
|---|---|
| Boolean | 
Member
Gets the member that sent the message.
Declaration
public KuracordMember Member { get; }Property Value
| Type | Description | 
|---|---|
| KuracordMember | 
Methods
| Improve this Doc View SourceDeleteAsync()
Deletes a message.
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. | 
Equals(KuracordMessage)
Checks whether this KuracordMessage is equal to another KuracordMessage.
Declaration
public bool Equals(KuracordMessage e)Parameters
| Type | Name | Description | 
|---|---|---|
| KuracordMessage | e | KuracordMessage to compare to. | 
Returns
| Type | Description | 
|---|---|
| Boolean | Whether the KuracordMessage is equal to this KuracordMessage. | 
Equals(Object)
Checks whether this KuracordMessage 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 KuracordMessage. | 
Overrides
| Improve this Doc View SourceGetHashCode()
Gets the hash code for this KuracordMessage.
Declaration
public override int GetHashCode()Returns
| Type | Description | 
|---|---|
| Int32 | The hash code for this KuracordMessage. | 
Overrides
| Improve this Doc View SourceModifyAsync(String)
Edits the message.
Declaration
public Task<KuracordMessage> ModifyAsync(string content)Parameters
| Type | Name | Description | 
|---|---|---|
| String | content | New content. | 
Returns
| Type | Description | 
|---|---|
| Task<KuracordMessage> | Modified 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. | 
ToString()
Returns a string representation of this message.
Declaration
public override string ToString()Returns
| Type | Description | 
|---|---|
| String | String representation of this message. | 
Overrides
Operators
| Improve this Doc View SourceEquality(KuracordMessage, KuracordMessage)
Gets whether the two KuracordMessage objects are equal.
Declaration
public static bool operator ==(KuracordMessage e1, KuracordMessage e2)Parameters
| Type | Name | Description | 
|---|---|---|
| KuracordMessage | e1 | First message to compare. | 
| KuracordMessage | e2 | Second message to compare. | 
Returns
| Type | Description | 
|---|---|
| Boolean | Whether the two messages are equal. | 
Inequality(KuracordMessage, KuracordMessage)
Gets whether the two KuracordMessage objects are not equal.
Declaration
public static bool operator !=(KuracordMessage e1, KuracordMessage e2)Parameters
| Type | Name | Description | 
|---|---|---|
| KuracordMessage | e1 | First message to compare. | 
| KuracordMessage | e2 | Second message to compare. | 
Returns
| Type | Description | 
|---|---|
| Boolean | Whether the two messages are not equal. |