Class ArrayUtil

java.lang.Object
de.presti.ree6.utils.data.ArrayUtil

public class ArrayUtil extends Object
Utility class used to store Data for a shorter period of time.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String[]
    String Array used to store answer options, for later use by the 8Ball command.
    static final Map<String,List<com.lilittlecat.chatgpt.offical.entity.Message>>
    HashMap used to store conversations between the user and the Chat-GPT implementation.
    static final List<String>
    HashMap used to store a users Ids, to keep them from spamming commands.
    static final Map<String,net.dv8tion.jda.api.entities.Message>
    HashMap used to store message contents and their IDs, to show the content when the message gets deleted.
    static final Map<String,net.dv8tion.jda.api.entities.User>
    HashMap used to store user Ids that are associated with a message, to show the content when the message gets deleted.
    static final Map<Long,net.dv8tion.jda.api.entities.Message>
    HashMap used to store Guild ID and the message of a music Panel.
    static final List<String>
    an Arraylist containing every temporal Voice-channel Id.
    static final List<net.dv8tion.jda.api.entities.Member>
    HashMap used to store a users Ids, to keep them from earning XP with every message.
    static final Map<net.dv8tion.jda.api.entities.Member,Long>
    HashMap used to store user Ids and their VC join time, to track VoiceXP.
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.dv8tion.jda.api.entities.Message
    Get the Message content, of a deleted Message, by the ID.
    static net.dv8tion.jda.api.entities.Message
    Get the Message content, of a deleted Message, by the ID.
    static String
    getRandomString(int length)
    Get a String fully of random Number by the given length.
    static net.dv8tion.jda.api.entities.User
    Get the User from that send a specific Message that has been deleted.
    static boolean
    isTemporalVoicechannel(net.dv8tion.jda.api.entities.channel.middleman.AudioChannel channel)
    Check if the channel is a temporal Voice-channel.

    Methods inherited from class java.lang.Object

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

    • chatGPTMessages

      public static final Map<String,List<com.lilittlecat.chatgpt.offical.entity.Message>> chatGPTMessages
      HashMap used to store conversations between the user and the Chat-GPT implementation. These are being stored guild specific so Ree6 will not continue a conversation in another guild. While at the same time we store them in memory to protect users privacy, since there is no actual reason for us to keep these longer then the current application uptime.
    • messageIDwithMessage

      public static final Map<String,net.dv8tion.jda.api.entities.Message> messageIDwithMessage
      HashMap used to store message contents and their IDs, to show the content when the message gets deleted.
    • messageIDwithUser

      public static final Map<String,net.dv8tion.jda.api.entities.User> messageIDwithUser
      HashMap used to store user Ids that are associated with a message, to show the content when the message gets deleted.
    • voiceJoined

      public static final Map<net.dv8tion.jda.api.entities.Member,Long> voiceJoined
      HashMap used to store user Ids and their VC join time, to track VoiceXP.
    • musicPanelList

      public static final Map<Long,net.dv8tion.jda.api.entities.Message> musicPanelList
      HashMap used to store Guild ID and the message of a music Panel.
    • commandCooldown

      public static final List<String> commandCooldown
      HashMap used to store a users Ids, to keep them from spamming commands.
    • timeout

      public static final List<net.dv8tion.jda.api.entities.Member> timeout
      HashMap used to store a users Ids, to keep them from earning XP with every message.
    • temporalVoicechannel

      public static final List<String> temporalVoicechannel
      an Arraylist containing every temporal Voice-channel Id.
    • answers

      public static final String[] answers
      String Array used to store answer options, for later use by the 8Ball command.
  • Method Details

    • getRandomString

      public static String getRandomString(int length)
      Get a String fully of random Number by the given length.
      Parameters:
      length - the wanted Length.
      Returns:
      the String with the wanted Length.
    • getUserFromMessageList

      public static net.dv8tion.jda.api.entities.User getUserFromMessageList(String id)
      Get the User from that send a specific Message that has been deleted.
      Parameters:
      id - the ID of the Message.
      Returns:
      the User that send the Message.
    • getMessageFromMessageList

      public static net.dv8tion.jda.api.entities.Message getMessageFromMessageList(String id)
      Get the Message content, of a deleted Message, by the ID.
      Parameters:
      id - the ID of the Message.
      Returns:
      the Message Entity of the deleted Message.
    • getMessageFromMessageListAndRemove

      public static net.dv8tion.jda.api.entities.Message getMessageFromMessageListAndRemove(String id)
      Get the Message content, of a deleted Message, by the ID.
      Parameters:
      id - the ID of the Message.
      Returns:
      the Message Entity of the deleted Message.
    • isTemporalVoicechannel

      public static boolean isTemporalVoicechannel(net.dv8tion.jda.api.entities.channel.middleman.AudioChannel channel)
      Check if the channel is a temporal Voice-channel.
      Parameters:
      channel - the Voice-channel to check.
      Returns:
      true if the channel is a temporal Voice-channel.