Package de.presti.ree6.utils.others
Class FormatUtil
java.lang.Object
de.presti.ree6.utils.others.FormatUtil
From J MusicBot
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
A String containing the UTF-8 character for a repeat button.static final String
A String containing the UTF-8 character for a pause button.static final String
A String containing the UTF-8 character for a play button.static final String
A String containing the UTF-8 character for a shuffle button.static final String
A String containing the UTF-8 character for a stop button. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Filter out @everyone and @here mentions from the given String.static String
formatTime
(long duration) Formats the given duration into a String with the given Time.static String
getStatusEmoji
(lavalink.client.player.IPlayer audioPlayer) Get the current Status of theIPlayer
as Emoji.static boolean
Check if the given string is an url.static String
listOfRoles
(List<net.dv8tion.jda.api.entities.Role> list, String query) Get a String of the Roles that match the querystatic String
listOfTChannels
(List<net.dv8tion.jda.api.entities.channel.concrete.TextChannel> list, String query) Get a String of the TextChannels that match the querystatic String
listOfVChannels
(List<net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel> list, String query) Get a String of the VoiceChannels that match the querystatic String
progressBar
(double percent) Build a progressbar by the percentage.static String
volumeIcon
(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 theIPlayer
as Emoji.- Parameters:
audioPlayer
- TheIPlayer
to get the Status from.- Returns:
- A String containing the current Status of the
IPlayer
as 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.
-