Class ReactiveEventAdapter


  • public abstract class ReactiveEventAdapter
    extends Object
    An adapter class to attach reactive listeners to each event type. Create a new instance to subclass it and override one or more event methods. See Event class for more details.
    • Constructor Detail

      • ReactiveEventAdapter

        public ReactiveEventAdapter()
    • Method Detail

      • onReady

        public Publisher<?> onReady​(ReadyEvent event)
        Invoked as Discord has established a fresh Gateway session. This event can be used to track the bot connection details and contains the initial state required to operate with the real-time Gateway. See ReadyEvent and Discord documentation for more details about this event.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onResume

        public Publisher<?> onResume​(ResumeEvent event)
        Invoked when the gateway connection is successfully resumed.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onMessageCreate

        public Publisher<?> onMessageCreate​(MessageCreateEvent event)
        Invoked when a message is sent in a message channel.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onMessageUpdate

        public Publisher<?> onMessageUpdate​(MessageUpdateEvent event)
        Invoked when a message is updated. This event includes both normal message editing as well as the following behavior regarding embeds: When a message with a link is sent, it does not initially contain its embed. When Discord creates the embed, this event is fired with it added to the embeds list.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onReactionAdd

        public Publisher<?> onReactionAdd​(ReactionAddEvent event)
        Invoked when a reaction is added to a message. Guild ID might be missing if this event fires for a DM channel.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onReactionRemove

        public Publisher<?> onReactionRemove​(ReactionRemoveEvent event)
        Invoked when a reaction is removed from a message. Guild ID might be missing if this event fires for a DM channel.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onReactionRemoveEmoji

        public Publisher<?> onReactionRemoveEmoji​(ReactionRemoveEmojiEvent event)
        Invoked when the reactions for one emoji are removed from a message. Guild ID might be missing if this event fires for a DM channel.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onReactionRemoveAll

        public Publisher<?> onReactionRemoveAll​(ReactionRemoveAllEvent event)
        Invoked when all of the reactions on a message are removed. Guild ID might be missing if this event fires for a DM channel.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onApplicationCommandCreate

        public Publisher<?> onApplicationCommandCreate​(ApplicationCommandCreateEvent event)
        Invoked when an application command relevant to the current user is created. Guild ID might be missing if this event fires for a DM channel.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onApplicationCommandUpdate

        public Publisher<?> onApplicationCommandUpdate​(ApplicationCommandUpdateEvent event)
        Invoked when an application command relevant to the current user is updated. Guild ID might be missing if this event fires for a DM channel.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onApplicationCommandDelete

        public Publisher<?> onApplicationCommandDelete​(ApplicationCommandDeleteEvent event)
        Invoked when an application command relevant to the current user is deleted. Guild ID might be missing if this event fires for a DM channel.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onGuildCreate

        public Publisher<?> onGuildCreate​(GuildCreateEvent event)
        Invoked when the bot receives initial information on startup, after it joins a guild, or after an outage is resolved.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onGuildDelete

        public Publisher<?> onGuildDelete​(GuildDeleteEvent event)
        Invoked when the bot leaves or is kicked from a guild, or if a guild has become unavailable due to an outage.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onMemberLeave

        public Publisher<?> onMemberLeave​(MemberLeaveEvent event)
        Invoked when a user leaves a guild, or is kicked from it.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onMemberUpdate

        public Publisher<?> onMemberUpdate​(MemberUpdateEvent event)
        Invoked when a user's nickname or roles change in a guild.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onMemberChunk

        public Publisher<?> onMemberChunk​(MemberChunkEvent event)
        Invoked when members are streamed to the client from Discord.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onEmojisUpdate

        public Publisher<?> onEmojisUpdate​(EmojisUpdateEvent event)
        Invoked when an emoji is added, deleted or edited in a guild. The emojis set includes ALL emojis of the guild.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onBan

        public Publisher<?> onBan​(BanEvent event)
        Invoked when a user is banned from a guild.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onUnban

        public Publisher<?> onUnban​(UnbanEvent event)
        Invoked when a user is unbanned from a guild.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onWebhooksUpdate

        public Publisher<?> onWebhooksUpdate​(WebhooksUpdateEvent event)
        Invoked when a webhook is updated in a guild. Discord does not send any information about what was actually updated. This is simply a notification of some update.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onPrivateChannelCreate

        @Deprecated
        public Publisher<?> onPrivateChannelCreate​(PrivateChannelCreateEvent event)
        Deprecated.
        event scheduled for removal in v3.2 after being deprecated by Discord in Gateway v8.
        Invoked when a DM channel is created.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onTypingStart

        public Publisher<?> onTypingStart​(TypingStartEvent event)
        Invoked when a user has started typing a message.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onPinsUpdate

        public Publisher<?> onPinsUpdate​(PinsUpdateEvent event)
        Invoked when a channel's pinned messages are updated.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onRoleUpdate

        public Publisher<?> onRoleUpdate​(RoleUpdateEvent event)
        Invoked when one or more role's properties are updated in a guild.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onUserUpdate

        public Publisher<?> onUserUpdate​(UserUpdateEvent event)
        Invoked when one or more user's properties were updated.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onPresenceUpdate

        public Publisher<?> onPresenceUpdate​(PresenceUpdateEvent event)
        Invoked when a user's presence or status has changed.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onVoiceStateUpdate

        public Publisher<?> onVoiceStateUpdate​(VoiceStateUpdateEvent event)
        Invoked when a user's connected voice channel and status, was requested or has updated.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onVoiceServerUpdate

        public Publisher<?> onVoiceServerUpdate​(VoiceServerUpdateEvent event)
        Invoked when a guild's voice server is requested or is updated.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onConnect

        public Publisher<?> onConnect​(ConnectEvent event)
        Invoked when connecting to the Gateway for the first time only.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onReconnect

        public Publisher<?> onReconnect​(ReconnectEvent event)
        Invoked when subsequent reconnections to the Gateway, either through resumption or full retry.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onDisconnect

        public Publisher<?> onDisconnect​(DisconnectEvent event)
        Invoked when the bot has disconnected from the Gateway.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onReconnectStart

        public Publisher<?> onReconnectStart​(ReconnectStartEvent event)
        Invoked when a resumption or reconnection attempt has begun.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onReconnectFail

        public Publisher<?> onReconnectFail​(ReconnectFailEvent event)
        Invoked when a resumption or reconnection attempt has failed but can be retried.
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onChatInputInteraction

        public Publisher<?> onChatInputInteraction​(ChatInputInteractionEvent event)
        Invoked when a user issues a chat input command (formerly "slash command").
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onMessageInteraction

        public Publisher<?> onMessageInteraction​(MessageInteractionEvent event)
        Invoked when a user issues a message command (context menu action on a message).
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).
      • onUserInteraction

        public Publisher<?> onUserInteraction​(UserInteractionEvent event)
        Invoked when a user issues a user command (context menu action on a user).
        Parameters:
        event - the event instance
        Returns:
        a Publisher that completes when this listener has done processing the event, for example, returning any Mono, Flux or synchronous code using Mono.fromRunnable(Runnable).