Class FormatUtil

java.lang.Object
de.presti.ree6.utils.others.FormatUtil

public class FormatUtil extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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 Type
    Method
    Description
    static String
    filter(String input)
    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 the IPlayer as Emoji.
    static boolean
    isUrl(String input)
    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 query
    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
    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
    static String
    progressBar(double percent)
    Build a progressbar by the percentage.
    static String
    volumeIcon(int volume)
    Get the Volume Emoji by the volume

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PLAY_EMOJI

      public static final String PLAY_EMOJI
      A String containing the UTF-8 character for a play button.
      See Also:
    • PAUSE_EMOJI

      public static final String PAUSE_EMOJI
      A String containing the UTF-8 character for a pause button.
      See Also:
    • STOP_EMOJI

      public static final String STOP_EMOJI
      A String containing the UTF-8 character for a stop button.
      See Also:
    • LOOP_EMOJI

      public static final String LOOP_EMOJI
      A String containing the UTF-8 character for a repeat button.
      See Also:
    • SHUFFLE_EMOJI

      public static final String SHUFFLE_EMOJI
      A String containing the UTF-8 character for a shuffle button.
      See Also:
  • Method Details

    • formatTime

      public static String formatTime(long duration)
      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

      public static String getStatusEmoji(lavalink.client.player.IPlayer audioPlayer)
      Get the current Status of the IPlayer as Emoji.
      Parameters:
      audioPlayer - The IPlayer to get the Status from.
      Returns:
      A String containing the current Status of the IPlayer as Emoji.
    • progressBar

      public static String progressBar(double percent)
      Build a progressbar by the percentage.
      Parameters:
      percent - The percentage of the progressbar.
      Returns:
      A String containing the progressbar.
    • volumeIcon

      public static String volumeIcon(int volume)
      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

      public static String listOfRoles(List<net.dv8tion.jda.api.entities.Role> list, String query)
      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

      public static String filter(String input)
      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

      public static boolean isUrl(String input)
      Check if the given string is an url.
      Parameters:
      input - The string to check.
      Returns:
      True if the string is an url.