Interface DiscordApi
-
- All Superinterfaces:
GloballyAttachableListenerManager
public interface DiscordApi extends GloballyAttachableListenerManager
This class is the most important class for your bot, containing all important methods, like registering listener.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.PatternESCAPED_CHARACTER
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.util.List<ApplicationCommand>>bulkOverwriteGlobalApplicationCommands(java.util.List<? extends ApplicationCommandBuilder<?,?,?>> applicationCommandBuilderList)Bulk overwrites the global application commands.java.util.concurrent.CompletableFuture<java.util.List<ApplicationCommand>>bulkOverwriteServerApplicationCommands(long server, java.util.List<? extends ApplicationCommandBuilder<?,?,?>> applicationCommandBuilderList)Bulk overwrites the servers application commands.default java.util.concurrent.CompletableFuture<java.util.List<ApplicationCommand>>bulkOverwriteServerApplicationCommands(Server server, java.util.List<? extends ApplicationCommandBuilder<?,?,?>> applicationCommandBuilderList)Bulk overwrites the servers application commands.booleancanDispatchEvents()Gets whether this API instance can dispatch events.default AccountUpdatercreateAccountUpdater()Creates an account updater for the current account.default java.lang.StringcreateBotInvite()Creates an invite link for this bot.default java.lang.StringcreateBotInvite(Permissions permissions)Creates an invite link for this bot.default ServerBuildercreateServerBuilder()Creates a server builder which can be used to create servers.java.util.concurrent.CompletableFuture<java.lang.Void>disconnect()Disconnects the bot.java.util.Optional<Activity>getActivity()Gets the activity which should be displayed.java.util.concurrent.CompletableFuture<ApplicationInfo>getApplicationInfo()Gets the application info of the bot.java.util.Optional<Message>getCachedMessageById(long id)Gets a cached message by its id.default java.util.Optional<Message>getCachedMessageById(java.lang.String id)Gets a cached message by its id.default java.util.Optional<Message>getCachedMessageByLink(java.lang.String link)Gets a cached message by its link.MessageSetgetCachedMessages()Gets a message set with all currently cached messages.default java.util.Optional<User>getCachedUserByDiscriminatedName(java.lang.String discriminatedName)Gets a user by its discriminated name like e.g.default java.util.Optional<User>getCachedUserByDiscriminatedNameIgnoreCase(java.lang.String discriminatedName)Gets a user by its discriminated name like e.g.java.util.Optional<User>getCachedUserById(long id)Gets a cached user by its id.default java.util.Optional<User>getCachedUserById(java.lang.String id)Gets a cached user by its id.default java.util.Optional<User>getCachedUserByNameAndDiscriminator(java.lang.String name, java.lang.String discriminator)Gets a user by its name and discriminator.default java.util.Optional<User>getCachedUserByNameAndDiscriminatorIgnoreCase(java.lang.String name, java.lang.String discriminator)Gets a user by its name and discriminator.java.util.Collection<User>getCachedUsers()Gets a collection with all currently cached users.default java.util.Collection<User>getCachedUsersByDisplayName(java.lang.String displayName, Server server)Gets a collection with all users with the given display name on the given server.default java.util.Collection<User>getCachedUsersByDisplayNameIgnoreCase(java.lang.String displayName, Server server)Gets a collection with all users with the given display name on the given server.default java.util.Collection<User>getCachedUsersByName(java.lang.String name)Gets a collection with all users with the given name.default java.util.Collection<User>getCachedUsersByNameIgnoreCase(java.lang.String name)Gets a collection with all users with the given name.default java.util.Collection<User>getCachedUsersByNickname(java.lang.String nickname, Server server)Gets a collection with all users with the given nickname on the given server.default java.util.Collection<User>getCachedUsersByNicknameIgnoreCase(java.lang.String nickname, Server server)Gets a collection with all users with the given nickname on the given server.java.util.Optional<Channel>getChannelById(long id)Gets a channel by its id.default java.util.Optional<Channel>getChannelById(java.lang.String id)Gets a channel by its id.java.util.Collection<ChannelCategory>getChannelCategories()Gets a collection with all channel categories of the bot.default java.util.Collection<ChannelCategory>getChannelCategoriesByName(java.lang.String name)Gets a collection with all channel categories with the given name.default java.util.Collection<ChannelCategory>getChannelCategoriesByNameIgnoreCase(java.lang.String name)Gets a collection with all channel categories with the given name.default java.util.Optional<ChannelCategory>getChannelCategoryById(long id)Gets a channel category by its id.default java.util.Optional<ChannelCategory>getChannelCategoryById(java.lang.String id)Gets a channel category by its id.java.util.Collection<Channel>getChannels()Gets a collection with all channels of the bot.default java.util.Collection<Channel>getChannelsByName(java.lang.String name)Gets a collection with all channels with the given name.default java.util.Collection<Channel>getChannelsByNameIgnoreCase(java.lang.String name)Gets a collection with all channels with the given name.longgetClientId()Gets the client id of the application.intgetCurrentShard()Gets the current shard of the bot, starting with0.default java.util.Optional<KnownCustomEmoji>getCustomEmojiById(long id)Gets a custom emoji in this server by its id.default java.util.Optional<KnownCustomEmoji>getCustomEmojiById(java.lang.String id)Gets a custom emoji in this server by its id.java.util.Collection<KnownCustomEmoji>getCustomEmojis()Gets a collection with all known custom emojis.default java.util.Collection<KnownCustomEmoji>getCustomEmojisByName(java.lang.String name)Gets a collection with all custom emojis with the given name in the server.default java.util.Collection<KnownCustomEmoji>getCustomEmojisByNameIgnoreCase(java.lang.String name)Gets a collection with all custom emojis with the given name in the server.intgetDefaultMessageCacheCapacity()Gets the default message cache capacity which is applied for every newly created channel.intgetDefaultMessageCacheStorageTimeInSeconds()Gets the default maximum age of cached messages.RatelimitergetGatewayIdentifyRatelimiter()Gets the current gateway identify ratelimiter.java.util.concurrent.CompletableFuture<ApplicationCommand>getGlobalApplicationCommandById(long applicationCommandId)Gets an application command by its id.java.util.concurrent.CompletableFuture<java.util.List<ApplicationCommand>>getGlobalApplicationCommands()Gets a list with all global commands for the application.java.util.concurrent.CompletableFuture<MessageContextMenu>getGlobalMessageContextMenuById(long commandId)Gets a global message context menu by its id.java.util.concurrent.CompletableFuture<java.util.List<MessageContextMenu>>getGlobalMessageContextMenus()Gets a list with all global message context menus for the application.java.util.Optional<Ratelimiter>getGlobalRatelimiter()Gets the current global ratelimiter.java.util.concurrent.CompletableFuture<SlashCommand>getGlobalSlashCommandById(long commandId)Gets a slash command by its id.java.util.concurrent.CompletableFuture<java.util.List<SlashCommand>>getGlobalSlashCommands()Gets a list with all global slash commands for the application.java.util.concurrent.CompletableFuture<UserContextMenu>getGlobalUserContextMenuById(long commandId)Gets a global user context menu by its id.java.util.concurrent.CompletableFuture<java.util.List<UserContextMenu>>getGlobalUserContextMenus()Gets a list with all global user context menus for the application.default java.util.concurrent.CompletableFuture<IncomingWebhook>getIncomingWebhookByIdAndToken(long id, java.lang.String token)Gets an incoming webhook by its id and its token.java.util.concurrent.CompletableFuture<IncomingWebhook>getIncomingWebhookByIdAndToken(java.lang.String id, java.lang.String token)Gets an incoming webhook by its id and its token.default java.util.concurrent.CompletableFuture<IncomingWebhook>getIncomingWebhookByUrl(java.lang.String url)Gets a webhook by its url.java.util.Set<Intent>getIntents()Gets the intents used to receive some or all events specified inIntent.java.util.concurrent.CompletableFuture<Invite>getInviteByCode(java.lang.String code)Gets an invite by its code.java.util.concurrent.CompletableFuture<Invite>getInviteWithMemberCountsByCode(java.lang.String code)Gets an invite by its code while requesting additional information.CustomEmojigetKnownCustomEmojiOrCreateCustomEmoji(long id, java.lang.String name, boolean animated)Creates or gets a custom emoji to be used in other Javacord APIs.java.time.DurationgetLatestGatewayLatency()Gets the latest gateway latency.default java.util.concurrent.CompletableFuture<Message>getMessageById(long id, TextChannel channel)Gets a message by its id, if it exists and belongs to the given channel.default java.util.concurrent.CompletableFuture<Message>getMessageById(java.lang.String id, TextChannel channel)Gets a message by its id, if it exists and belongs to the given channel.default java.util.Optional<java.util.concurrent.CompletableFuture<Message>>getMessageByLink(java.lang.String link)Gets a message by its link.java.util.concurrent.CompletableFuture<java.util.Set<StickerPack>>getNitroStickerPacks()Gets a list of all default sticker packs, which are available to nitro users.default java.util.concurrent.CompletableFuture<User>getOwner()Gets the owner of the application.longgetOwnerId()Gets the id of the application's owner.java.lang.StringgetPrefixedToken()Gets the used token with the bot prefix, that way it is usable directly in the authentication header for custom REST calls.default java.util.Optional<PrivateChannel>getPrivateChannelById(long id)Gets a private channel by its id.default java.util.Optional<PrivateChannel>getPrivateChannelById(java.lang.String id)Gets a private channel by its id.java.util.Collection<PrivateChannel>getPrivateChannels()Gets a collection with all private channels of the bot.java.util.Set<ServerThreadChannel>getPrivateServerThreadChannels()Gets a set with all the private threads of the bot.java.util.Set<ServerThreadChannel>getPublicServerThreadChannels()Gets a set with all the public threads of the bot.intgetReconnectDelay(int attempt)Gets the reconnect delay for a given amount of attempts.default java.util.Optional<RegularServerChannel>getRegularServerChannelById(long id)Gets a regular server channel by its id.default java.util.Optional<RegularServerChannel>getRegularServerChannelById(java.lang.String id)Gets a regular server channel by its id.java.util.Collection<RegularServerChannel>getRegularServerChannels()Gets a collection with all regular server channels of the bot.default java.util.Collection<RegularServerChannel>getRegularServerChannelsByName(java.lang.String name)Gets a collection with all regular server channels with the given name.default java.util.Collection<RegularServerChannel>getRegularServerChannelsByNameIgnoreCase(java.lang.String name)Gets a collection with all regular server channels with the given name.default java.util.Optional<Role>getRoleById(long id)Gets a role by its id.default java.util.Optional<Role>getRoleById(java.lang.String id)Gets a role by its id.default java.util.Collection<Role>getRoles()Gets a collection with all roles the bot knows.default java.util.Collection<Role>getRolesByName(java.lang.String name)Gets a collection with all roles with the given name.default java.util.Collection<Role>getRolesByNameIgnoreCase(java.lang.String name)Gets a collection with all roles with the given name.java.util.concurrent.CompletableFuture<ApplicationCommand>getServerApplicationCommandById(Server server, long applicationCommandId)Gets a server application command by its id.java.util.concurrent.CompletableFuture<java.util.List<ServerApplicationCommandPermissions>>getServerApplicationCommandPermissions(Server server)Gets a list of all server application command permissions from the given server.java.util.concurrent.CompletableFuture<ServerApplicationCommandPermissions>getServerApplicationCommandPermissionsById(Server server, long commandId)Gets a server application command permissions by it ID from the given server.java.util.concurrent.CompletableFuture<java.util.List<ApplicationCommand>>getServerApplicationCommands(Server server)Gets a list with all application commands for the given server.default java.util.Optional<Server>getServerById(long id)Gets a server by its id.default java.util.Optional<Server>getServerById(java.lang.String id)Gets a server by its id.default java.util.Optional<ServerChannel>getServerChannelById(long id)Gets a server channel by its id.default java.util.Optional<ServerChannel>getServerChannelById(java.lang.String id)Gets a server channel by its id.java.util.Collection<ServerChannel>getServerChannels()Gets a collection with all server channels of the bot.default java.util.Collection<ServerChannel>getServerChannelsByName(java.lang.String name)Gets a collection with all server channels with the given name.default java.util.Collection<ServerChannel>getServerChannelsByNameIgnoreCase(java.lang.String name)Gets a collection with all server channels with the given name.default java.util.Optional<ServerForumChannel>getServerForumChannelById(long id)Gets a server forum channel by its id.default java.util.Optional<ServerForumChannel>getServerForumChannelById(java.lang.String id)Gets a server forum channel by its id.java.util.Set<ServerForumChannel>getServerForumChannels()Gets a set with all server forum channels of the bot.default java.util.Set<ServerForumChannel>getServerForumChannelsByName(java.lang.String name)Gets a collection with all server forum channels with the given name.default java.util.Set<ServerForumChannel>getServerForumChannelsByNameIgnoreCase(java.lang.String name)Gets a collection with all server forum channels with the given name.java.util.concurrent.CompletableFuture<MessageContextMenu>getServerMessageContextMenuById(Server server, long commandId)Gets a server message context menu by its id.java.util.concurrent.CompletableFuture<java.util.List<MessageContextMenu>>getServerMessageContextMenus(Server server)Gets a list with all message context menus for the given server.java.util.Collection<Server>getServers()Gets a collection with all servers the bot is in.default java.util.Collection<Server>getServersByName(java.lang.String name)Gets a collection with all servers with the given name.default java.util.Collection<Server>getServersByNameIgnoreCase(java.lang.String name)Gets a collection with all servers with the given name.java.util.concurrent.CompletableFuture<SlashCommand>getServerSlashCommandById(Server server, long commandId)Gets a server slash command by its id.java.util.concurrent.CompletableFuture<java.util.List<SlashCommand>>getServerSlashCommands(Server server)Gets a list with all slash commands for the given server.default java.util.Optional<ServerStageVoiceChannel>getServerStageVoiceChannelById(long id)Gets a server stage voice channel by its id.default java.util.Optional<ServerStageVoiceChannel>getServerStageVoiceChannelById(java.lang.String id)Gets a server stage voice channel by its id.java.util.Collection<ServerStageVoiceChannel>getServerStageVoiceChannels()Gets a collection with all server stage voice channels of the bot.default java.util.Collection<ServerStageVoiceChannel>getServerStageVoiceChannelsByName(java.lang.String name)Gets a collection with all server stage voice channels with the given name.default java.util.Collection<ServerStageVoiceChannel>getServerStageVoiceChannelsByNameIgnoreCase(java.lang.String name)Gets a collection with all server stage voice channels with the given name.default java.util.Optional<ServerTextChannel>getServerTextChannelById(long id)Gets a server text channel by its id.default java.util.Optional<ServerTextChannel>getServerTextChannelById(java.lang.String id)Gets a server text channel by its id.java.util.Collection<ServerTextChannel>getServerTextChannels()Gets a collection with all server text channels of the bot.default java.util.Collection<ServerTextChannel>getServerTextChannelsByName(java.lang.String name)Gets a collection with all server text channels with the given name.default java.util.Collection<ServerTextChannel>getServerTextChannelsByNameIgnoreCase(java.lang.String name)Gets a collection with all server text channels with the given name.default java.util.Optional<ServerThreadChannel>getServerThreadChannelById(long id)Gets a server thread channel by its id.default java.util.Optional<ServerThreadChannel>getServerThreadChannelById(java.lang.String id)Gets a server thread channel by its id.java.util.Set<ServerThreadChannel>getServerThreadChannels()Gets a set with all the server thread channels of the bot.default java.util.Set<ServerThreadChannel>getServerThreadChannelsByName(java.lang.String name)Gets a set with all server thread channels with the given name.default java.util.Set<ServerThreadChannel>getServerThreadChannelsByNameIgnoreCase(java.lang.String name)Gets a set with all server thread channels with the given name.java.util.concurrent.CompletableFuture<UserContextMenu>getServerUserContextMenuById(Server server, long commandId)Gets a server user context menu by its id.java.util.concurrent.CompletableFuture<java.util.List<UserContextMenu>>getServerUserContextMenus(Server server)Gets a list with all user context menus for the given server.default java.util.Optional<ServerVoiceChannel>getServerVoiceChannelById(long id)Gets a server voice channel by its id.default java.util.Optional<ServerVoiceChannel>getServerVoiceChannelById(java.lang.String id)Gets a server voice channel by its id.java.util.Collection<ServerVoiceChannel>getServerVoiceChannels()Gets a collection with all server voice channels of the bot.default java.util.Collection<ServerVoiceChannel>getServerVoiceChannelsByName(java.lang.String name)Gets a collection with all server voice channels with the given name.default java.util.Collection<ServerVoiceChannel>getServerVoiceChannelsByNameIgnoreCase(java.lang.String name)Gets a collection with all server voice channels with the given name.UserStatusgetStatus()Gets the status which should be displayed for this bot.java.util.Optional<Sticker>getStickerById(long id)Gets a sticker by its ID.default java.util.Optional<Sticker>getStickerById(java.lang.String id)Gets a sticker by its ID.default java.util.Optional<TextChannel>getTextChannelById(long id)Gets a text channel by its id.default java.util.Optional<TextChannel>getTextChannelById(java.lang.String id)Gets a text channel by its id.java.util.Collection<TextChannel>getTextChannels()Gets a collection with all text channels of the bot.default java.util.Collection<TextChannel>getTextChannelsByName(java.lang.String name)Gets a collection with all text channels with the given name.default java.util.Collection<TextChannel>getTextChannelsByNameIgnoreCase(java.lang.String name)Gets a collection with all text channels with the given name.ThreadPoolgetThreadPool()Gets the thread pool which is internally used.java.lang.StringgetToken()Gets the used token.intgetTotalShards()Gets the total amount of shards.java.util.Collection<java.lang.Long>getUnavailableServers()Gets a collection with the ids of all unavailable servers.UncachedMessageUtilgetUncachedMessageUtil()Gets a utility class to interact with uncached messages.java.util.concurrent.CompletableFuture<User>getUserById(long id)Gets a user by its id.default java.util.concurrent.CompletableFuture<User>getUserById(java.lang.String id)Gets a user by its id.default java.util.Optional<VoiceChannel>getVoiceChannelById(long id)Gets a voice channel by its id.default java.util.Optional<VoiceChannel>getVoiceChannelById(java.lang.String id)Gets a voice channel by its id.java.util.Collection<VoiceChannel>getVoiceChannels()Gets a collection with all voice channels of the bot.default java.util.Collection<VoiceChannel>getVoiceChannelsByName(java.lang.String name)Gets a collection with all voice channels with the given name.default java.util.Collection<VoiceChannel>getVoiceChannelsByNameIgnoreCase(java.lang.String name)Gets a collection with all voice channels with the given name.java.util.concurrent.CompletableFuture<Webhook>getWebhookById(long id)Gets a webhook by its id.UsergetYourself()Gets a user of the connected account.default booleanhasAllUsersInCache()Checks if all users of available servers are in the cache.booleanisDefaultAutomaticMessageCacheCleanupEnabled()Gets whether automatic message cache cleanup is enabled.booleanisUserCacheEnabled()Checks if the user cache is enabled.booleanisWaitingForServersOnStartup()Checks if Javacord is waiting for all servers to become available on startup.booleanisWaitingForUsersOnStartup()Checks if Javacord is waiting for all servers to get cached on startup.default java.lang.StringmakeMentionsReadable(java.lang.String content)Gets the readable content of the string, which replaces all mentions etc.default java.lang.StringmakeMentionsReadable(java.lang.String content, Server server)Gets the readable content of the string, which replaces all mentions etc.java.util.concurrent.CompletableFuture<java.time.Duration>measureRestLatency()Measures, how long Javacord will need to perform a single REST call.java.util.concurrent.CompletableFuture<Sticker>requestStickerById(long id)Requests a sticker by its ID from the Discord API.default java.util.concurrent.CompletableFuture<Sticker>requestStickerById(java.lang.String id)Requests a sticker by its ID from the Discord API.voidsetAutomaticMessageCacheCleanupEnabled(boolean automaticMessageCacheCleanupEnabled)Sets whether automatic message cache cleanup is enabled for all existing message caches and all newly created ones.voidsetEventsDispatchable(boolean dispatchEvents)Sets whether this API instance can dispatch events.voidsetMessageCacheSize(int capacity, int storageTimeInSeconds)Sets the cache size of all caches.voidsetReconnectDelay(java.util.function.Function<java.lang.Integer,java.lang.Integer> reconnectDelayProvider)Sets a function which is used to get the delay between reconnects.voidunsetActivity()Unsets the activity of this bot.voidupdateActivity(java.lang.String name)Updates the activity of this bot, represented as "Playing Half-Life 3" for example.voidupdateActivity(java.lang.String name, java.lang.String streamingUrl)Updates the activity of this bot with a streaming url, represented as "Streaming Half-Life 3" for example.voidupdateActivity(ActivityType type, java.lang.String name)Updates the activity of this bot with any type.default java.util.concurrent.CompletableFuture<java.lang.Void>updateAvatar(byte[] avatar)Updates the avatar of the current account.default java.util.concurrent.CompletableFuture<java.lang.Void>updateAvatar(byte[] avatar, java.lang.String fileType)Updates the avatar of the current account.default java.util.concurrent.CompletableFuture<java.lang.Void>updateAvatar(java.awt.image.BufferedImage avatar)Updates the avatar of the current account.default java.util.concurrent.CompletableFuture<java.lang.Void>updateAvatar(java.awt.image.BufferedImage avatar, java.lang.String fileType)Updates the avatar of the current account.default java.util.concurrent.CompletableFuture<java.lang.Void>updateAvatar(java.io.File avatar)Updates the avatar of the current account.default java.util.concurrent.CompletableFuture<java.lang.Void>updateAvatar(java.io.InputStream avatar)Updates the avatar of the current account.default java.util.concurrent.CompletableFuture<java.lang.Void>updateAvatar(java.io.InputStream avatar, java.lang.String fileType)Updates the avatar of the current account.default java.util.concurrent.CompletableFuture<java.lang.Void>updateAvatar(java.net.URL avatar)Updates the avatar of the current account.default java.util.concurrent.CompletableFuture<java.lang.Void>updateAvatar(Icon avatar)Updates the avatar of the current account.voidupdateStatus(UserStatus status)Updates the status of this bot.default java.util.concurrent.CompletableFuture<java.lang.Void>updateUsername(java.lang.String username)Updates the username of the current account.-
Methods inherited from interface org.javacord.api.listener.GloballyAttachableListenerManager
addApplicationCommandPermissionsUpdateListener, addAudioSourceFinishedListener, addAutocompleteCreateListener, addButtonClickListener, addCachedMessagePinListener, addCachedMessageUnpinListener, addChannelPinsUpdateListener, addInteractionCreateListener, addKnownCustomEmojiChangeNameListener, addKnownCustomEmojiChangeWhitelistedRolesListener, addKnownCustomEmojiCreateListener, addKnownCustomEmojiDeleteListener, addListener, addListener, addLostConnectionListener, addMessageComponentCreateListener, addMessageContextMenuCommandListener, addMessageCreateListener, addMessageDeleteListener, addMessageEditListener, addModalSubmitListener, addPrivateChannelCreateListener, addPrivateChannelDeleteListener, addReactionAddListener, addReactionRemoveAllListener, addReactionRemoveListener, addReconnectListener, addResumeListener, addRoleChangeColorListener, addRoleChangeHoistListener, addRoleChangeMentionableListener, addRoleChangeNameListener, addRoleChangePermissionsListener, addRoleChangePositionListener, addRoleCreateListener, addRoleDeleteListener, addSelectMenuChooseListener, addServerBecomesAvailableListener, addServerBecomesUnavailableListener, addServerChangeAfkChannelListener, addServerChangeAfkTimeoutListener, addServerChangeBoostCountListener, addServerChangeBoostLevelListener, addServerChangeDefaultMessageNotificationLevelListener, addServerChangeDescriptionListener, addServerChangeDiscoverySplashListener, addServerChangeExplicitContentFilterLevelListener, addServerChangeIconListener, addServerChangeModeratorsOnlyChannelListener, addServerChangeMultiFactorAuthenticationLevelListener, addServerChangeNameListener, addServerChangeNsfwLevelListener, addServerChangeOwnerListener, addServerChangePreferredLocaleListener, addServerChangeRegionListener, addServerChangeRulesChannelListener, addServerChangeServerFeatureListener, addServerChangeSplashListener, addServerChangeSystemChannelListener, addServerChangeVanityUrlCodeListener, addServerChangeVerificationLevelListener, addServerChannelChangeNameListener, addServerChannelChangeNsfwFlagListener, addServerChannelChangeOverwrittenPermissionsListener, addServerChannelChangePositionListener, addServerChannelCreateListener, addServerChannelDeleteListener, addServerChannelInviteCreateListener, addServerChannelInviteDeleteListener, addServerJoinListener, addServerLeaveListener, addServerMemberBanListener, addServerMemberJoinListener, addServerMemberLeaveListener, addServerMembersChunkListener, addServerMemberUnbanListener, addServerStageVoiceChannelChangeTopicListener, addServerTextChannelChangeDefaultAutoArchiveDurationListener, addServerTextChannelChangeSlowmodeListener, addServerTextChannelChangeTopicListener, addServerThreadChannelCreateListener, addServerThreadChannelDeleteListener, addServerThreadChannelMembersUpdateListener, addServerThreadChannelUpdateListener, addServerThreadListSyncListener, addServerVoiceChannelChangeBitrateListener, addServerVoiceChannelChangeUserLimitListener, addServerVoiceChannelMemberJoinListener, addServerVoiceChannelMemberLeaveListener, addSlashCommandCreateListener, addStickerChangeDescriptionListener, addStickerChangeNameListener, addStickerChangeTagsListener, addStickerCreateListener, addStickerDeleteListener, addUserChangeActivityListener, addUserChangeAvatarListener, addUserChangeDeafenedListener, addUserChangeDiscriminatorListener, addUserChangeMutedListener, addUserChangeNameListener, addUserChangeNicknameListener, addUserChangePendingListener, addUserChangeSelfDeafenedListener, addUserChangeSelfMutedListener, addUserChangeServerAvatarListener, addUserChangeStatusListener, addUserChangeTimeoutListener, addUserContextMenuCommandListener, addUserRoleAddListener, addUserRoleRemoveListener, addUserStartTypingListener, addVoiceServerUpdateListener, addVoiceStateUpdateListener, addWebhooksUpdateListener, getApplicationCommandPermissionsUpdateListeners, getAudioSourceFinishedListeners, getAutocompleteCreateListeners, getButtonClickListeners, getCachedMessagePinListeners, getCachedMessageUnpinListeners, getChannelPinsUpdateListeners, getInteractionCreateListeners, getKnownCustomEmojiChangeNameListeners, getKnownCustomEmojiChangeWhitelistedRolesListeners, getKnownCustomEmojiCreateListeners, getKnownCustomEmojiDeleteListeners, getListeners, getListeners, getLostConnectionListeners, getMessageComponentCreateListeners, getMessageContextMenuCommandListeners, getMessageCreateListeners, getMessageDeleteListeners, getMessageEditListeners, getModalSubmitListeners, getPrivateChannelCreateListeners, getPrivateChannelDeleteListeners, getReactionAddListeners, getReactionRemoveAllListeners, getReactionRemoveListeners, getReconnectListeners, getResumeListeners, getRoleChangeColorListeners, getRoleChangeHoistListeners, getRoleChangeMentionableListeners, getRoleChangeNameListeners, getRoleChangePermissionsListeners, getRoleChangePositionListeners, getRoleCreateListeners, getRoleDeleteListeners, getSelectMenuChooseListeners, getServerBecomesAvailableListeners, getServerBecomesUnavailableListeners, getServerChangeAfkChannelListeners, getServerChangeAfkTimeoutListeners, getServerChangeBoostCountListeners, getServerChangeBoostLevelListeners, getServerChangeDefaultMessageNotificationLevelListeners, getServerChangeDescriptionListeners, getServerChangeDiscoverySplashListeners, getServerChangeExplicitContentFilterLevelListeners, getServerChangeIconListeners, getServerChangeModeratorsOnlyChannelListeners, getServerChangeMultiFactorAuthenticationLevelListeners, getServerChangeNameListeners, getServerChangeNsfwLevelListeners, getServerChangeOwnerListeners, getServerChangePreferredLocaleListeners, getServerChangeRegionListeners, getServerChangeRulesChannelListeners, getServerChangeServerFeatureListeners, getServerChangeSplashListeners, getServerChangeSystemChannelListeners, getServerChangeVanityUrlCodeListeners, getServerChangeVerificationLevelListeners, getServerChannelChangeNameListeners, getServerChannelChangeNsfwFlagListeners, getServerChannelChangeOverwrittenPermissionsListeners, getServerChannelChangePositionListeners, getServerChannelCreateListeners, getServerChannelDeleteListeners, getServerChannelInviteCreateListeners, getServerChannelInviteDeleteListeners, getServerJoinListeners, getServerLeaveListeners, getServerMemberBanListeners, getServerMemberJoinListeners, getServerMemberLeaveListeners, getServerMembersChunkListeners, getServerMemberUnbanListeners, getServerStageVoiceChannelChangeTopicListeners, getServerTextChannelChangeDefaultAutoArchiveDurationListeners, getServerTextChannelChangeSlowmodeListeners, getServerTextChannelChangeTopicListeners, getServerThreadChannelCreateListeners, getServerThreadChannelDeleteListeners, getServerThreadChannelMembersUpdateListeners, getServerThreadChannelUpdateListeners, getServerThreadListSyncListeners, getServerVoiceChannelChangeBitrateListeners, getServerVoiceChannelChangeUserLimitListeners, getServerVoiceChannelMemberJoinListeners, getServerVoiceChannelMemberLeaveListeners, getSlashCommandCreateListeners, getStickerChangeDescriptionListeners, getStickerChangeNameListeners, getStickerChangeTagsListeners, getStickerCreateListeners, getStickerDeleteListeners, getUserChangeActivityListeners, getUserChangeAvatarListeners, getUserChangeDeafenedListeners, getUserChangeDiscriminatorListeners, getUserChangeMutedListeners, getUserChangeNameListeners, getUserChangeNicknameListeners, getUserChangePendingListeners, getUserChangeSelfDeafenedListeners, getUserChangeSelfMutedListeners, getUserChangeServerAvatarListeners, getUserChangeStatusListeners, getUserChangeTimeoutListeners, getUserContextMenuCommandListeners, getUserRoleAddListeners, getUserRoleRemoveListeners, getUserStartTypingListeners, getVoiceServerUpdateListeners, getVoiceStateUpdateListeners, getWebhooksUpdateListeners, removeListener, removeListener
-
-
-
-
Method Detail
-
getToken
java.lang.String getToken()
Gets the used token.- Returns:
- The used token.
-
getPrefixedToken
java.lang.String getPrefixedToken()
Gets the used token with the bot prefix, that way it is usable directly in the authentication header for custom REST calls.- Returns:
- The prefixed, used token.
-
getIntents
java.util.Set<Intent> getIntents()
Gets the intents used to receive some or all events specified inIntent.- Returns:
- The intents for the events.
-
getThreadPool
ThreadPool getThreadPool()
Gets the thread pool which is internally used.- Returns:
- The internally used thread pool.
-
setEventsDispatchable
void setEventsDispatchable(boolean dispatchEvents)
Sets whether this API instance can dispatch events.- Parameters:
dispatchEvents- Whether events can be dispatched.
-
canDispatchEvents
boolean canDispatchEvents()
Gets whether this API instance can dispatch events.- Returns:
- Whether events can be dispatched.
-
getGlobalApplicationCommands
java.util.concurrent.CompletableFuture<java.util.List<ApplicationCommand>> getGlobalApplicationCommands()
Gets a list with all global commands for the application.- Returns:
- A list with all global commands.
-
getGlobalApplicationCommandById
java.util.concurrent.CompletableFuture<ApplicationCommand> getGlobalApplicationCommandById(long applicationCommandId)
Gets an application command by its id.- Parameters:
applicationCommandId- The id of the application command.- Returns:
- The application command with the given id.
-
getServerApplicationCommands
java.util.concurrent.CompletableFuture<java.util.List<ApplicationCommand>> getServerApplicationCommands(Server server)
Gets a list with all application commands for the given server.- Parameters:
server- The server to get the application commands from.- Returns:
- A list with all application commands from the server.
-
getServerApplicationCommandById
java.util.concurrent.CompletableFuture<ApplicationCommand> getServerApplicationCommandById(Server server, long applicationCommandId)
Gets a server application command by its id.- Parameters:
server- The server to get the application commands from.applicationCommandId- The id of the server application command.- Returns:
- The server application command with the given id.
-
getGlobalSlashCommands
java.util.concurrent.CompletableFuture<java.util.List<SlashCommand>> getGlobalSlashCommands()
Gets a list with all global slash commands for the application.- Returns:
- A list with all global slash commands.
-
getGlobalSlashCommandById
java.util.concurrent.CompletableFuture<SlashCommand> getGlobalSlashCommandById(long commandId)
Gets a slash command by its id.- Parameters:
commandId- The id of the slash command.- Returns:
- The slash command with the given id.
-
getServerSlashCommands
java.util.concurrent.CompletableFuture<java.util.List<SlashCommand>> getServerSlashCommands(Server server)
Gets a list with all slash commands for the given server.- Parameters:
server- The server to get the slash commands from.- Returns:
- A list with all slash commands from the server.
-
getServerSlashCommandById
java.util.concurrent.CompletableFuture<SlashCommand> getServerSlashCommandById(Server server, long commandId)
Gets a server slash command by its id.- Parameters:
server- The server to get the slash commands from.commandId- The id of the server slash command.- Returns:
- The server slash command with the given id.
-
getGlobalUserContextMenus
java.util.concurrent.CompletableFuture<java.util.List<UserContextMenu>> getGlobalUserContextMenus()
Gets a list with all global user context menus for the application.- Returns:
- A list with all global user context menus.
-
getGlobalUserContextMenuById
java.util.concurrent.CompletableFuture<UserContextMenu> getGlobalUserContextMenuById(long commandId)
Gets a global user context menu by its id.- Parameters:
commandId- The id of the user context menu.- Returns:
- The user context menu with the given id.
-
getServerUserContextMenus
java.util.concurrent.CompletableFuture<java.util.List<UserContextMenu>> getServerUserContextMenus(Server server)
Gets a list with all user context menus for the given server.- Parameters:
server- The server to get the user context menus from.- Returns:
- A list with all user context menus from the server.
-
getServerUserContextMenuById
java.util.concurrent.CompletableFuture<UserContextMenu> getServerUserContextMenuById(Server server, long commandId)
Gets a server user context menu by its id.- Parameters:
server- The server to get the user context menu from.commandId- The id of the server user context menu.- Returns:
- The server user context menu with the given id.
-
getGlobalMessageContextMenus
java.util.concurrent.CompletableFuture<java.util.List<MessageContextMenu>> getGlobalMessageContextMenus()
Gets a list with all global message context menus for the application.- Returns:
- A list with all global message context menus.
-
getGlobalMessageContextMenuById
java.util.concurrent.CompletableFuture<MessageContextMenu> getGlobalMessageContextMenuById(long commandId)
Gets a global message context menu by its id.- Parameters:
commandId- The id of the message context menu.- Returns:
- The message context menu with the given id.
-
getServerMessageContextMenus
java.util.concurrent.CompletableFuture<java.util.List<MessageContextMenu>> getServerMessageContextMenus(Server server)
Gets a list with all message context menus for the given server.- Parameters:
server- The server to get the message context menus from.- Returns:
- A list with all message context menus from the server.
-
getServerMessageContextMenuById
java.util.concurrent.CompletableFuture<MessageContextMenu> getServerMessageContextMenuById(Server server, long commandId)
Gets a server message context menu by its id.- Parameters:
server- The server to get the message context menu from.commandId- The id of the server message context menu.- Returns:
- The server message context menu with the given id.
-
getServerApplicationCommandPermissions
java.util.concurrent.CompletableFuture<java.util.List<ServerApplicationCommandPermissions>> getServerApplicationCommandPermissions(Server server)
Gets a list of all server application command permissions from the given server.- Parameters:
server- The server.- Returns:
- A list containing the server application command permissions.
-
getServerApplicationCommandPermissionsById
java.util.concurrent.CompletableFuture<ServerApplicationCommandPermissions> getServerApplicationCommandPermissionsById(Server server, long commandId)
Gets a server application command permissions by it ID from the given server.- Parameters:
server- The server.commandId- The command ID.- Returns:
- The server application command permissions for the given ID.
-
bulkOverwriteGlobalApplicationCommands
java.util.concurrent.CompletableFuture<java.util.List<ApplicationCommand>> bulkOverwriteGlobalApplicationCommands(java.util.List<? extends ApplicationCommandBuilder<?,?,?>> applicationCommandBuilderList)
Bulk overwrites the global application commands. This should be preferably used when updating and/or creating multiple application commands at once instead ofApplicationCommandUpdater.updateGlobal(DiscordApi)andApplicationCommandBuilder.createGlobal(DiscordApi)- Parameters:
applicationCommandBuilderList- A list containing the ApplicationCommandBuilders which should be used to perform the bulk overwrite.- Returns:
- A list containing all application commands.
-
bulkOverwriteServerApplicationCommands
default java.util.concurrent.CompletableFuture<java.util.List<ApplicationCommand>> bulkOverwriteServerApplicationCommands(Server server, java.util.List<? extends ApplicationCommandBuilder<?,?,?>> applicationCommandBuilderList)
Bulk overwrites the servers application commands. This should be preferably used when updating and/or creating multiple application commands at once instead ofApplicationCommandUpdater.updateForServer(Server)andApplicationCommandBuilder.createForServer(Server)- Parameters:
applicationCommandBuilderList- A list containing the ApplicationCommandBuilders.server- The server where the bulk overwrite should be performed on which should be used to perform the bulk overwrite.- Returns:
- A list containing all application commands.
-
bulkOverwriteServerApplicationCommands
java.util.concurrent.CompletableFuture<java.util.List<ApplicationCommand>> bulkOverwriteServerApplicationCommands(long server, java.util.List<? extends ApplicationCommandBuilder<?,?,?>> applicationCommandBuilderList)
Bulk overwrites the servers application commands. This should be preferably used when updating and/or creating multiple application commands at once instead ofApplicationCommandUpdater.updateForServer(Server)andApplicationCommandBuilder.createForServer(Server)- Parameters:
server- The server where the bulk overwrite should be performed on which should be used to perform the bulk overwrite.applicationCommandBuilderList- A list containing the ApplicationCommandBuilders.- Returns:
- A list containing all application commands.
-
getUncachedMessageUtil
UncachedMessageUtil getUncachedMessageUtil()
Gets a utility class to interact with uncached messages.- Returns:
- A utility class to interact with uncached messages.
-
getGlobalRatelimiter
java.util.Optional<Ratelimiter> getGlobalRatelimiter()
Gets the current global ratelimiter.**Note:** This method returns an
Optionalfor historic reasons. If you did not provide a ratelimiter by yourself, this method will return aLocalRatelimiterwhich is set to5requests per112 ms, resulting in about 45 requests per second. This ratelimiter is shared by every bot with the same token in the same Java program.- Returns:
- The current global ratelimiter.
-
getGatewayIdentifyRatelimiter
Ratelimiter getGatewayIdentifyRatelimiter()
Gets the current gateway identify ratelimiter.If you did not provide a ratelimiter yourself, this method will return a
LocalRatelimiterwhich is set to allow one gateway identify request per 5500ms and is shared with every bot with the same token in the same Java program.- Returns:
- The current gateway identify ratelimiter.
-
getLatestGatewayLatency
java.time.Duration getLatestGatewayLatency()
Gets the latest gateway latency.To calculate the gateway latency, Javacord measures the time it takes for Discord to answer the gateway heartbeat packet with a heartbeat ack packet. Please notice, that this values does only get updated on every heartbeat and not on every method call. To calculate an average, you have to collect the latency over a period of multiple minutes.
In very rare cases, the latency will be
-1 nsdirectly after startup, because the initial heartbeat was not answered yet. Usually, the heartbeat is answered before the bot finished loading.Expected latency: Usually, you can expect a latency between
30 msand300 mswith a good internet connection. This value may vary, depending on your location, time of day, Discord's status, and the current workload of your system. A value above1000 msis usually an indicator that something is wrong.- Returns:
- The latest measured gateway latency.
-
measureRestLatency
java.util.concurrent.CompletableFuture<java.time.Duration> measureRestLatency()
Measures, how long Javacord will need to perform a single REST call.This method does not measure the "true" latency to Discord's REST endpoints because the request is handled by Javacord like any other request, including rate-limit handling. This causes some small delays that negatively affects the latency. However, this provides a somewhat realistic measurement on how long a typical REST call of Javacord will need. The latency is influenced by many non-network related factors like your system's current workload.
This method uses the
GET /users/@meendpoint to test the latency. The method ensures that only one ping measurement is performed at once by the sameDiscordApiinstance.Warning: This method does not bypass the global ratelimit check. If your bot gets ratelimited globally, the latency will appear higher that it really is!
Expected latency: Usually, you can expect a latency between
50 msand500 mswith a good internet connection. This value may vary, depending on your location, time of day, Discord's status, and the current workload of your system. A value above1000 msis usually an indicator that something is wrong. It is recommended to perform multiple tests and calculate an average value.- Returns:
- The measured latency.
-
createBotInvite
default java.lang.String createBotInvite()
Creates an invite link for this bot. The method only works for bot accounts!- Returns:
- An invite link for this bot.
-
createBotInvite
default java.lang.String createBotInvite(Permissions permissions)
Creates an invite link for this bot. The method only works for bot accounts!- Parameters:
permissions- The permissions which should be granted to the bot.- Returns:
- An invite link for this bot.
-
setMessageCacheSize
void setMessageCacheSize(int capacity, int storageTimeInSeconds)Sets the cache size of all caches. These settings are applied on a per-channel basis. It overrides all previous settings, so it's recommended to directly set it after logging in, if you want to change some channel specific cache settings, too. Please notice that the cache is cleared only once every minute!- Parameters:
capacity- The capacity of the message cache.storageTimeInSeconds- The maximum age of cached messages.
-
getDefaultMessageCacheCapacity
int getDefaultMessageCacheCapacity()
Gets the default message cache capacity which is applied for every newly created channel.- Returns:
- The default message cache capacity which is applied for every newly created channel.
-
getDefaultMessageCacheStorageTimeInSeconds
int getDefaultMessageCacheStorageTimeInSeconds()
Gets the default maximum age of cached messages.- Returns:
- The default maximum age of cached messages.
-
setAutomaticMessageCacheCleanupEnabled
void setAutomaticMessageCacheCleanupEnabled(boolean automaticMessageCacheCleanupEnabled)
Sets whether automatic message cache cleanup is enabled for all existing message caches and all newly created ones.- Parameters:
automaticMessageCacheCleanupEnabled- Whether automatic message cache cleanup is enabled.
-
isDefaultAutomaticMessageCacheCleanupEnabled
boolean isDefaultAutomaticMessageCacheCleanupEnabled()
Gets whether automatic message cache cleanup is enabled.- Returns:
- Whether automatic message cache cleanup is enabled.
-
getCurrentShard
int getCurrentShard()
Gets the current shard of the bot, starting with0.- Returns:
- The current shard of the bot.
-
getTotalShards
int getTotalShards()
Gets the total amount of shards. If the total amount is0sharding is disabled.- Returns:
- The total amount of shards.
-
isWaitingForServersOnStartup
boolean isWaitingForServersOnStartup()
Checks if Javacord is waiting for all servers to become available on startup.- Returns:
- Whether Javacord is waiting for all servers to become available on startup or not.
-
isWaitingForUsersOnStartup
boolean isWaitingForUsersOnStartup()
Checks if Javacord is waiting for all servers to get cached on startup.- Returns:
- Whether Javacord is waiting for all users to get cached on startup or not.
-
updateStatus
void updateStatus(UserStatus status)
Updates the status of this bot. The update might not be visible immediately as it's through the websocket and only a limited amount of status changes is allowed per minute.- Parameters:
status- The status of this bot.
-
getStatus
UserStatus getStatus()
Gets the status which should be displayed for this bot. This might not be the status which is really displayed in the client, but it's the status which Javacord is trying to set for your bot, so it might change in the client a few seconds afterwards.- Returns:
- The status which should be displayed for this bot.
-
updateActivity
void updateActivity(java.lang.String name)
Updates the activity of this bot, represented as "Playing Half-Life 3" for example.- Parameters:
name- The name of the activity.
-
updateActivity
void updateActivity(ActivityType type, java.lang.String name)
Updates the activity of this bot with any type.- Parameters:
type- The type of the activity.name- The name of the activity.
-
updateActivity
void updateActivity(java.lang.String name, java.lang.String streamingUrl)Updates the activity of this bot with a streaming url, represented as "Streaming Half-Life 3" for example. The update might not be visible immediately as it's through the websocket and only a limited amount of activity status changes is allowed per minute.- Parameters:
name- The name of the activity.streamingUrl- The streaming url of the activity.
-
unsetActivity
void unsetActivity()
Unsets the activity of this bot.
-
getActivity
java.util.Optional<Activity> getActivity()
Gets the activity which should be displayed. This might not be the activity which is really displayed in the client, but it's the activity which Javacord is trying to set for your bot, so it might change in the client a few seconds afterwards.- Returns:
- The activity which should be displayed.
-
getYourself
User getYourself()
Gets a user of the connected account. This may be a bot user (for normal bots), or a regular user (for client-bots).- Returns:
- The user of the connected account.
-
getOwnerId
long getOwnerId()
Gets the id of the application's owner.- Returns:
- The id of the application's owner.
-
getOwner
default java.util.concurrent.CompletableFuture<User> getOwner()
Gets the owner of the application.- Returns:
- The owner of the application.
-
getClientId
long getClientId()
Gets the client id of the application.- Returns:
- The client id of the application.
-
disconnect
java.util.concurrent.CompletableFuture<java.lang.Void> disconnect()
Disconnects the bot. After disconnecting you should NOT use this instance again.- Returns:
- A future that completes once the disconnect is finished.
-
setReconnectDelay
void setReconnectDelay(java.util.function.Function<java.lang.Integer,java.lang.Integer> reconnectDelayProvider)
Sets a function which is used to get the delay between reconnects.- Parameters:
reconnectDelayProvider- A function which gets the amount of reconnects (starting with1) as the parameter and should return the delay in seconds to wait for the next reconnect attempt. By default, the function reconnect delay is calculated using the following equation:f(x): (x^1.5-(1/(1/(0.1*x)+1))*x^1.5)+(currentShard*6). This would result in a delay which looks like this for a bot with 1 shard:
Too many reconnect attempts may cause a token reset (usually 1000 per day), so you should always make sure to not provide a function which might exceed this limit. You should also make sure to take into account the amount of shards!Attempt Delay 1 1 2 2 3 4 4 6 5 7 ... ... 10 16 15 23 20 30 ... ... 50 59 100 91 150 115 ... ...
-
getReconnectDelay
int getReconnectDelay(int attempt)
Gets the reconnect delay for a given amount of attempts.- Parameters:
attempt- The amount of attempts (starting with1)- Returns:
- The reconnect delay in seconds.
-
getApplicationInfo
java.util.concurrent.CompletableFuture<ApplicationInfo> getApplicationInfo()
Gets the application info of the bot. The method only works for bot accounts.- Returns:
- The application info of the bot.
-
getWebhookById
java.util.concurrent.CompletableFuture<Webhook> getWebhookById(long id)
Gets a webhook by its id.- Parameters:
id- The id of the webhook.- Returns:
- The webhook with the given id.
-
getIncomingWebhookByIdAndToken
java.util.concurrent.CompletableFuture<IncomingWebhook> getIncomingWebhookByIdAndToken(java.lang.String id, java.lang.String token)
Gets an incoming webhook by its id and its token.- Parameters:
id- The id of the incoming webhook.token- The token of the incoming webhook.- Returns:
- The incoming webhook with the given id.
-
getIncomingWebhookByIdAndToken
default java.util.concurrent.CompletableFuture<IncomingWebhook> getIncomingWebhookByIdAndToken(long id, java.lang.String token)
Gets an incoming webhook by its id and its token.- Parameters:
id- The id of the incoming webhook.token- The token of the incoming webhook.- Returns:
- The incoming webhook with the given id.
-
getIncomingWebhookByUrl
default java.util.concurrent.CompletableFuture<IncomingWebhook> getIncomingWebhookByUrl(java.lang.String url) throws java.lang.IllegalArgumentException
Gets a webhook by its url.- Parameters:
url- The url of the message.- Returns:
- The incoming webhook with the given url.
- Throws:
java.lang.IllegalArgumentException- If the link isn't valid.
-
getUnavailableServers
java.util.Collection<java.lang.Long> getUnavailableServers()
Gets a collection with the ids of all unavailable servers.- Returns:
- A collection with the ids of all unavailable servers.
-
getInviteByCode
java.util.concurrent.CompletableFuture<Invite> getInviteByCode(java.lang.String code)
Gets an invite by its code.- Parameters:
code- The code of the invite.- Returns:
- The invite with the given code.
-
getInviteWithMemberCountsByCode
java.util.concurrent.CompletableFuture<Invite> getInviteWithMemberCountsByCode(java.lang.String code)
Gets an invite by its code while requesting additional information.- Parameters:
code- The code of the invite.- Returns:
- The invite with the given code.
-
createServerBuilder
default ServerBuilder createServerBuilder()
Creates a server builder which can be used to create servers.- Returns:
- A server builder.
-
createAccountUpdater
default AccountUpdater createAccountUpdater()
Creates an account updater for the current account.- Returns:
- An account updater for the current account.
-
updateUsername
default java.util.concurrent.CompletableFuture<java.lang.Void> updateUsername(java.lang.String username)
Updates the username of the current account.If you want to update several settings at once, it's recommended to use the
AccountUpdaterfromcreateAccountUpdater()which provides a better performance!- Parameters:
username- The new username.- Returns:
- A future to check if the update was successful.
-
updateAvatar
default java.util.concurrent.CompletableFuture<java.lang.Void> updateAvatar(java.awt.image.BufferedImage avatar)
Updates the avatar of the current account. This method assumes the file type is "png"!If you want to update several settings at once, it's recommended to use the
AccountUpdaterfromcreateAccountUpdater()which provides a better performance!- Parameters:
avatar- The new avatar.- Returns:
- A future to check if the update was successful.
-
updateAvatar
default java.util.concurrent.CompletableFuture<java.lang.Void> updateAvatar(java.awt.image.BufferedImage avatar, java.lang.String fileType)Updates the avatar of the current account.If you want to update several settings at once, it's recommended to use the
AccountUpdaterfromcreateAccountUpdater()which provides a better performance!- Parameters:
avatar- The new avatar.fileType- The type of the avatar, e.g. "png" or "jpg".- Returns:
- A future to check if the update was successful.
-
updateAvatar
default java.util.concurrent.CompletableFuture<java.lang.Void> updateAvatar(java.io.File avatar)
Updates the avatar of the current account.If you want to update several settings at once, it's recommended to use the
AccountUpdaterfromcreateAccountUpdater()which provides a better performance!- Parameters:
avatar- The new avatar.- Returns:
- A future to check if the update was successful.
-
updateAvatar
default java.util.concurrent.CompletableFuture<java.lang.Void> updateAvatar(Icon avatar)
Updates the avatar of the current account.If you want to update several settings at once, it's recommended to use the
AccountUpdaterfromcreateAccountUpdater()which provides a better performance!- Parameters:
avatar- The new avatar.- Returns:
- A future to check if the update was successful.
-
updateAvatar
default java.util.concurrent.CompletableFuture<java.lang.Void> updateAvatar(java.net.URL avatar)
Updates the avatar of the current account.If you want to update several settings at once, it's recommended to use the
AccountUpdaterfromcreateAccountUpdater()which provides a better performance!- Parameters:
avatar- The new avatar.- Returns:
- A future to check if the update was successful.
-
updateAvatar
default java.util.concurrent.CompletableFuture<java.lang.Void> updateAvatar(byte[] avatar)
Updates the avatar of the current account. This method assumes the file type is "png"!If you want to update several settings at once, it's recommended to use the
AccountUpdaterfromcreateAccountUpdater()which provides a better performance!- Parameters:
avatar- The new avatar.- Returns:
- A future to check if the update was successful.
-
updateAvatar
default java.util.concurrent.CompletableFuture<java.lang.Void> updateAvatar(byte[] avatar, java.lang.String fileType)Updates the avatar of the current account.If you want to update several settings at once, it's recommended to use the
AccountUpdaterfromcreateAccountUpdater()which provides a better performance!- Parameters:
avatar- The new avatar.fileType- The type of the avatar, e.g. "png" or "jpg".- Returns:
- A future to check if the update was successful.
-
updateAvatar
default java.util.concurrent.CompletableFuture<java.lang.Void> updateAvatar(java.io.InputStream avatar)
Updates the avatar of the current account. This method assumes the file type is "png"!If you want to update several settings at once, it's recommended to use the
AccountUpdaterfromcreateAccountUpdater()which provides a better performance!- Parameters:
avatar- The new avatar.- Returns:
- A future to check if the update was successful.
-
updateAvatar
default java.util.concurrent.CompletableFuture<java.lang.Void> updateAvatar(java.io.InputStream avatar, java.lang.String fileType)Updates the avatar of the current account.If you want to update several settings at once, it's recommended to use the
AccountUpdaterfromcreateAccountUpdater()which provides a better performance!- Parameters:
avatar- The new avatar.fileType- The type of the avatar, e.g. "png" or "jpg".- Returns:
- A future to check if the update was successful.
-
isUserCacheEnabled
boolean isUserCacheEnabled()
Checks if the user cache is enabled.- Returns:
- Whether the user cache is enabled;
-
hasAllUsersInCache
default boolean hasAllUsersInCache()
Checks if all users of available servers are in the cache.- Returns:
- Whether all users of available servers are in the cache.
-
getCachedUsers
java.util.Collection<User> getCachedUsers()
Gets a collection with all currently cached users.- Returns:
- A collection with all currently cached users.
-
getCachedUserById
java.util.Optional<User> getCachedUserById(long id)
Gets a cached user by its id.- Parameters:
id- The id of the user.- Returns:
- The user with the given id.
-
getCachedUserById
default java.util.Optional<User> getCachedUserById(java.lang.String id)
Gets a cached user by its id.- Parameters:
id- The id of the user.- Returns:
- The user with the given id.
-
getUserById
java.util.concurrent.CompletableFuture<User> getUserById(long id)
Gets a user by its id.- Parameters:
id- The id of the user.- Returns:
- The user with the given id.
-
getUserById
default java.util.concurrent.CompletableFuture<User> getUserById(java.lang.String id)
Gets a user by its id.- Parameters:
id- The id of the user.- Returns:
- The user with the given id.
-
makeMentionsReadable
default java.lang.String makeMentionsReadable(java.lang.String content, Server server)Gets the readable content of the string, which replaces all mentions etc. with the actual name. The replacement happens as following:- User mentions:
@nicknameif the user has a nickname,@nameif the user has no nickname, unchanged if the user is not in the cache. - Role mentions:
@nameif the role exists in the server, otherwise#deleted-role - Channel mentions:
#nameif the text channel exists in the server, otherwise#deleted-channel - Custom emoji:
:name:. If the emoji is known, the real name is used, otherwise the name from the mention tag.
- Parameters:
content- The string to strip the mentions away.server- The server to get the display name of users from.- Returns:
- The readable content of the string.
- User mentions:
-
makeMentionsReadable
default java.lang.String makeMentionsReadable(java.lang.String content)
Gets the readable content of the string, which replaces all mentions etc. with the actual name. The replacement happens as following:- User mentions:
@nicknameif the user has a nickname,@nameif the user has no nickname, unchanged if the user is not in the cache. - Role mentions:
@nameif the role exists in the server, otherwise#deleted-role - Channel mentions:
#nameif the text channel exists in the server, otherwise#deleted-channel - Custom emoji:
:name:. If the emoji is known, the real name is used, otherwise the name from the mention tag.
- Parameters:
content- The string to strip the mentions away.- Returns:
- The readable content of the string.
- User mentions:
-
getCachedUserByDiscriminatedName
default java.util.Optional<User> getCachedUserByDiscriminatedName(java.lang.String discriminatedName)
Gets a user by its discriminated name like e.g.Bastian#8222. This method is case-sensitive!- Parameters:
discriminatedName- The discriminated name of the user.- Returns:
- The user with the given discriminated name.
-
getCachedUserByDiscriminatedNameIgnoreCase
default java.util.Optional<User> getCachedUserByDiscriminatedNameIgnoreCase(java.lang.String discriminatedName)
Gets a user by its discriminated name like e.g.Bastian#8222. This method is case-insensitive!- Parameters:
discriminatedName- The discriminated name of the user.- Returns:
- The user with the given discriminated name.
-
getCachedUserByNameAndDiscriminator
default java.util.Optional<User> getCachedUserByNameAndDiscriminator(java.lang.String name, java.lang.String discriminator)
Gets a user by its name and discriminator. This method is case-sensitive!- Parameters:
name- The name of the user.discriminator- The discriminator of the user.- Returns:
- The user with the given name and discriminator.
-
getCachedUserByNameAndDiscriminatorIgnoreCase
default java.util.Optional<User> getCachedUserByNameAndDiscriminatorIgnoreCase(java.lang.String name, java.lang.String discriminator)
Gets a user by its name and discriminator. This method is case-insensitive!- Parameters:
name- The name of the user.discriminator- The discriminator of the user.- Returns:
- The user with the given name and discriminator.
-
getCachedUsersByName
default java.util.Collection<User> getCachedUsersByName(java.lang.String name)
Gets a collection with all users with the given name. This method is case-sensitive!- Parameters:
name- The name of the users.- Returns:
- A collection with all users with the given name.
-
getCachedUsersByNameIgnoreCase
default java.util.Collection<User> getCachedUsersByNameIgnoreCase(java.lang.String name)
Gets a collection with all users with the given name. This method is case-insensitive!- Parameters:
name- The name of the users.- Returns:
- A collection with all users with the given name.
-
getCachedUsersByNickname
default java.util.Collection<User> getCachedUsersByNickname(java.lang.String nickname, Server server)
Gets a collection with all users with the given nickname on the given server. This method is case-sensitive!- Parameters:
nickname- The nickname of the users.server- The server where to lookup the nickname.- Returns:
- A collection with all users with the given nickname on the given server.
-
getCachedUsersByNicknameIgnoreCase
default java.util.Collection<User> getCachedUsersByNicknameIgnoreCase(java.lang.String nickname, Server server)
Gets a collection with all users with the given nickname on the given server. This method is case-insensitive!- Parameters:
nickname- The nickname of the users.server- The server where to lookup the nickname.- Returns:
- A collection with all users with the given nickname on the given server.
-
getCachedUsersByDisplayName
default java.util.Collection<User> getCachedUsersByDisplayName(java.lang.String displayName, Server server)
Gets a collection with all users with the given display name on the given server. This method is case-sensitive!- Parameters:
displayName- The display name of the users.server- The server where to lookup the display name.- Returns:
- A collection with all users with the given display name on the given server.
-
getCachedUsersByDisplayNameIgnoreCase
default java.util.Collection<User> getCachedUsersByDisplayNameIgnoreCase(java.lang.String displayName, Server server)
Gets a collection with all users with the given display name on the given server. This method is case-insensitive!- Parameters:
displayName- The display name of the users.server- The server where to lookup the display name.- Returns:
- A collection with all users with the given display name on the given server.
-
getCachedMessages
MessageSet getCachedMessages()
Gets a message set with all currently cached messages.- Returns:
- A message set with all currently cached messages.
-
getCachedMessageById
java.util.Optional<Message> getCachedMessageById(long id)
Gets a cached message by its id.- Parameters:
id- The id of the message.- Returns:
- The cached message.
-
getCachedMessageById
default java.util.Optional<Message> getCachedMessageById(java.lang.String id)
Gets a cached message by its id.- Parameters:
id- The id of the message.- Returns:
- The cached message.
-
getMessageById
default java.util.concurrent.CompletableFuture<Message> getMessageById(long id, TextChannel channel)
Gets a message by its id, if it exists and belongs to the given channel.- Parameters:
id- The id of the message.channel- The channel of the message.- Returns:
- The message with the given id.
- See Also:
TextChannel.getMessageById(long)
-
getMessageById
default java.util.concurrent.CompletableFuture<Message> getMessageById(java.lang.String id, TextChannel channel)
Gets a message by its id, if it exists and belongs to the given channel.- Parameters:
id- The id of the message.channel- The channel of the message.- Returns:
- The message with the given id.
- See Also:
TextChannel.getMessageById(String)
-
getMessageByLink
default java.util.Optional<java.util.concurrent.CompletableFuture<Message>> getMessageByLink(java.lang.String link) throws java.lang.IllegalArgumentException
Gets a message by its link.- Parameters:
link- The link of the message.- Returns:
- The message with the given link.
- Throws:
java.lang.IllegalArgumentException- If the link isn't valid.
-
getCachedMessageByLink
default java.util.Optional<Message> getCachedMessageByLink(java.lang.String link) throws java.lang.IllegalArgumentException
Gets a cached message by its link.- Parameters:
link- The link of the message.- Returns:
- The cached message with the given link.
- Throws:
java.lang.IllegalArgumentException- If the link isn't valid.
-
getServers
java.util.Collection<Server> getServers()
Gets a collection with all servers the bot is in.- Returns:
- A collection with all servers the bot is in.
-
getServerById
default java.util.Optional<Server> getServerById(long id)
Gets a server by its id.- Parameters:
id- The id of the server.- Returns:
- The server with the given id.
-
getServerById
default java.util.Optional<Server> getServerById(java.lang.String id)
Gets a server by its id.- Parameters:
id- The id of the server.- Returns:
- The server with the given id.
-
getServersByName
default java.util.Collection<Server> getServersByName(java.lang.String name)
Gets a collection with all servers with the given name. This method is case-sensitive!- Parameters:
name- The name of the servers.- Returns:
- A collection with all servers with the given name.
-
getServersByNameIgnoreCase
default java.util.Collection<Server> getServersByNameIgnoreCase(java.lang.String name)
Gets a collection with all servers with the given name. This method is case-insensitive!- Parameters:
name- The name of the servers.- Returns:
- A collection with all servers with the given name.
-
getCustomEmojis
java.util.Collection<KnownCustomEmoji> getCustomEmojis()
Gets a collection with all known custom emojis.- Returns:
- A collection with all known custom emojis.
-
getCustomEmojiById
default java.util.Optional<KnownCustomEmoji> getCustomEmojiById(long id)
Gets a custom emoji in this server by its id.- Parameters:
id- The id of the emoji.- Returns:
- The emoji with the given id.
-
getCustomEmojiById
default java.util.Optional<KnownCustomEmoji> getCustomEmojiById(java.lang.String id)
Gets a custom emoji in this server by its id.- Parameters:
id- The id of the emoji.- Returns:
- The emoji with the given id.
-
getCustomEmojisByName
default java.util.Collection<KnownCustomEmoji> getCustomEmojisByName(java.lang.String name)
Gets a collection with all custom emojis with the given name in the server. This method is case-sensitive!- Parameters:
name- The name of the custom emojis.- Returns:
- A collection with all custom emojis with the given name in this server.
-
getCustomEmojisByNameIgnoreCase
default java.util.Collection<KnownCustomEmoji> getCustomEmojisByNameIgnoreCase(java.lang.String name)
Gets a collection with all custom emojis with the given name in the server. This method is case-insensitive!- Parameters:
name- The name of the custom emojis.- Returns:
- A collection with all custom emojis with the given name in this server.
-
getKnownCustomEmojiOrCreateCustomEmoji
CustomEmoji getKnownCustomEmojiOrCreateCustomEmoji(long id, java.lang.String name, boolean animated)
Creates or gets a custom emoji to be used in other Javacord APIs. Use this if the custom emoji you're looking for is hosted on a different shard, and can't be accessed throughgetCustomEmojiById(). If the custom emoji is known, the method will return the known custom emoji instead of creating a new one. The method will always return a non-null value, even if the emoji does not exist which will lead to a non-functional custom emoji for further usage.- Parameters:
id- the ID of the custom emojiname- the name of the custom emojianimated- true if the emoji is animated; false otherwise- Returns:
- the new (unknown) custom emoji instance
-
getNitroStickerPacks
java.util.concurrent.CompletableFuture<java.util.Set<StickerPack>> getNitroStickerPacks()
Gets a list of all default sticker packs, which are available to nitro users.- Returns:
- The nitro packs available to nitro users.
-
getStickerById
java.util.Optional<Sticker> getStickerById(long id)
Gets a sticker by its ID.- Parameters:
id- The ID of the sticker.- Returns:
- A future of the sticker.
-
getStickerById
default java.util.Optional<Sticker> getStickerById(java.lang.String id)
Gets a sticker by its ID.- Parameters:
id- The ID of the sticker.- Returns:
- A future of the sticker.
-
requestStickerById
java.util.concurrent.CompletableFuture<Sticker> requestStickerById(long id)
Requests a sticker by its ID from the Discord API.- Parameters:
id- The ID of the sticker to request.- Returns:
- A future of the sticker.
-
requestStickerById
default java.util.concurrent.CompletableFuture<Sticker> requestStickerById(java.lang.String id)
Requests a sticker by its ID from the Discord API.- Parameters:
id- The ID of the sticker to request.- Returns:
- A future of the sticker.
-
getRoles
default java.util.Collection<Role> getRoles()
Gets a collection with all roles the bot knows.- Returns:
- A collection with all roles the bot knows.
-
getRoleById
default java.util.Optional<Role> getRoleById(long id)
Gets a role by its id.- Parameters:
id- The id of the role.- Returns:
- The role with the given id.
-
getRoleById
default java.util.Optional<Role> getRoleById(java.lang.String id)
Gets a role by its id.- Parameters:
id- The id of the role.- Returns:
- The role with the given id.
-
getRolesByName
default java.util.Collection<Role> getRolesByName(java.lang.String name)
Gets a collection with all roles with the given name. This method is case-sensitive!- Parameters:
name- The name of the roles.- Returns:
- A collection with all roles with the given name.
-
getRolesByNameIgnoreCase
default java.util.Collection<Role> getRolesByNameIgnoreCase(java.lang.String name)
Gets a collection with all roles with the given name. This method is case-insensitive!- Parameters:
name- The name of the roles.- Returns:
- A collection with all roles with the given name.
-
getChannels
java.util.Collection<Channel> getChannels()
Gets a collection with all channels of the bot.- Returns:
- A collection with all channels of the bot.
-
getPrivateChannels
java.util.Collection<PrivateChannel> getPrivateChannels()
Gets a collection with all private channels of the bot.- Returns:
- A collection with all private channels of the bot.
-
getServerChannels
java.util.Collection<ServerChannel> getServerChannels()
Gets a collection with all server channels of the bot.- Returns:
- A collection with all server channels of the bot.
-
getRegularServerChannels
java.util.Collection<RegularServerChannel> getRegularServerChannels()
Gets a collection with all regular server channels of the bot.- Returns:
- A collection with all regular server channels of the bot.
-
getChannelCategories
java.util.Collection<ChannelCategory> getChannelCategories()
Gets a collection with all channel categories of the bot.- Returns:
- A collection with all channel categories of the bot.
-
getServerTextChannels
java.util.Collection<ServerTextChannel> getServerTextChannels()
Gets a collection with all server text channels of the bot.- Returns:
- A collection with all server text channels of the bot.
-
getServerForumChannels
java.util.Set<ServerForumChannel> getServerForumChannels()
Gets a set with all server forum channels of the bot.- Returns:
- A collection with all server forum channels of the bot.
-
getServerThreadChannels
java.util.Set<ServerThreadChannel> getServerThreadChannels()
Gets a set with all the server thread channels of the bot.- Returns:
- A set with all server thread channels of the bot.
-
getPrivateServerThreadChannels
java.util.Set<ServerThreadChannel> getPrivateServerThreadChannels()
Gets a set with all the private threads of the bot.- Returns:
- A set with all private threads of the bot.
-
getPublicServerThreadChannels
java.util.Set<ServerThreadChannel> getPublicServerThreadChannels()
Gets a set with all the public threads of the bot.- Returns:
- A set with all the public threads of the bot.
-
getServerVoiceChannels
java.util.Collection<ServerVoiceChannel> getServerVoiceChannels()
Gets a collection with all server voice channels of the bot.- Returns:
- A collection with all server voice channels of the bot.
-
getServerStageVoiceChannels
java.util.Collection<ServerStageVoiceChannel> getServerStageVoiceChannels()
Gets a collection with all server stage voice channels of the bot.- Returns:
- A collection with all server stage voice channels of the bot.
-
getTextChannels
java.util.Collection<TextChannel> getTextChannels()
Gets a collection with all text channels of the bot.- Returns:
- A collection with all text channels of the bot.
-
getVoiceChannels
java.util.Collection<VoiceChannel> getVoiceChannels()
Gets a collection with all voice channels of the bot.- Returns:
- A collection with all voice channels of the bot.
-
getChannelById
java.util.Optional<Channel> getChannelById(long id)
Gets a channel by its id.- Parameters:
id- The id of the channel.- Returns:
- The channel with the given id.
-
getChannelById
default java.util.Optional<Channel> getChannelById(java.lang.String id)
Gets a channel by its id.- Parameters:
id- The id of the channel.- Returns:
- The channel with the given id.
-
getChannelsByName
default java.util.Collection<Channel> getChannelsByName(java.lang.String name)
Gets a collection with all channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the channels.- Returns:
- A collection with all channels with the given name.
-
getChannelsByNameIgnoreCase
default java.util.Collection<Channel> getChannelsByNameIgnoreCase(java.lang.String name)
Gets a collection with all channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the channels.- Returns:
- A collection with all channels with the given name.
-
getTextChannelById
default java.util.Optional<TextChannel> getTextChannelById(long id)
Gets a text channel by its id.- Parameters:
id- The id of the text channel.- Returns:
- The text channel with the given id.
-
getTextChannelById
default java.util.Optional<TextChannel> getTextChannelById(java.lang.String id)
Gets a text channel by its id.- Parameters:
id- The id of the text channel.- Returns:
- The text channel with the given id.
-
getTextChannelsByName
default java.util.Collection<TextChannel> getTextChannelsByName(java.lang.String name)
Gets a collection with all text channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the text channels.- Returns:
- A collection with all text channels with the given name.
-
getTextChannelsByNameIgnoreCase
default java.util.Collection<TextChannel> getTextChannelsByNameIgnoreCase(java.lang.String name)
Gets a collection with all text channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the text channels.- Returns:
- A collection with all text channels with the given name.
-
getVoiceChannelById
default java.util.Optional<VoiceChannel> getVoiceChannelById(long id)
Gets a voice channel by its id.- Parameters:
id- The id of the voice channel.- Returns:
- The voice channel with the given id.
-
getVoiceChannelById
default java.util.Optional<VoiceChannel> getVoiceChannelById(java.lang.String id)
Gets a voice channel by its id.- Parameters:
id- The id of the voice channel.- Returns:
- The voice channel with the given id.
-
getVoiceChannelsByName
default java.util.Collection<VoiceChannel> getVoiceChannelsByName(java.lang.String name)
Gets a collection with all voice channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the voice channels.- Returns:
- A collection with all voice channels with the given name.
-
getVoiceChannelsByNameIgnoreCase
default java.util.Collection<VoiceChannel> getVoiceChannelsByNameIgnoreCase(java.lang.String name)
Gets a collection with all voice channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the voice channels.- Returns:
- A collection with all voice channels with the given name.
-
getServerChannelById
default java.util.Optional<ServerChannel> getServerChannelById(long id)
Gets a server channel by its id.- Parameters:
id- The id of the server channel.- Returns:
- The server channel with the given id.
-
getServerChannelById
default java.util.Optional<ServerChannel> getServerChannelById(java.lang.String id)
Gets a server channel by its id.- Parameters:
id- The id of the server channel.- Returns:
- The server channel with the given id.
-
getServerChannelsByName
default java.util.Collection<ServerChannel> getServerChannelsByName(java.lang.String name)
Gets a collection with all server channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the server channels.- Returns:
- A collection with all server channels with the given name.
-
getServerChannelsByNameIgnoreCase
default java.util.Collection<ServerChannel> getServerChannelsByNameIgnoreCase(java.lang.String name)
Gets a collection with all server channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the server channels.- Returns:
- A collection with all server channels with the given name.
-
getRegularServerChannelById
default java.util.Optional<RegularServerChannel> getRegularServerChannelById(long id)
Gets a regular server channel by its id.- Parameters:
id- The id of the regular server channel.- Returns:
- The regular server channel with the given id.
-
getRegularServerChannelById
default java.util.Optional<RegularServerChannel> getRegularServerChannelById(java.lang.String id)
Gets a regular server channel by its id.- Parameters:
id- The id of the regular server channel.- Returns:
- The regular server channel with the given id.
-
getRegularServerChannelsByName
default java.util.Collection<RegularServerChannel> getRegularServerChannelsByName(java.lang.String name)
Gets a collection with all regular server channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the regular server channels.- Returns:
- A collection with all regular server channels with the given name.
-
getRegularServerChannelsByNameIgnoreCase
default java.util.Collection<RegularServerChannel> getRegularServerChannelsByNameIgnoreCase(java.lang.String name)
Gets a collection with all regular server channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the regular server channels.- Returns:
- A collection with all regular server channels with the given name.
-
getChannelCategoryById
default java.util.Optional<ChannelCategory> getChannelCategoryById(long id)
Gets a channel category by its id.- Parameters:
id- The id of the channel category.- Returns:
- The channel category with the given id.
-
getChannelCategoryById
default java.util.Optional<ChannelCategory> getChannelCategoryById(java.lang.String id)
Gets a channel category by its id.- Parameters:
id- The id of the channel category.- Returns:
- The channel category with the given id.
-
getChannelCategoriesByName
default java.util.Collection<ChannelCategory> getChannelCategoriesByName(java.lang.String name)
Gets a collection with all channel categories with the given name. This method is case-sensitive!- Parameters:
name- The name of the channel categories.- Returns:
- A collection with all channel categories with the given name.
-
getChannelCategoriesByNameIgnoreCase
default java.util.Collection<ChannelCategory> getChannelCategoriesByNameIgnoreCase(java.lang.String name)
Gets a collection with all channel categories with the given name. This method is case-insensitive!- Parameters:
name- The name of the channel categories.- Returns:
- A collection with all channel categories with the given name.
-
getServerTextChannelById
default java.util.Optional<ServerTextChannel> getServerTextChannelById(long id)
Gets a server text channel by its id.- Parameters:
id- The id of the server text channel.- Returns:
- The server text channel with the given id.
-
getServerTextChannelById
default java.util.Optional<ServerTextChannel> getServerTextChannelById(java.lang.String id)
Gets a server text channel by its id.- Parameters:
id- The id of the server text channel.- Returns:
- The server text channel with the given id.
-
getServerTextChannelsByName
default java.util.Collection<ServerTextChannel> getServerTextChannelsByName(java.lang.String name)
Gets a collection with all server text channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the server text channels.- Returns:
- A collection with all server text channels with the given name.
-
getServerTextChannelsByNameIgnoreCase
default java.util.Collection<ServerTextChannel> getServerTextChannelsByNameIgnoreCase(java.lang.String name)
Gets a collection with all server text channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the server text channels.- Returns:
- A collection with all server text channels with the given name.
-
getServerForumChannelById
default java.util.Optional<ServerForumChannel> getServerForumChannelById(long id)
Gets a server forum channel by its id.- Parameters:
id- The id of the server forum channel.- Returns:
- The server forum channel with the given id.
-
getServerForumChannelById
default java.util.Optional<ServerForumChannel> getServerForumChannelById(java.lang.String id)
Gets a server forum channel by its id.- Parameters:
id- The id of the server forum channel.- Returns:
- The server forum channel with the given id.
-
getServerForumChannelsByName
default java.util.Set<ServerForumChannel> getServerForumChannelsByName(java.lang.String name)
Gets a collection with all server forum channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the server forum channels.- Returns:
- A collection with all server forum channels with the given name.
-
getServerForumChannelsByNameIgnoreCase
default java.util.Set<ServerForumChannel> getServerForumChannelsByNameIgnoreCase(java.lang.String name)
Gets a collection with all server forum channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the server forum channels.- Returns:
- A collection with all server forum channels with the given name.
-
getServerThreadChannelById
default java.util.Optional<ServerThreadChannel> getServerThreadChannelById(long id)
Gets a server thread channel by its id.- Parameters:
id- The id of the server thread channel.- Returns:
- The server thread channel with the given id.
-
getServerThreadChannelById
default java.util.Optional<ServerThreadChannel> getServerThreadChannelById(java.lang.String id)
Gets a server thread channel by its id.- Parameters:
id- The id of the server thread channel.- Returns:
- The server thread channel with the given id.
-
getServerThreadChannelsByName
default java.util.Set<ServerThreadChannel> getServerThreadChannelsByName(java.lang.String name)
Gets a set with all server thread channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the server thread channels.- Returns:
- A set with all server thread channels with the given name.
-
getServerThreadChannelsByNameIgnoreCase
default java.util.Set<ServerThreadChannel> getServerThreadChannelsByNameIgnoreCase(java.lang.String name)
Gets a set with all server thread channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the server thread channels.- Returns:
- A set with all server thread channels with the given name.
-
getServerVoiceChannelById
default java.util.Optional<ServerVoiceChannel> getServerVoiceChannelById(long id)
Gets a server voice channel by its id.- Parameters:
id- The id of the server voice channel.- Returns:
- The server voice channel with the given id.
-
getServerVoiceChannelById
default java.util.Optional<ServerVoiceChannel> getServerVoiceChannelById(java.lang.String id)
Gets a server voice channel by its id.- Parameters:
id- The id of the server voice channel.- Returns:
- The server voice channel with the given id.
-
getServerVoiceChannelsByName
default java.util.Collection<ServerVoiceChannel> getServerVoiceChannelsByName(java.lang.String name)
Gets a collection with all server voice channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the server voice channels.- Returns:
- A collection with all server voice channels with the given name.
-
getServerVoiceChannelsByNameIgnoreCase
default java.util.Collection<ServerVoiceChannel> getServerVoiceChannelsByNameIgnoreCase(java.lang.String name)
Gets a collection with all server voice channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the server voice channels.- Returns:
- A collection with all server voice channels with the given name.
-
getServerStageVoiceChannelById
default java.util.Optional<ServerStageVoiceChannel> getServerStageVoiceChannelById(long id)
Gets a server stage voice channel by its id.- Parameters:
id- The id of the server stage voice channel.- Returns:
- The server stage voice channel with the given id.
-
getServerStageVoiceChannelById
default java.util.Optional<ServerStageVoiceChannel> getServerStageVoiceChannelById(java.lang.String id)
Gets a server stage voice channel by its id.- Parameters:
id- The id of the server stage voice channel.- Returns:
- The server stage voice channel with the given id.
-
getServerStageVoiceChannelsByName
default java.util.Collection<ServerStageVoiceChannel> getServerStageVoiceChannelsByName(java.lang.String name)
Gets a collection with all server stage voice channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the server stage voice channels.- Returns:
- A collection with all server stage voice channels with the given name.
-
getServerStageVoiceChannelsByNameIgnoreCase
default java.util.Collection<ServerStageVoiceChannel> getServerStageVoiceChannelsByNameIgnoreCase(java.lang.String name)
Gets a collection with all server stage voice channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the server stage voice channels.- Returns:
- A collection with all server stage voice channels with the given name.
-
getPrivateChannelById
default java.util.Optional<PrivateChannel> getPrivateChannelById(long id)
Gets a private channel by its id.- Parameters:
id- The id of the private channel.- Returns:
- The private channel with the given id.
-
getPrivateChannelById
default java.util.Optional<PrivateChannel> getPrivateChannelById(java.lang.String id)
Gets a private channel by its id.- Parameters:
id- The id of the private channel.- Returns:
- The private channel with the given id.
-
-