Show / Hide Table of Contents

Class DiscordMessage

A DiscordMessage object contains all the information about the message that got sent. This is used to edit messages sent by the Webhook class.

Inheritance
System.Object
DiscordMessage
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Dishooks
Assembly: cs.temp.dll.dll
Syntax
public class DiscordMessage

Properties

Attachments

An array of up to 10 DiscordAttachment objects. This will only be present if the message contains attachments. Keep in mind that the structure will be different from the one used in your own webhooks (see ).

Declaration
public DiscordAttachment[] Attachments { get; }
Property Value
Type Description
DiscordAttachment[]

Author

The author of the message.

Declaration
public DiscordAuthor Author { get; }
Property Value
Type Description
DiscordAuthor

Content

The content of the message. This will be null if the message only contains embeds.

Declaration
public string Content { get; }
Property Value
Type Description
System.String

EditedTimestamp

The edit timestamp of the message. If the message has not been edited, this will be null.

Declaration
public DateTime? EditedTimestamp { get; }
Property Value
Type Description
System.Nullable<DateTime>

Embeds

An array of up to 10 objects.

Declaration
public Embed[] Embeds { get; }
Property Value
Type Description
Embed[]

Id

The ID of the message that got sent.

Declaration
public string Id { get; }
Property Value
Type Description
System.String

Pinned

Whether or not the message is pinned. Messages can not be pinned by webhooks, so this will only be true if a server member or bot pinned the message.

Declaration
public bool Pinned { get; }
Property Value
Type Description
System.Boolean

Timestamp

The timestamp of the message.

Declaration
public DateTime Timestamp { get; }
Property Value
Type Description
DateTime

Uri

The URL this message got posted to.

Declaration
public Uri Uri { get; set; }
Property Value
Type Description
Uri

Methods

Delete(Nullable<Action<DiscordError>>)

Deletes the message from Discord.

Declaration
public void Delete(Action<DiscordError>? callback = null)
Parameters
Type Name Description
System.Nullable<Action<DiscordError>> callback

Edit(Webhook, Nullable<Action<DiscordError, DiscordMessage>>)

Edits the message on Discord. Calling this method will change the message on Discord to the values of the webhook.

Declaration
public void Edit(Webhook webhook, Action<DiscordError, DiscordMessage>? callback = null)
Parameters
Type Name Description
Webhook webhook

The webhook to edit this message to. The URL of this webhook will be ignored.

System.Nullable<Action<DiscordError, DiscordMessage>> callback

The (optional) callback to call when the message has been edited.

In This Article
Back to top Generated by DocFX