Package de.presti.ree6.utils.others
Class FormatUtil
java.lang.Object
de.presti.ree6.utils.others.FormatUtil
From J MusicBot
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA String containing the UTF-8 character for a repeat button.static final StringA String containing the UTF-8 character for a pause button.static final StringA String containing the UTF-8 character for a play button.static final StringA String containing the UTF-8 character for a shuffle button.static final StringA String containing the UTF-8 character for a stop button. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringFilter out @everyone and @here mentions from the given String.static StringformatTime(long duration) Formats the given duration into a String with the given Time.static StringgetStatusEmoji(lavalink.client.player.IPlayer audioPlayer) Get the current Status of theIPlayeras Emoji.static booleanCheck if the given string is an url.static StringlistOfRoles(List<net.dv8tion.jda.api.entities.Role> list, String query) Get a String of the Roles that match the querystatic StringlistOfTChannels(List<net.dv8tion.jda.api.entities.channel.concrete.TextChannel> list, String query) Get a String of the TextChannels that match the querystatic StringlistOfVChannels(List<net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel> list, String query) Get a String of the VoiceChannels that match the querystatic StringprogressBar(double percent) Build a progressbar by the percentage.static StringvolumeIcon(int volume) Get the Volume Emoji by the volume
-
Field Details
-
PLAY_EMOJI
A String containing the UTF-8 character for a play button.- See Also:
-
PAUSE_EMOJI
A String containing the UTF-8 character for a pause button.- See Also:
-
STOP_EMOJI
A String containing the UTF-8 character for a stop button.- See Also:
-
LOOP_EMOJI
A String containing the UTF-8 character for a repeat button.- See Also:
-
SHUFFLE_EMOJI
A String containing the UTF-8 character for a shuffle button.- See Also:
-
-
Method Details
-
formatTime
Formats the given duration into a String with the given Time.- Parameters:
duration- The duration to format.- Returns:
- A String containing the formatted duration.
-
getStatusEmoji
Get the current Status of theIPlayeras Emoji.- Parameters:
audioPlayer- TheIPlayerto get the Status from.- Returns:
- A String containing the current Status of the
IPlayeras Emoji.
-
progressBar
Build a progressbar by the percentage.- Parameters:
percent- The percentage of the progressbar.- Returns:
- A String containing the progressbar.
-
volumeIcon
Get the Volume Emoji by the volume- Parameters:
volume- The volume to get the Emoji from.- Returns:
- A String containing the Volume Emoji.
-
listOfTChannels
public static String listOfTChannels(List<net.dv8tion.jda.api.entities.channel.concrete.TextChannel> list, String query) Get a String of the TextChannels that match the query- Parameters:
list- The list of the TextChannels.query- The query to match.- Returns:
- A String of the TextChannels that match the query.
-
listOfVChannels
public static String listOfVChannels(List<net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel> list, String query) Get a String of the VoiceChannels that match the query- Parameters:
list- The list of the VoiceChannels.query- The query to match.- Returns:
- A String of the VoiceChannels that match the query.
-
listOfRoles
Get a String of the Roles that match the query- Parameters:
list- The list of the Roles.query- The query to match.- Returns:
- A String of the Roles that match the query.
-
filter
Filter out @everyone and @here mentions from the given String.- Parameters:
input- The String to filter.- Returns:
- A String without @everyone and @here mentions.
-
isUrl
Check if the given string is an url.- Parameters:
input- The string to check.- Returns:
- True if the string is an url.
-