Table of Contents

Method GetNextMessageAsync

Namespace
DSharpPlus.Interactivity.Extensions
Assembly
DSharpPlus.Interactivity.dll

GetNextMessageAsync(DiscordChannel, Func<DiscordMessage, bool>, TimeSpan?)

Waits for the next message sent in this channel that satisfies the predicate.

public static Task<InteractivityResult<DiscordMessage>> GetNextMessageAsync(this DiscordChannel channel, Func<DiscordMessage, bool> predicate, TimeSpan? timeoutOverride = null)

Parameters

channel DiscordChannel

The channel to monitor.

predicate Func<DiscordMessage, bool>

A predicate that should return true if a message matches.

timeoutOverride TimeSpan?

Overrides the timeout set in Timeout

Returns

Task<InteractivityResult<DiscordMessage>>

Exceptions

InvalidOperationException

Thrown if interactivity is not enabled for the client associated with the channel.

GetNextMessageAsync(DiscordChannel, TimeSpan?)

Waits for the next message sent in this channel.

public static Task<InteractivityResult<DiscordMessage>> GetNextMessageAsync(this DiscordChannel channel, TimeSpan? timeoutOverride = null)

Parameters

channel DiscordChannel

The channel to monitor.

timeoutOverride TimeSpan?

Overrides the timeout set in Timeout

Returns

Task<InteractivityResult<DiscordMessage>>

Exceptions

InvalidOperationException

Thrown if interactivity is not enabled for the client associated with the channel.

GetNextMessageAsync(DiscordChannel, DiscordUser, TimeSpan?)

Waits for the next message sent in this channel from a specific user.

public static Task<InteractivityResult<DiscordMessage>> GetNextMessageAsync(this DiscordChannel channel, DiscordUser user, TimeSpan? timeoutOverride = null)

Parameters

channel DiscordChannel

The channel to monitor.

user DiscordUser

The target user.

timeoutOverride TimeSpan?

Overrides the timeout set in Timeout

Returns

Task<InteractivityResult<DiscordMessage>>

Exceptions

InvalidOperationException

Thrown if interactivity is not enabled for the client associated with the channel.