// Path: src/main/java/stream/flarebot/flarebot/util/Constants.java
// public class Constants {
// 
//     public static final long OFFICIAL_GUILD = 226785954537406464L;
//     private static final String FLAREBOT_API = "https://api.flarebot.stream";
//     private static final String FLAREBOT_API_DEV = "http://localhost:8880";
//     public static final String INVITE_URL = "https://discord.gg/TTAUGvZ";
//     public static final String INVITE_MARKDOWN = "[Support Server](" + INVITE_URL + ")";
// 
//     public static final long DEVELOPER_ID = 226788297156853771L;
//     public static final long ADMINS_ID = 434438873565888542L;
//     public static final long CONTRIBUTOR_ID = 272324832279003136L;
// 
//     private static final String FLARE_TEST_BOT_CHANNEL = "242297848123621376";
//     public static final char COMMAND_CHAR = '_';
//     public static final String COMMAND_CHAR_STRING = String.valueOf(COMMAND_CHAR);
// 
//     @Deprecated
//     public static Guild getOfficialGuild() {
//         return Getters.getGuildById(OFFICIAL_GUILD);
//     }
// 
//     public static TextChannel getErrorLogChannel() {
//         return (FlareBot.instance().isTestBot() ?
//                 Getters.getChannelById(Constants.FLARE_TEST_BOT_CHANNEL) :
//                 Getters.getChannelById("226786557862871040"));
//     }
// 
//     public static TextChannel getGuildLogChannel() {
//         return (FlareBot.instance().isTestBot() ?
//                 Getters.getChannelById(Constants.FLARE_TEST_BOT_CHANNEL) :
//                 Getters.getChannelById("260401007685664768"));
//     }
// 
//     private static TextChannel getEGLogChannel() {
//         return (FlareBot.instance().isTestBot() ?
//                 Getters.getChannelById(Constants.FLARE_TEST_BOT_CHANNEL) :
//                 Getters.getChannelById("358950369642151937"));
//     }
// 
//     public static void logEG(String eg, Command command, Guild guild, User user) {
//         EmbedBuilder builder = new EmbedBuilder().setTitle("Found `" + eg + "`")
//                 .addField("Guild", guild.getId() + " (`" + guild.getName() + "`) ", true)
//                 .addField("User", user.getAsMention() + " (`" + user.getName() + "#" + user.getDiscriminator() + "`)", true)
//                 .setTimestamp(LocalDateTime.now(Clock.systemUTC()));
//         if (command != null) builder.addField("Command", command.getCommand(), true);
//         Constants.getEGLogChannel().sendMessage(builder.build()).queue();
//     }
// 
//     public static TextChannel getImportantLogChannel() {
//         return (FlareBot.instance().isTestBot() ?
//                 Getters.getChannelById(Constants.FLARE_TEST_BOT_CHANNEL) :
//                 Getters.getChannelById("358978253966278657"));
//     }
// 
//     public static String getAPI() {
//         return FlareBot.instance().isTestBot() ? FLAREBOT_API_DEV : FLAREBOT_API;
//     }
// }


import org.json.JSONObject;
import stream.flarebot.flarebot.util.Constants;
package stream.flarebot.flarebot.analytics;


public interface AnalyticSender {

    /**
     * This is the data which will be sent, it needs to be a JSONObject and have a "data" field with whatever should be
     * sent.
     * <p>
     * <b>Make sure there is a "data" field if sending to FlareBot's API</b>
     *
     * @return The JSONObject to be sent.
     */
    JSONObject processData();

    /**
     * This is how often the analytic data should be sent in milliseconds. It is usually a good idea for readability
     * purposes to sue {@link java.util.concurrent.TimeUnit} and toMillis on any constant.
     *
     * @return The frequency that the data should be sent in milliseconds.
     */
    long dataDeliveryFrequency();

    /**
     * The endpoint which should be to sent to, this needs to have a leading / (slash).
     *
     * @return Endpoint for the sender data to be sent to with a trailing slash.
     */
    String endpoint();

    /**
     * The API URL which we will send the analytic data to, this should not include the endpoint for the said analytic data.
     * By default this is the FlareBot API as defined in {@link Constants#getAPI()} with the endpoint "analytics".
     *
     * @return API URL which the data will be sent to (Without endpoint).
     */
    default String apiUrl() {
// Path: src/main/java/stream/flarebot/flarebot/util/Constants.java
// public class Constants {
// 
//     public static final long OFFICIAL_GUILD = 226785954537406464L;
//     private static final String FLAREBOT_API = "https://api.flarebot.stream";
//     private static final String FLAREBOT_API_DEV = "http://localhost:8880";
//     public static final String INVITE_URL = "https://discord.gg/TTAUGvZ";
//     public static final String INVITE_MARKDOWN = "[Support Server](" + INVITE_URL + ")";
// 
//     public static final long DEVELOPER_ID = 226788297156853771L;
//     public static final long ADMINS_ID = 434438873565888542L;
//     public static final long CONTRIBUTOR_ID = 272324832279003136L;
// 
//     private static final String FLARE_TEST_BOT_CHANNEL = "242297848123621376";
//     public static final char COMMAND_CHAR = '_';
//     public static final String COMMAND_CHAR_STRING = String.valueOf(COMMAND_CHAR);
// 
//     @Deprecated
//     public static Guild getOfficialGuild() {
//         return Getters.getGuildById(OFFICIAL_GUILD);
//     }
// 
//     public static TextChannel getErrorLogChannel() {
//         return (FlareBot.instance().isTestBot() ?
//                 Getters.getChannelById(Constants.FLARE_TEST_BOT_CHANNEL) :
//                 Getters.getChannelById("226786557862871040"));
//     }
// 
//     public static TextChannel getGuildLogChannel() {
//         return (FlareBot.instance().isTestBot() ?
//                 Getters.getChannelById(Constants.FLARE_TEST_BOT_CHANNEL) :
//                 Getters.getChannelById("260401007685664768"));
//     }
// 
//     private static TextChannel getEGLogChannel() {
//         return (FlareBot.instance().isTestBot() ?
//                 Getters.getChannelById(Constants.FLARE_TEST_BOT_CHANNEL) :
//                 Getters.getChannelById("358950369642151937"));
//     }
// 
//     public static void logEG(String eg, Command command, Guild guild, User user) {
//         EmbedBuilder builder = new EmbedBuilder().setTitle("Found `" + eg + "`")
//                 .addField("Guild", guild.getId() + " (`" + guild.getName() + "`) ", true)
//                 .addField("User", user.getAsMention() + " (`" + user.getName() + "#" + user.getDiscriminator() + "`)", true)
//                 .setTimestamp(LocalDateTime.now(Clock.systemUTC()));
//         if (command != null) builder.addField("Command", command.getCommand(), true);
//         Constants.getEGLogChannel().sendMessage(builder.build()).queue();
//     }
// 
//     public static TextChannel getImportantLogChannel() {
//         return (FlareBot.instance().isTestBot() ?
//                 Getters.getChannelById(Constants.FLARE_TEST_BOT_CHANNEL) :
//                 Getters.getChannelById("358978253966278657"));
//     }
// 
//     public static String getAPI() {
//         return FlareBot.instance().isTestBot() ? FLAREBOT_API_DEV : FLAREBOT_API;
//     }
// }


// Path: src/main/java/stream/flarebot/flarebot/analytics/AnalyticSender.java
import org.json.JSONObject;
import stream.flarebot.flarebot.util.Constants;

package stream.flarebot.flarebot.analytics;


public interface AnalyticSender {

    /**
     * This is the data which will be sent, it needs to be a JSONObject and have a "data" field with whatever should be
     * sent.
     * <p>
     * <b>Make sure there is a "data" field if sending to FlareBot's API</b>
     *
     * @return The JSONObject to be sent.
     */
    JSONObject processData();

    /**
     * This is how often the analytic data should be sent in milliseconds. It is usually a good idea for readability
     * purposes to sue {@link java.util.concurrent.TimeUnit} and toMillis on any constant.
     *
     * @return The frequency that the data should be sent in milliseconds.
     */
    long dataDeliveryFrequency();

    /**
     * The endpoint which should be to sent to, this needs to have a leading / (slash).
     *
     * @return Endpoint for the sender data to be sent to with a trailing slash.
     */
    String endpoint();

    /**
     * The API URL which we will send the analytic data to, this should not include the endpoint for the said analytic data.
     * By default this is the FlareBot API as defined in {@link Constants#getAPI()} with the endpoint "analytics".
     *
     * @return API URL which the data will be sent to (Without endpoint).
     */
    default String apiUrl() {
        return Constants.getAPI() + "/analytics";