Class JdaAnalytics

java.lang.Object
dev.jacrispys.JavaBot.api.analytics.JdaAnalytics
All Implemented Interfaces:
AudioAnalytics, GeneralJdaAnalytics, Stats

public class JdaAnalytics extends Object implements AudioAnalytics, GeneralJdaAnalytics
Implementation of guild non-specific AudioAnalytics and GeneralJdaAnalytics
  • Field Details

    • api

      public final AgentApi api
    • jda

      public final net.dv8tion.jda.api.JDA jda
    • sqlStats

      public final MySqlStats sqlStats
  • Constructor Details

    • JdaAnalytics

      protected JdaAnalytics(AgentApi api, net.dv8tion.jda.api.JDA jda)
  • Method Details

    • getPlays

      public long getPlays() throws SQLException
      Specified by:
      getPlays in interface AudioAnalytics
      Returns:
      the TOTAL amount of songs played (all time)
      Throws:
      SQLException - when the query cannot be completed
    • getPauses

      public long getPauses() throws SQLException
      Specified by:
      getPauses in interface AudioAnalytics
      Returns:
      the TOTAL amount of times the bot has been paused (all time)
      Throws:
      SQLException - when the query cannot be completed
    • getTotalPlaytime

      public long getTotalPlaytime() throws SQLException
      Specified by:
      getTotalPlaytime in interface AudioAnalytics
      Returns:
      the total timme spent listening to the bot (all time)
      Throws:
      SQLException - when the query cannot be completed
    • getTopListeners

      public List<AudioUser> getTopListeners()
      Specified by:
      getTopListeners in interface AudioAnalytics
      Returns:
      top users (all time)
    • getTopSongs

      public List<TrackStats> getTopSongs()
      Specified by:
      getTopSongs in interface AudioAnalytics
      Returns:
      top played songs (all time)
    • getAudioUser

      public <T extends net.dv8tion.jda.api.entities.UserSnowflake> AudioUser getAudioUser(T user)
      Specified by:
      getAudioUser in interface AudioAnalytics
      Type Parameters:
      T - Allow instantiation from any member/user class
      Parameters:
      user - instance to get from JDA
      Returns:
      custom audio user object
    • getHijackCount

      public long getHijackCount() throws SQLException
      Specified by:
      getHijackCount in interface AudioAnalytics
      Returns:
      total times the bot has entered hijack mode (all time)
      Throws:
      SQLException - when the query cannot be completed
    • getTotalUses

      public long getTotalUses() throws SQLException
      Specified by:
      getTotalUses in interface Stats
      Returns:
      total number of times the bot has received a command.
      Throws:
      SQLException - when the query cannot be completed