Class DiscordFollowupMessageBuilder
Constructs a followup message to an interaction.
Inheritance
Namespace: DisCatSharp.Entities
Assembly: DisCatSharp.dll
Syntax
public sealed class DiscordFollowupMessageBuilder
Properties
| Improve this Doc View SourceComponents
Components to send on this followup message.
Declaration
public IReadOnlyList<DiscordActionRowComponent> Components { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<DiscordActionRowComponent> |
Content
Message to send on followup message.
Declaration
public string Content { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Embeds
Embeds to send on followup message.
Declaration
public IReadOnlyList<DiscordEmbed> Embeds { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<DiscordEmbed> |
Files
Files to send on this followup message.
Declaration
public IReadOnlyList<DiscordMessageFile> Files { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<DiscordMessageFile> |
IsEphemeral
Whether this followup message should be ephemeral.
Declaration
public bool IsEphemeral { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsTts
Whether this followup message is text-to-speech.
Declaration
public bool IsTts { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Mentions
Mentions to send on this followup message.
Declaration
public IReadOnlyList<IMention> Mentions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<IMention> |
Methods
| Improve this Doc View SourceAddComponents(DiscordComponent[])
Appends a collection of components to the message.
Declaration
public DiscordFollowupMessageBuilder AddComponents(params DiscordComponent[] components)
Parameters
Type | Name | Description |
---|---|---|
DiscordComponent[] | components | The collection of components to add. |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder | The builder to chain calls with. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
AddComponents(IEnumerable<DiscordActionRowComponent>)
Appends several rows of components to the message
Declaration
public DiscordFollowupMessageBuilder AddComponents(IEnumerable<DiscordActionRowComponent> components)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<DiscordActionRowComponent> | components | The rows of components to add, holding up to five each. |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder |
AddComponents(IEnumerable<DiscordComponent>)
Appends a collection of components to the message.
Declaration
public DiscordFollowupMessageBuilder AddComponents(IEnumerable<DiscordComponent> components)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<DiscordComponent> | components | The collection of components to add. |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder | The builder to chain calls with. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
AddEmbed(DiscordEmbed)
Adds an embed to the followup message.
Declaration
public DiscordFollowupMessageBuilder AddEmbed(DiscordEmbed embed)
Parameters
Type | Name | Description |
---|---|---|
DiscordEmbed | embed | Embed to add. |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder | The builder to chain calls with. |
AddEmbeds(IEnumerable<DiscordEmbed>)
Adds the given embeds to the followup message.
Declaration
public DiscordFollowupMessageBuilder AddEmbeds(IEnumerable<DiscordEmbed> embeds)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<DiscordEmbed> | embeds | Embeds to add. |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder | The builder to chain calls with. |
AddFile(FileStream, Boolean, String)
Sets if the message has files to be sent.
Declaration
public DiscordFollowupMessageBuilder AddFile(FileStream stream, bool resetStreamPosition = false, string description = null)
Parameters
Type | Name | Description |
---|---|---|
System.IO.FileStream | stream | The Stream to the file. |
System.Boolean | resetStreamPosition | Tells the API Client to reset the stream position to what it was after the file is sent. |
System.String | description | Description of the file. |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder | The builder to chain calls with. |
AddFile(String, Stream, Boolean, String)
Adds a file to the followup message.
Declaration
public DiscordFollowupMessageBuilder AddFile(string filename, Stream data, bool resetStreamPosition = false, string description = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename | Name of the file. |
System.IO.Stream | data | File data. |
System.Boolean | resetStreamPosition | Tells the API Client to reset the stream position to what it was after the file is sent. |
System.String | description | Description of the file. |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder | The builder to chain calls with. |
AddFiles(Dictionary<String, Stream>, Boolean)
Adds the given files to the followup message.
Declaration
public DiscordFollowupMessageBuilder AddFiles(Dictionary<string, Stream> files, bool resetStreamPosition = false)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.IO.Stream> | files | Dictionary of file name and file data. |
System.Boolean | resetStreamPosition | Tells the API Client to reset the stream position to what it was after the file is sent. |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder | The builder to chain calls with. |
AddMention(IMention)
Adds the mention to the mentions to parse, etc. with the followup message.
Declaration
public DiscordFollowupMessageBuilder AddMention(IMention mention)
Parameters
Type | Name | Description |
---|---|---|
IMention | mention | Mention to add. |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder | The builder to chain calls with. |
AddMentions(IEnumerable<IMention>)
Adds the mentions to the mentions to parse, etc. with the followup message.
Declaration
public DiscordFollowupMessageBuilder AddMentions(IEnumerable<IMention> mentions)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IMention> | mentions | Mentions to add. |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder | The builder to chain calls with. |
AsEphemeral(Boolean)
Sets the followup message to be ephemeral.
Declaration
public DiscordFollowupMessageBuilder AsEphemeral(bool ephemeral = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | ephemeral | Whether the followup should be ephemeral. Defaults to true. |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder |
Clear()
Allows for clearing the Followup Message builder so that it can be used again to send a new message.
Declaration
public void Clear()
ClearComponents()
Clears all message components on this builder.
Declaration
public void ClearComponents()
WithContent(String)
Sets the message to send with the followup message..
Declaration
public DiscordFollowupMessageBuilder WithContent(string content)
Parameters
Type | Name | Description |
---|---|---|
System.String | content | Message to send. |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder | The builder to chain calls with. |
WithTts(Boolean)
Indicates if the followup message must use text-to-speech.
Declaration
public DiscordFollowupMessageBuilder WithTts(bool tts)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | tts | Text-to-speech |
Returns
Type | Description |
---|---|
DiscordFollowupMessageBuilder | The builder to chain calls with. |