Record Class YBot
java.lang.Object
java.lang.Record
io.github.yusufsdiscordbot.yusufsdiscordcore.bot.core.YBot
Inspiration from
SelfUser-
Constructor Summary
ConstructorsConstructorDescriptionYBot(net.dv8tion.jda.api.entities.SelfUser user) Creates an instance of aYBotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getAsTag()getBotId()longSet<net.dv8tion.jda.api.entities.User.UserFlag>getFlags()intnet.dv8tion.jda.api.JDAgetJDA()longReturns the maximum size for files that can be uploaded with this account.List<net.dv8tion.jda.api.entities.Guild>getName()@NotNull OffsetDateTimefinal inthashCode()Returns a hash code value for this object.booleanbooleanisBot()booleanCheck if the bot is verified or not.booleanIf true, this account is protected by Multi-Factor authorization.booleanisSystem()net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.PrivateChannel>net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.User.Profile>final StringtoString()Returns a string representation of this record class.net.dv8tion.jda.api.entities.SelfUseruser()Returns the value of theuserrecord component.
-
Constructor Details
-
YBot
public YBot(net.dv8tion.jda.api.entities.SelfUser user) Creates an instance of aYBotrecord class.- Parameters:
user- the value for theuserrecord component
-
-
Method Details
-
getBotIdLong
public long getBotIdLong()- Returns:
- the id of the bot.
-
getBotId
- Returns:
- the id of the bot.
-
getBotTag
- Returns:
- the tags of the bot
-
isBotVerified
public boolean isBotVerified()Check if the bot is verified or not.- Returns:
- true if the bot is verified.
-
isMfaEnabled
public boolean isMfaEnabled()If true, this account is protected by Multi-Factor authorization.
If this is a Client account, then this describes the MFA status of the Client account.
If this is a Bot account, then this describes the MFA status of the Client account that owns this Bot.- Returns:
- True, if this account has MFA protecting it.
-
getMaxFileSize
public long getMaxFileSize()Returns the maximum size for files that can be uploaded with this account.
Returns 8388608 for bots.- Returns:
- The maximum size for files that can be uploaded with this account
- See Also:
-
Message.MAX_FILE_SIZE
-
getName
- Returns:
- the name of the bot.
-
getAvatarId
- Returns:
- the bots' avatar id.
-
getAvatarUrl
- Returns:
- the bots' avatar url.
-
getDefaultAvatarId
- Returns:
- the bots' default avatar id.
-
getDefaultAvatarUrl
- Returns:
- the bots' default avatar url.
-
retrieveProfile
@Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.User.Profile> retrieveProfile() -
hasPrivateChannel
public boolean hasPrivateChannel() -
openPrivateChannel
@Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.PrivateChannel> openPrivateChannel() -
getMutualGuilds
-
isBot
public boolean isBot() -
isSystem
public boolean isSystem() -
getJDA
@Nonnull public net.dv8tion.jda.api.JDA getJDA() -
getFlags
-
getFlagsRaw
public int getFlagsRaw() -
getBotEffectiveAvatarUrl
- Returns:
- the bots' effective avatar url.
-
getDiscriminator
- Returns:
- the bots' discriminator.
-
getAsMention
-
getAsTag
-
getTimeCreated
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
user
public net.dv8tion.jda.api.entities.SelfUser user()Returns the value of theuserrecord component.- Returns:
- the value of the
userrecord component
-