Class ReadActions


  • public class ReadActions
    extends Object
    Provides static factories to obtain StoreAction instances that enable reading data from a store.
    • Method Detail

      • countChannels

        public static CountTotalAction countChannels()
        Creates an action to count the number of channels present in a store.
        Returns:
        a new CountTotalAction
      • countChannelsInGuild

        public static CountInGuildAction countChannelsInGuild​(long guildId)
        Creates an action to count the number of channels present in a store for the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new CountInGuildAction
      • countEmojis

        public static CountTotalAction countEmojis()
        Creates an action to count the number of emojis present in a store.
        Returns:
        a new CountTotalAction
      • countEmojisInGuild

        public static CountInGuildAction countEmojisInGuild​(long guildId)
        Creates an action to count the number of emojis present in a store for the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new CountInGuildAction
      • countGuilds

        public static CountTotalAction countGuilds()
        Creates an action to count the number of guilds present in a store.
        Returns:
        a new CountTotalAction
      • countMembers

        public static CountTotalAction countMembers()
        Creates an action to count the number of members present in a store.
        Returns:
        a new CountTotalAction
      • countMembersInGuild

        public static CountInGuildAction countMembersInGuild​(long guildId)
        Creates an action to count the number of members present in a store for the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new CountInGuildAction
      • countExactMembersInGuild

        public static CountInGuildAction countExactMembersInGuild​(long guildId)
        Creates an action to count the exact number of members for the given guild ID. If some members are not present in the store and thus is not able to return an accurate count, executing this action will error with ExactResultNotAvailableException.
        Parameters:
        guildId - the guild ID
        Returns:
        a new CountInGuildAction
      • countMessages

        public static CountTotalAction countMessages()
        Creates an action to count the number of messages present in a store.
        Returns:
        a new CountTotalAction
      • countMessagesInChannel

        public static CountMessagesInChannelAction countMessagesInChannel​(long channelId)
        Creates an action to count the number of messages present in a store for the given channel ID.
        Parameters:
        channelId - the channel ID
        Returns:
        a new CountMessagesInChannelAction
      • countPresences

        public static CountTotalAction countPresences()
        Creates an action to count the number of presences present in a store.
        Returns:
        a new CountTotalAction
      • countPresencesInGuild

        public static CountInGuildAction countPresencesInGuild​(long guildId)
        Creates an action to count the number of presences present in a store for the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new CountInGuildAction
      • countRolesInGuild

        public static CountInGuildAction countRolesInGuild​(long guildId)
        Creates an action to count the number of roles present in a store for the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new CountInGuildAction
      • countVoiceStates

        public static CountTotalAction countVoiceStates()
        Creates an action to count the number of voice states present in a store.
        Returns:
        a new CountTotalAction
      • countVoiceStatesInGuild

        public static CountInGuildAction countVoiceStatesInGuild​(long guildId)
        Creates an action to count the number of voice states present in a store for the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new CountInGuildAction
      • countVoiceStatesInChannel

        public static CountVoiceStatesInChannelAction countVoiceStatesInChannel​(long guildId,
                                                                                long channelId)
        Creates an action to count the number of voice states present in a store for the given guild ID and channel ID.
        Parameters:
        guildId - the guild ID
        channelId - the channel ID
        Returns:
        a new CountMessagesInChannelAction
      • getChannelsInGuild

        public static GetChannelsInGuildAction getChannelsInGuild​(long guildId)
        Creates an action to retrieve data for all channels present in a store for the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new GetChannelsInGuildAction
      • getChannelById

        public static GetChannelByIdAction getChannelById​(long channelId)
        Creates an action to retrieve data for the channel corresponding to the given channel ID.
        Parameters:
        channelId - the channel ID
        Returns:
        a new GetChannelByIdAction
      • getEmojis

        public static GetEmojisAction getEmojis()
        Creates an action to retrieve data for all emojis present in a store.
        Returns:
        a new GetEmojisAction
      • getEmojisInGuild

        public static GetEmojisInGuildAction getEmojisInGuild​(long guildId)
        Creates an action to retrieve data for all emojis present in a store for the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new GetEmojisInGuildAction
      • getEmojiById

        public static GetEmojiByIdAction getEmojiById​(long guildId,
                                                      long emojiId)
        Creates an action to retrieve data for the emoji corresponding to the given guild ID and emoji ID.
        Parameters:
        guildId - the guild ID
        emojiId - the emoji ID
        Returns:
        a new GetEmojiByIdAction
      • getGuilds

        public static GetGuildsAction getGuilds()
        Creates an action to retrieve data for all guilds present in a store.
        Returns:
        a new GetGuildsAction
      • getGuildById

        public static GetGuildByIdAction getGuildById​(long guildId)
        Creates an action to retrieve data for the guild corresponding to the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new GetGuildByIdAction
      • getMembers

        public static GetMembersAction getMembers()
        Creates an action to retrieve data for all members present in a store.
        Returns:
        a new GetMembersAction
      • getMembersInGuild

        public static GetMembersInGuildAction getMembersInGuild​(long guildId)
        Creates an action to retrieve data for all members present in a store for the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new GetMembersInGuildAction
      • getExactMembersInGuild

        public static GetExactMembersInGuildAction getExactMembersInGuild​(long guildId)
        Creates an action to retrieve data for all members for the given guild ID. If some members are not present in the store and thus is not able to return the full member list of the guild, executing this action will error with ExactResultNotAvailableException.
        Parameters:
        guildId - the guild ID
        Returns:
        a new GetExactMembersInGuildAction
      • getMemberById

        public static GetMemberByIdAction getMemberById​(long guildId,
                                                        long userId)
        Creates an action to retrieve data for the member corresponding to the given guild ID and user ID.
        Parameters:
        guildId - the guild ID
        userId - the user ID
        Returns:
        a new GetMemberByIdAction
      • getMessagesInChannel

        public static GetMessagesInChannelAction getMessagesInChannel​(long channelId)
        Creates an action to retrieve data for all messages present in a store for the given channel ID.
        Parameters:
        channelId - the channel ID
        Returns:
        a new GetMessagesInChannelAction
      • getMessageById

        public static GetMessageByIdAction getMessageById​(long channelId,
                                                          long messageId)
        Creates an action to retrieve data for the message corresponding to the given channel ID and message ID.
        Parameters:
        channelId - the channel ID
        messageId - the message ID
        Returns:
        a new GetMessageByIdAction
      • getPresencesInGuild

        public static GetPresencesInGuildAction getPresencesInGuild​(long guildId)
        Creates an action to retrieve data for all presences present in a store for the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new GetPresencesInGuildAction
      • getPresenceById

        public static GetPresenceByIdAction getPresenceById​(long guildId,
                                                            long userId)
        Creates an action to retrieve data for the presence corresponding to the given guild ID and user ID.
        Parameters:
        guildId - the guild ID
        userId - the user ID
        Returns:
        a new GetPresenceByIdAction
      • getRoles

        public static GetRolesAction getRoles()
        Creates an action to retrieve data for all roles present in a store.
        Returns:
        a new GetRolesAction
      • getRolesInGuild

        public static GetRolesInGuildAction getRolesInGuild​(long guildId)
        Creates an action to retrieve data for all roles present in a store for the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new GetRolesInGuildAction
      • getRoleById

        public static GetRoleByIdAction getRoleById​(long guildId,
                                                    long roleId)
        Creates an action to retrieve data for the role corresponding to the given guild ID and role ID.
        Parameters:
        guildId - the guild ID
        roleId - the role ID
        Returns:
        a new GetRoleByIdAction
      • getUsers

        public static GetUsersAction getUsers()
        Creates an action to retrieve data for all users present in a store.
        Returns:
        a new GetUsersAction
      • getUserById

        public static GetUserByIdAction getUserById​(long userId)
        Creates an action to retrieve data for the user corresponding to the given user ID.
        Parameters:
        userId - the user ID
        Returns:
        a new GetUserByIdAction
      • getVoiceStatesInChannel

        public static GetVoiceStatesInChannelAction getVoiceStatesInChannel​(long guildId,
                                                                            long channelId)
        Creates an action to retrieve data for all voice states present in a store for the given guild ID and channel ID.
        Parameters:
        guildId - the guild ID
        channelId - the channel ID
        Returns:
        a new GetVoiceStatesInChannelAction
      • getVoiceStatesInGuild

        public static GetVoiceStatesInGuildAction getVoiceStatesInGuild​(long guildId)
        Creates an action to retrieve data for all voice states present in a store for the given guild ID.
        Parameters:
        guildId - the guild ID
        Returns:
        a new GetVoiceStatesInGuildAction
      • getVoiceStateById

        public static GetVoiceStateByIdAction getVoiceStateById​(long guildId,
                                                                long userId)
        Creates an action to retrieve data for the voice state corresponding to the given guild ID and user ID.
        Parameters:
        guildId - the guild ID
        userId - the user ID
        Returns:
        a new GetVoiceStateByIdAction