Class GatewayActions


  • public class GatewayActions
    extends Object
    Provides static factories to obtain StoreAction instances that enable updating data in a store in response to an event received from the Discord gateway.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ChannelCreateAction channelCreate​(int shardIndex, discord4j.discordjson.json.gateway.ChannelCreate dispatch)
      Creates an action to execute when a ChannelCreate is received from the gateway.
      static ChannelDeleteAction channelDelete​(int shardIndex, discord4j.discordjson.json.gateway.ChannelDelete dispatch)
      Creates an action to execute when a ChannelDelete is received from the gateway.
      static ChannelUpdateAction channelUpdate​(int shardIndex, discord4j.discordjson.json.gateway.ChannelUpdate dispatch)
      Creates an action to execute when a ChannelUpdate is received from the gateway.
      static CompleteGuildMembersAction completeGuildMembers​(long guildId)
      Creates an action that allows to signal that the full member list for the specified guild has been received.
      static GuildCreateAction guildCreate​(int shardIndex, discord4j.discordjson.json.gateway.GuildCreate dispatch)
      Creates an action to execute when a GuildCreate is received from the gateway.
      static GuildDeleteAction guildDelete​(int shardIndex, discord4j.discordjson.json.gateway.GuildDelete dispatch)
      Creates an action to execute when a GuildDelete is received from the gateway.
      static GuildEmojisUpdateAction guildEmojisUpdate​(int shardIndex, discord4j.discordjson.json.gateway.GuildEmojisUpdate dispatch)
      Creates an action to execute when a GuildEmojisUpdate is received from the gateway.
      static GuildMemberAddAction guildMemberAdd​(int shardIndex, discord4j.discordjson.json.gateway.GuildMemberAdd dispatch)
      Creates an action to execute when a GuildMemberAdd is received from the gateway.
      static GuildMemberRemoveAction guildMemberRemove​(int shardIndex, discord4j.discordjson.json.gateway.GuildMemberRemove dispatch)
      Creates an action to execute when a GuildMemberRemove is received from the gateway.
      static GuildMembersChunkAction guildMembersChunk​(int shardIndex, discord4j.discordjson.json.gateway.GuildMembersChunk dispatch)
      Creates an action to execute when a GuildMembersChunk is received from the gateway.
      static GuildMemberUpdateAction guildMemberUpdate​(int shardIndex, discord4j.discordjson.json.gateway.GuildMemberUpdate dispatch)
      Creates an action to execute when a GuildMemberUpdate is received from the gateway.
      static GuildRoleCreateAction guildRoleCreate​(int shardIndex, discord4j.discordjson.json.gateway.GuildRoleCreate dispatch)
      Creates an action to execute when a GuildRoleCreate is received from the gateway.
      static GuildRoleDeleteAction guildRoleDelete​(int shardIndex, discord4j.discordjson.json.gateway.GuildRoleDelete dispatch)
      Creates an action to execute when a GuildRoleDelete is received from the gateway.
      static GuildRoleUpdateAction guildRoleUpdate​(int shardIndex, discord4j.discordjson.json.gateway.GuildRoleUpdate dispatch)
      Creates an action to execute when a GuildRoleUpdate is received from the gateway.
      static GuildUpdateAction guildUpdate​(int shardIndex, discord4j.discordjson.json.gateway.GuildUpdate dispatch)
      Creates an action to execute when a GuildUpdate is received from the gateway.
      static InvalidateShardAction invalidateShard​(int shardIndex, InvalidationCause cause)
      Creates an action to execute when a shard should be invalidated.
      static MessageCreateAction messageCreate​(int shardIndex, discord4j.discordjson.json.gateway.MessageCreate dispatch)
      Creates an action to execute when a MessageCreate is received from the gateway.
      static MessageDeleteAction messageDelete​(int shardIndex, discord4j.discordjson.json.gateway.MessageDelete dispatch)
      Creates an action to execute when a MessageDelete is received from the gateway.
      static MessageDeleteBulkAction messageDeleteBulk​(int shardIndex, discord4j.discordjson.json.gateway.MessageDeleteBulk dispatch)
      Creates an action to execute when a MessageDeleteBulk is received from the gateway.
      static MessageReactionAddAction messageReactionAdd​(int shardIndex, discord4j.discordjson.json.gateway.MessageReactionAdd dispatch)
      Creates an action to execute when a MessageReactionAdd is received from the gateway.
      static MessageReactionRemoveAction messageReactionRemove​(int shardIndex, discord4j.discordjson.json.gateway.MessageReactionRemove dispatch)
      Creates an action to execute when a MessageReactionRemove is received from the gateway.
      static MessageReactionRemoveAllAction messageReactionRemoveAll​(int shardIndex, discord4j.discordjson.json.gateway.MessageReactionRemoveAll dispatch)
      Creates an action to execute when a MessageReactionRemoveAll is received from the gateway.
      static MessageReactionRemoveEmojiAction messageReactionRemoveEmoji​(int shardIndex, discord4j.discordjson.json.gateway.MessageReactionRemoveEmoji dispatch)
      Creates an action to execute when a MessageReactionRemoveEmoji is received from the gateway.
      static MessageUpdateAction messageUpdate​(int shardIndex, discord4j.discordjson.json.gateway.MessageUpdate dispatch)
      Creates an action to execute when a MessageUpdate is received from the gateway.
      static PresenceUpdateAction presenceUpdate​(int shardIndex, discord4j.discordjson.json.gateway.PresenceUpdate dispatch)
      Creates an action to execute when a PresenceUpdate is received from the gateway.
      static ReadyAction ready​(discord4j.discordjson.json.gateway.Ready dispatch)
      Creates an action to execute when a Ready is received from the gateway.
      static UserUpdateAction userUpdate​(int shardIndex, discord4j.discordjson.json.gateway.UserUpdate dispatch)
      Creates an action to execute when a UserUpdate is received from the gateway.
      static VoiceStateUpdateDispatchAction voiceStateUpdateDispatch​(int shardIndex, discord4j.discordjson.json.gateway.VoiceStateUpdateDispatch dispatch)
      Creates an action to execute when a VoiceStateUpdateDispatch is received from the gateway.
    • Method Detail

      • channelCreate

        public static ChannelCreateAction channelCreate​(int shardIndex,
                                                        discord4j.discordjson.json.gateway.ChannelCreate dispatch)
        Creates an action to execute when a ChannelCreate is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new ChannelCreateAction
      • channelDelete

        public static ChannelDeleteAction channelDelete​(int shardIndex,
                                                        discord4j.discordjson.json.gateway.ChannelDelete dispatch)
        Creates an action to execute when a ChannelDelete is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new ChannelDeleteAction
      • channelUpdate

        public static ChannelUpdateAction channelUpdate​(int shardIndex,
                                                        discord4j.discordjson.json.gateway.ChannelUpdate dispatch)
        Creates an action to execute when a ChannelUpdate is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new ChannelUpdateAction
      • guildCreate

        public static GuildCreateAction guildCreate​(int shardIndex,
                                                    discord4j.discordjson.json.gateway.GuildCreate dispatch)
        Creates an action to execute when a GuildCreate is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new GuildCreateAction
      • guildDelete

        public static GuildDeleteAction guildDelete​(int shardIndex,
                                                    discord4j.discordjson.json.gateway.GuildDelete dispatch)
        Creates an action to execute when a GuildDelete is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new GuildDeleteAction
      • guildEmojisUpdate

        public static GuildEmojisUpdateAction guildEmojisUpdate​(int shardIndex,
                                                                discord4j.discordjson.json.gateway.GuildEmojisUpdate dispatch)
        Creates an action to execute when a GuildEmojisUpdate is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new GuildEmojisUpdateAction
      • guildMemberAdd

        public static GuildMemberAddAction guildMemberAdd​(int shardIndex,
                                                          discord4j.discordjson.json.gateway.GuildMemberAdd dispatch)
        Creates an action to execute when a GuildMemberAdd is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new GuildMemberAddAction
      • guildMemberRemove

        public static GuildMemberRemoveAction guildMemberRemove​(int shardIndex,
                                                                discord4j.discordjson.json.gateway.GuildMemberRemove dispatch)
        Creates an action to execute when a GuildMemberRemove is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new GuildMemberRemoveAction
      • guildMembersChunk

        public static GuildMembersChunkAction guildMembersChunk​(int shardIndex,
                                                                discord4j.discordjson.json.gateway.GuildMembersChunk dispatch)
        Creates an action to execute when a GuildMembersChunk is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new GuildMembersChunkAction
      • guildMemberUpdate

        public static GuildMemberUpdateAction guildMemberUpdate​(int shardIndex,
                                                                discord4j.discordjson.json.gateway.GuildMemberUpdate dispatch)
        Creates an action to execute when a GuildMemberUpdate is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new GuildMemberUpdateAction
      • guildRoleCreate

        public static GuildRoleCreateAction guildRoleCreate​(int shardIndex,
                                                            discord4j.discordjson.json.gateway.GuildRoleCreate dispatch)
        Creates an action to execute when a GuildRoleCreate is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new GuildRoleCreateAction
      • guildRoleDelete

        public static GuildRoleDeleteAction guildRoleDelete​(int shardIndex,
                                                            discord4j.discordjson.json.gateway.GuildRoleDelete dispatch)
        Creates an action to execute when a GuildRoleDelete is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new GuildRoleDeleteAction
      • guildRoleUpdate

        public static GuildRoleUpdateAction guildRoleUpdate​(int shardIndex,
                                                            discord4j.discordjson.json.gateway.GuildRoleUpdate dispatch)
        Creates an action to execute when a GuildRoleUpdate is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new GuildRoleUpdateAction
      • guildUpdate

        public static GuildUpdateAction guildUpdate​(int shardIndex,
                                                    discord4j.discordjson.json.gateway.GuildUpdate dispatch)
        Creates an action to execute when a GuildUpdate is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new GuildUpdateAction
      • invalidateShard

        public static InvalidateShardAction invalidateShard​(int shardIndex,
                                                            InvalidationCause cause)
        Creates an action to execute when a shard should be invalidated.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        cause - the cause of the invalidation
        Returns:
        a new InvalidateShardAction
      • messageCreate

        public static MessageCreateAction messageCreate​(int shardIndex,
                                                        discord4j.discordjson.json.gateway.MessageCreate dispatch)
        Creates an action to execute when a MessageCreate is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new MessageCreateAction
      • messageDelete

        public static MessageDeleteAction messageDelete​(int shardIndex,
                                                        discord4j.discordjson.json.gateway.MessageDelete dispatch)
        Creates an action to execute when a MessageDelete is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new MessageDeleteAction
      • messageDeleteBulk

        public static MessageDeleteBulkAction messageDeleteBulk​(int shardIndex,
                                                                discord4j.discordjson.json.gateway.MessageDeleteBulk dispatch)
        Creates an action to execute when a MessageDeleteBulk is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new MessageDeleteBulkAction
      • messageReactionAdd

        public static MessageReactionAddAction messageReactionAdd​(int shardIndex,
                                                                  discord4j.discordjson.json.gateway.MessageReactionAdd dispatch)
        Creates an action to execute when a MessageReactionAdd is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new MessageReactionAddAction
      • messageReactionRemove

        public static MessageReactionRemoveAction messageReactionRemove​(int shardIndex,
                                                                        discord4j.discordjson.json.gateway.MessageReactionRemove dispatch)
        Creates an action to execute when a MessageReactionRemove is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new MessageReactionRemoveAction
      • messageReactionRemoveAll

        public static MessageReactionRemoveAllAction messageReactionRemoveAll​(int shardIndex,
                                                                              discord4j.discordjson.json.gateway.MessageReactionRemoveAll dispatch)
        Creates an action to execute when a MessageReactionRemoveAll is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new MessageReactionRemoveAllAction
      • messageReactionRemoveEmoji

        public static MessageReactionRemoveEmojiAction messageReactionRemoveEmoji​(int shardIndex,
                                                                                  discord4j.discordjson.json.gateway.MessageReactionRemoveEmoji dispatch)
        Creates an action to execute when a MessageReactionRemoveEmoji is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new MessageReactionRemoveEmojiAction
      • messageUpdate

        public static MessageUpdateAction messageUpdate​(int shardIndex,
                                                        discord4j.discordjson.json.gateway.MessageUpdate dispatch)
        Creates an action to execute when a MessageUpdate is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new MessageUpdateAction
      • presenceUpdate

        public static PresenceUpdateAction presenceUpdate​(int shardIndex,
                                                          discord4j.discordjson.json.gateway.PresenceUpdate dispatch)
        Creates an action to execute when a PresenceUpdate is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new PresenceUpdateAction
      • ready

        public static ReadyAction ready​(discord4j.discordjson.json.gateway.Ready dispatch)
        Creates an action to execute when a Ready is received from the gateway.
        Parameters:
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new ReadyAction
      • userUpdate

        public static UserUpdateAction userUpdate​(int shardIndex,
                                                  discord4j.discordjson.json.gateway.UserUpdate dispatch)
        Creates an action to execute when a UserUpdate is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new UserUpdateAction
      • voiceStateUpdateDispatch

        public static VoiceStateUpdateDispatchAction voiceStateUpdateDispatch​(int shardIndex,
                                                                              discord4j.discordjson.json.gateway.VoiceStateUpdateDispatch dispatch)
        Creates an action to execute when a VoiceStateUpdateDispatch is received from the gateway.
        Parameters:
        shardIndex - the index of the shard where the dispatch comes from
        dispatch - the dispatch data coming from Discord gateway
        Returns:
        a new VoiceStateUpdateDispatchAction
      • completeGuildMembers

        public static CompleteGuildMembersAction completeGuildMembers​(long guildId)
        Creates an action that allows to signal that the full member list for the specified guild has been received.
        Parameters:
        guildId - the guild ID
        Returns:
        a new CompleteGuildMembersAction