Fixed reconnection starting duplicate timers

This commit is contained in:
Izwzyzx 2024-10-29 18:47:25 -05:00
parent 729d6b41be
commit 08d023076b
2 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,7 @@
# Changelog # Changelog
## Release Version 1.2 ## Release Version 1.2
- Fixed reconnection starting duplicate timers
- Added system to prevent MOTD from chosing the same daily result consecutively - Added system to prevent MOTD from chosing the same daily result consecutively
- Added support for MOTDs matching only the date - Added support for MOTDs matching only the date
- General purpose functions have been split off into IzzComLib - General purpose functions have been split off into IzzComLib

View File

@ -23,6 +23,7 @@ class Onequestionmark {
static var motdTimer:Timer; static var motdTimer:Timer;
static var saveTimer:Timer; static var saveTimer:Timer;
static var saveQueue:Array<String> = []; static var saveQueue:Array<String> = [];
static var timerInit:Bool = false;
static function main() { static function main() {
@ -70,6 +71,8 @@ class Onequestionmark {
File.saveContent("echobox-db.json", Json.stringify(echoboxDB, "\t")); File.saveContent("echobox-db.json", Json.stringify(echoboxDB, "\t"));
} }
saveSystem();
// Start the bot // Start the bot
Bot = new DiscordClient(settings.token, [3276799], settings.debug); Bot = new DiscordClient(settings.token, [3276799], settings.debug);
Bot.onReady = onReady; Bot.onReady = onReady;
@ -92,8 +95,10 @@ class Onequestionmark {
botInfo = Endpoints.getCurrentUser(); botInfo = Endpoints.getCurrentUser();
if (timerInit == false) {
timerInit = true;
startMotd(); startMotd();
saveSystem(); }
} }