Class InteractivityExtension
Extension class for DSharpPlus.Interactivity
Inherited Members
Namespace: DSharpPlus.Interactivity
Assembly: cs.temp.dll.dll
Syntax
public class InteractivityExtension : BaseExtension
Methods
CollectEventArgsAsync<T>(Func<T, Boolean>, Nullable<TimeSpan>)
Declaration
public Task<ReadOnlyCollection<T>> CollectEventArgsAsync<T>(Func<T, bool> predicate, TimeSpan? timeoutoverride = default(TimeSpan? ))
where T : AsyncEventArgs
Parameters
Type | Name | Description |
---|---|---|
Func<T, System.Boolean> | predicate | |
System.Nullable<TimeSpan> | timeoutoverride |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ReadOnlyCollection<T>> |
Type Parameters
Name | Description |
---|---|
T |
CollectReactionsAsync(DiscordMessage, Nullable<TimeSpan>)
Collects reactions on a specific message.
Declaration
public Task<ReadOnlyCollection<Reaction>> CollectReactionsAsync(DiscordMessage m, TimeSpan? timeoutoverride = default(TimeSpan? ))
Parameters
Type | Name | Description |
---|---|---|
DiscordMessage | m | Message to collect reactions on. |
System.Nullable<TimeSpan> | timeoutoverride | Override timeout period. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ReadOnlyCollection<Reaction>> |
DoPollAsync(DiscordMessage, IEnumerable<DiscordEmoji>, Nullable<PollBehaviour>, Nullable<TimeSpan>)
Makes a poll and returns poll results.
Declaration
public Task<ReadOnlyCollection<PollEmoji>> DoPollAsync(DiscordMessage m, IEnumerable<DiscordEmoji> emojis, PollBehaviour? behaviour = default(PollBehaviour? ), TimeSpan? timeout = default(TimeSpan? ))
Parameters
Type | Name | Description |
---|---|---|
DiscordMessage | m | Message to create poll on. |
IEnumerable<DiscordEmoji> | emojis | Emojis to use for this poll. |
System.Nullable<PollBehaviour> | behaviour | What to do when the poll ends. |
System.Nullable<TimeSpan> | timeout | override timeout period. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ReadOnlyCollection<PollEmoji>> |
GeneratePagesInContent(String, SplitType)
Generates pages from a string, and puts them in message content.
Declaration
public IEnumerable<Page> GeneratePagesInContent(string input, SplitType splittype = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | input | Input string. |
SplitType | splittype | How to split input string. |
Returns
Type | Description |
---|---|
IEnumerable<Page> |
GeneratePagesInEmbed(String, SplitType, DiscordEmbedBuilder)
Generates pages from a string, and puts them in message embeds.
Declaration
public IEnumerable<Page> GeneratePagesInEmbed(string input, SplitType splittype = null, DiscordEmbedBuilder embedbase = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | input | Input string. |
SplitType | splittype | How to split input string. |
DiscordEmbedBuilder | embedbase | Base embed for output embeds. |
Returns
Type | Description |
---|---|
IEnumerable<Page> |
SendPaginatedMessageAsync(DiscordChannel, DiscordUser, IEnumerable<Page>, PaginationEmojis, Nullable<PaginationBehaviour>, Nullable<PaginationDeletion>, Nullable<TimeSpan>)
Sends a paginated message. For this Event you need the GuildMessageReactions intent specified in Intents
Declaration
public Task SendPaginatedMessageAsync(DiscordChannel c, DiscordUser u, IEnumerable<Page> pages, PaginationEmojis emojis = null, PaginationBehaviour? behaviour = default(PaginationBehaviour? ), PaginationDeletion? deletion = default(PaginationDeletion? ), TimeSpan? timeoutoverride = default(TimeSpan? ))
Parameters
Type | Name | Description |
---|---|---|
DiscordChannel | c | Channel to send paginated message in. |
DiscordUser | u | User to give control. |
IEnumerable<Page> | pages | Pages. |
PaginationEmojis | emojis | Pagination emojis (emojis set to null get disabled). |
System.Nullable<PaginationBehaviour> | behaviour | Pagination behaviour (when hitting max and min indices). |
System.Nullable<PaginationDeletion> | deletion | Deletion behaviour. |
System.Nullable<TimeSpan> | timeoutoverride | Override timeout period. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Setup(DiscordClient)
Declaration
protected override void Setup(DiscordClient client)
Parameters
Type | Name | Description |
---|---|---|
DiscordClient | client |
Overrides
WaitForCustomPaginationAsync(IPaginationRequest)
Waits for a custom pagination request to finish. This does NOT handle removing emojis after finishing for you.
Declaration
public Task WaitForCustomPaginationAsync(IPaginationRequest request)
Parameters
Type | Name | Description |
---|---|---|
IPaginationRequest | request |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
WaitForEventArgsAsync<T>(Func<T, Boolean>, Nullable<TimeSpan>)
Waits for specific event args to be received. Make sure the appropriate DiscordIntents are registered, if needed.
Declaration
public Task<InteractivityResult<T>> WaitForEventArgsAsync<T>(Func<T, bool> predicate, TimeSpan? timeoutoverride = default(TimeSpan? ))
where T : AsyncEventArgs
Parameters
Type | Name | Description |
---|---|---|
Func<T, System.Boolean> | predicate | |
System.Nullable<TimeSpan> | timeoutoverride |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InteractivityResult<T>> |
Type Parameters
Name | Description |
---|---|
T |
WaitForMessageAsync(Func<DiscordMessage, Boolean>, Nullable<TimeSpan>)
Waits for a specific message.
Declaration
public Task<InteractivityResult<DiscordMessage>> WaitForMessageAsync(Func<DiscordMessage, bool> predicate, TimeSpan? timeoutoverride = default(TimeSpan? ))
Parameters
Type | Name | Description |
---|---|---|
Func<DiscordMessage, System.Boolean> | predicate | Predicate to match. |
System.Nullable<TimeSpan> | timeoutoverride | override timeout period. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InteractivityResult<DiscordMessage>> |
WaitForReactionAsync(DiscordMessage, DiscordUser, Nullable<TimeSpan>)
Wait for a specific reaction. For this Event you need the GuildMessageReactions intent specified in Intents
Declaration
public Task<InteractivityResult<MessageReactionAddEventArgs>> WaitForReactionAsync(DiscordMessage message, DiscordUser user, TimeSpan? timeoutoverride = default(TimeSpan? ))
Parameters
Type | Name | Description |
---|---|---|
DiscordMessage | message | Message reaction was added to. |
DiscordUser | user | User that made the reaction. |
System.Nullable<TimeSpan> | timeoutoverride | override timeout period. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InteractivityResult<MessageReactionAddEventArgs>> |
WaitForReactionAsync(Func<MessageReactionAddEventArgs, Boolean>, DiscordMessage, DiscordUser, Nullable<TimeSpan>)
Waits for a specific reaction. For this Event you need the GuildMessageReactions intent specified in Intents
Declaration
public Task<InteractivityResult<MessageReactionAddEventArgs>> WaitForReactionAsync(Func<MessageReactionAddEventArgs, bool> predicate, DiscordMessage message, DiscordUser user, TimeSpan? timeoutoverride = default(TimeSpan? ))
Parameters
Type | Name | Description |
---|---|---|
Func<MessageReactionAddEventArgs, System.Boolean> | predicate | Predicate to match. |
DiscordMessage | message | Message reaction was added to. |
DiscordUser | user | User that made the reaction. |
System.Nullable<TimeSpan> | timeoutoverride | override timeout period. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InteractivityResult<MessageReactionAddEventArgs>> |
WaitForReactionAsync(Func<MessageReactionAddEventArgs, Boolean>, DiscordUser, Nullable<TimeSpan>)
Waits for a specific reaction. For this Event you need the GuildMessageReactions intent specified in Intents
Declaration
public Task<InteractivityResult<MessageReactionAddEventArgs>> WaitForReactionAsync(Func<MessageReactionAddEventArgs, bool> predicate, DiscordUser user, TimeSpan? timeoutoverride = default(TimeSpan? ))
Parameters
Type | Name | Description |
---|---|---|
Func<MessageReactionAddEventArgs, System.Boolean> | predicate | predicate to match. |
DiscordUser | user | User that made the reaction. |
System.Nullable<TimeSpan> | timeoutoverride | Override timeout period. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InteractivityResult<MessageReactionAddEventArgs>> |
WaitForReactionAsync(Func<MessageReactionAddEventArgs, Boolean>, Nullable<TimeSpan>)
Wait for a specific reaction.
Declaration
public Task<InteractivityResult<MessageReactionAddEventArgs>> WaitForReactionAsync(Func<MessageReactionAddEventArgs, bool> predicate, TimeSpan? timeoutoverride = default(TimeSpan? ))
Parameters
Type | Name | Description |
---|---|---|
Func<MessageReactionAddEventArgs, System.Boolean> | predicate | Predicate to match. |
System.Nullable<TimeSpan> | timeoutoverride | override timeout period. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InteractivityResult<MessageReactionAddEventArgs>> |
WaitForTypingAsync(DiscordChannel, Nullable<TimeSpan>)
Waits for any user to start typing.
Declaration
public Task<InteractivityResult<TypingStartEventArgs>> WaitForTypingAsync(DiscordChannel channel, TimeSpan? timeoutoverride = default(TimeSpan? ))
Parameters
Type | Name | Description |
---|---|---|
DiscordChannel | channel | Channel to type in. |
System.Nullable<TimeSpan> | timeoutoverride | Override timeout period. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InteractivityResult<TypingStartEventArgs>> |
WaitForUserTypingAsync(DiscordUser, DiscordChannel, Nullable<TimeSpan>)
Waits for a user to start typing.
Declaration
public Task<InteractivityResult<TypingStartEventArgs>> WaitForUserTypingAsync(DiscordUser user, DiscordChannel channel, TimeSpan? timeoutoverride = default(TimeSpan? ))
Parameters
Type | Name | Description |
---|---|---|
DiscordUser | user | User that starts typing. |
DiscordChannel | channel | Channel the user is typing in. |
System.Nullable<TimeSpan> | timeoutoverride | Override timeout period. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InteractivityResult<TypingStartEventArgs>> |
WaitForUserTypingAsync(DiscordUser, Nullable<TimeSpan>)
Waits for a user to start typing.
Declaration
public Task<InteractivityResult<TypingStartEventArgs>> WaitForUserTypingAsync(DiscordUser user, TimeSpan? timeoutoverride = default(TimeSpan? ))
Parameters
Type | Name | Description |
---|---|---|
DiscordUser | user | User that starts typing. |
System.Nullable<TimeSpan> | timeoutoverride | Override timeout period. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InteractivityResult<TypingStartEventArgs>> |