2022-08-26 00:13:06 +02:00
|
|
|
package wtf.beatrice.hidekobot;
|
|
|
|
|
2022-08-26 20:43:12 +02:00
|
|
|
import wtf.beatrice.hidekobot.listeners.MessageLogger;
|
|
|
|
|
2022-08-26 00:13:06 +02:00
|
|
|
public class Configuration
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
private static boolean verbose = false;
|
2022-08-26 20:43:12 +02:00
|
|
|
private static MessageLogger verbosityLogger;
|
2022-08-26 00:13:06 +02:00
|
|
|
|
2022-11-20 05:57:42 +01:00
|
|
|
// todo: allow people to set their own user id
|
|
|
|
private static final long botOwnerId = 979809420714332260L;
|
|
|
|
|
2022-08-26 00:13:06 +02:00
|
|
|
|
2022-08-26 20:43:12 +02:00
|
|
|
/**
|
|
|
|
* Checks if the bot has been started with the verbose argument.
|
|
|
|
*
|
|
|
|
* @return a boolean which is true if the bot is in verbose-mode
|
|
|
|
*/
|
2022-08-26 00:13:06 +02:00
|
|
|
public static boolean isVerbose() { return verbose; }
|
|
|
|
|
2022-08-26 20:43:12 +02:00
|
|
|
/**
|
|
|
|
* Set the bot's verbosity status at runtime.
|
|
|
|
* This also registers or unregisters the message-logger listener.
|
|
|
|
*
|
|
|
|
* @param v the verbosity boolean value
|
|
|
|
*/
|
|
|
|
public static void setVerbose(boolean v)
|
|
|
|
{
|
|
|
|
verbose = v;
|
|
|
|
|
|
|
|
if(v)
|
|
|
|
{
|
|
|
|
if(verbosityLogger == null)
|
|
|
|
{
|
|
|
|
verbosityLogger = new MessageLogger();
|
|
|
|
}
|
2022-08-26 00:13:06 +02:00
|
|
|
|
2022-08-26 20:43:12 +02:00
|
|
|
HidekoBot.getAPI().addEventListener(verbosityLogger);
|
|
|
|
} else {
|
|
|
|
if(verbosityLogger != null)
|
|
|
|
{
|
|
|
|
HidekoBot.getAPI().removeEventListener(verbosityLogger);
|
|
|
|
verbosityLogger = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-11-20 06:07:25 +01:00
|
|
|
* Get the bot owner's profile id.
|
2022-08-26 20:43:12 +02:00
|
|
|
*
|
2022-11-20 06:07:25 +01:00
|
|
|
* @return a long of the account's id
|
2022-08-26 20:43:12 +02:00
|
|
|
*/
|
2022-11-20 05:57:42 +01:00
|
|
|
public static long getBotOwnerId() { return botOwnerId; }
|
|
|
|
|
2022-08-26 00:13:06 +02:00
|
|
|
}
|