Class GuildStats
java.lang.Object
dev.jacrispys.JavaBot.api.analytics.objects.GuildStats
- All Implemented Interfaces:
AudioAnalytics
,AudioGuildAnalytics
,GeneralGuildAnalytics
,Stats
- Direct Known Subclasses:
GuildAnalytics
public abstract class GuildStats
extends Object
implements Stats, GeneralGuildAnalytics, AudioGuildAnalytics
Abstraction for
uses implementations of
GuildAnalytics
to inherit
uses implementations of
Stats
, GeneralGuildAnalytics
, and AudioGuildAnalytics
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GuildStats
(long guildId, AgentApi api, net.dv8tion.jda.api.JDA jda) -
Method Summary
Modifier and TypeMethodDescription<T extends net.dv8tion.jda.api.entities.UserSnowflake>
AudioUsergetAudioUser
(T user) getGuildUser
(net.dv8tion.jda.api.entities.User user) long
net.dv8tion.jda.api.entities.Guild
long
long
getPlaylistPlays
(GuildPlaylistImpl playlist) long
getPlays()
getRegularUsers
(int frequency) long
long
-
Field Details
-
guildId
public final long guildId -
api
-
jda
public final net.dv8tion.jda.api.JDA jda -
sqlStats
-
-
Constructor Details
-
GuildStats
-
-
Method Details
-
getPlays
- Specified by:
getPlays
in interfaceAudioAnalytics
- Returns:
- the total number of songs played in a guild.
- Throws:
SQLException
-
getPauses
- Specified by:
getPauses
in interfaceAudioAnalytics
- Returns:
- the amount of times the bot has been paused in a guild.
- Throws:
SQLException
-
getTotalPlaytime
- Specified by:
getTotalPlaytime
in interfaceAudioAnalytics
- Returns:
- the amount of time the bot has played songs in a guild.
- Throws:
SQLException
-
getTopListeners
- Specified by:
getTopListeners
in interfaceAudioAnalytics
- Returns:
- a list of the most active music listeners
-
getTopSongs
- Specified by:
getTopSongs
in interfaceAudioAnalytics
- Returns:
- a list of tracks that have been played the most in a guild
-
getAudioUser
- Specified by:
getAudioUser
in interfaceAudioAnalytics
- Type Parameters:
T
- generic to allow members and users- Parameters:
user
- is the JDA instance of the user- Returns:
- custom object for
AudioUser
-
getHijackCount
- Specified by:
getHijackCount
in interfaceAudioAnalytics
- Returns:
- the amount of times this guild has been hijacked
- Throws:
SQLException
-
getGuildPlaylists
- Specified by:
getGuildPlaylists
in interfaceAudioGuildAnalytics
- Returns:
- custom
GuildPlaylistImpl
object
-
getPlaylistPlays
- Specified by:
getPlaylistPlays
in interfaceAudioGuildAnalytics
- Parameters:
playlist
- to retrieve plays from- Returns:
- a value from the DB of how many plays a guild playlist has
-
getBookmarks
- Specified by:
getBookmarks
in interfaceAudioGuildAnalytics
- Returns:
- a list of
GuildBookmark
-
getJoinDate
- Specified by:
getJoinDate
in interfaceGeneralGuildAnalytics
- Returns:
- the JDA date/time the bot joined a given guild.
-
getBotUsers
- Specified by:
getBotUsers
in interfaceGeneralGuildAnalytics
- Returns:
- a list of
GuildUser
that are bot accounts
-
getRegularUsers
- Specified by:
getRegularUsers
in interfaceGeneralGuildAnalytics
- Parameters:
frequency
- is a custom scalar for how often users access the bot (scale of 1-100)- Returns:
- a list of users above the
frequency
requested.
-
getOverallStats
- Specified by:
getOverallStats
in interfaceGeneralGuildAnalytics
- Returns:
- instance of
GuildStats
-
getTotalUses
- Specified by:
getTotalUses
in interfaceStats
- Returns:
- total times any command has been used
- Throws:
SQLException
- if a database error occurs
-
getGuildUser
- Specified by:
getGuildUser
in interfaceGeneralGuildAnalytics
- Parameters:
user
- to find theGuildUser
for.- Returns:
- a
GuildUser
instance of the JDAUser
-
getParentGuild
public net.dv8tion.jda.api.entities.Guild getParentGuild()- Specified by:
getParentGuild
in interfaceGeneralGuildAnalytics
- Returns:
- an instance of the guild the constructor uses
-