Interface Application.Bot
-
- All Superinterfaces:
ISnowflake
- Enclosing interface:
- Application
public static interface Application.Bot extends ISnowflake
Represents a Bot assigned to an Application To change its Username, login to JDA and use theAccountManager
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Application
getApplication()
The Application for this Botjava.lang.String
getAvatarId()
The avatar id of this Botjava.lang.String
getAvatarUrl()
The avatar-url of this Botjava.lang.String
getDiscriminator()
The discriminator of this Botjava.lang.String
getInviteUrl(java.lang.String guildId, java.util.Collection<Permission> permissions)
Creates a OAuth invite-link used to invite the bot.java.lang.String
getInviteUrl(java.lang.String guildId, Permission... permissions)
Creates a OAuth invite-link used to invite the bot.java.lang.String
getInviteUrl(java.util.Collection<Permission> permissions)
Creates a OAuth invite-link used to invite the bot.java.lang.String
getInviteUrl(Permission... permissions)
Creates a OAuth invite-link used to invite the bot.java.lang.String
getName()
The name of this Botjava.lang.String
getToken()
The token used to login to JDA with this Bot
This can be used inJDABuilder.setToken(String)
RestAction<Application.Bot>
resetToken()
Generates a new token for this bot.-
Methods inherited from interface net.dv8tion.jda.core.entities.ISnowflake
getCreationTime, getId, getIdLong
-
-
-
-
Method Detail
-
getApplication
Application getApplication()
The Application for this Bot- Returns:
- The application for this Bot
-
getAvatarId
java.lang.String getAvatarId()
The avatar id of this Bot- Returns:
- The avatar id of this Bot or
null
, if no avatar is set
-
getAvatarUrl
java.lang.String getAvatarUrl()
The avatar-url of this Bot- Returns:
- The avatar-url of this Bot or
null
, if no avatar is set
-
getDiscriminator
java.lang.String getDiscriminator()
The discriminator of this Bot- Returns:
- The discriminator of this Bot
-
getInviteUrl
java.lang.String getInviteUrl(java.util.Collection<Permission> permissions)
Creates a OAuth invite-link used to invite the bot.The link is provided in the following format:
https://discordapp.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS
Unnecessary query parameters are stripped.- Parameters:
permissions
- Possibly emptyList
ofPermissions
that should be requested via invite.- Returns:
- The link used to invite the bot
-
getInviteUrl
java.lang.String getInviteUrl(Permission... permissions)
Creates a OAuth invite-link used to invite the bot.The link is provided in the following format:
https://discordapp.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS
Unnecessary query parameters are stripped.- Parameters:
permissions
- Possibly empty array ofPermissions
that should be requested via invite.- Returns:
- The link used to invite the bot
-
getInviteUrl
java.lang.String getInviteUrl(java.lang.String guildId, java.util.Collection<Permission> permissions)
Creates a OAuth invite-link used to invite the bot.The link is provided in the following format:
https://discordapp.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS&guild_id=GUILD_ID
Unnecessary query parameters are stripped.- Parameters:
guildId
- The id of the pre-selected guild.permissions
- Possibly emptyList
ofPermissions
that should be requested via invite.- Returns:
- The link used to invite the bot
-
getInviteUrl
java.lang.String getInviteUrl(java.lang.String guildId, Permission... permissions)
Creates a OAuth invite-link used to invite the bot.The link is provided in the following format:
https://discordapp.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS&guild_id=GUILD_ID
Unnecessary query parameters are stripped.- Parameters:
guildId
- The id of the pre-selected guild.permissions
- Possibly empty array ofPermissions
that should be requested via invite.- Returns:
- The link used to invite the bot
-
getName
java.lang.String getName()
The name of this Bot- Returns:
- The name of this Bot
-
getToken
java.lang.String getToken()
The token used to login to JDA with this Bot
This can be used inJDABuilder.setToken(String)
- Returns:
- The authentication token of this Bot
-
resetToken
@CheckReturnValue RestAction<Application.Bot> resetToken()
Generates a new token for this bot.
This invalidates the old one!Possible
ErrorResponses
for this update include the following:ONLY_BOTS_ALLOWED
If the Bot doesn't exist
- Returns:
RestAction
- Type:Application.Bot
This bot with the updated token.
-
-