Initial commit

This commit is contained in:
Izwzyzx 2023-02-26 14:46:18 -06:00
commit b74b3a12b6
3 changed files with 48 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# ignore all files in export dir
export/
# ignore bot settings file
settings.json

38
Onequestionmark.hx Normal file
View File

@ -0,0 +1,38 @@
import hxdiscord.DiscordClient;
import hxdiscord.types.*;
import hxdiscord.endpoints.Endpoints;
import haxe.Json;
import sys.io.File;
import sys.FileSystem;
class Onequestionmark {
static var Bot:DiscordClient;
static var settings:Dynamic;
static function main() {
// Init
Sys.println("onequestionmark-chat startup\r\n");
if (FileSystem.exists("settings.json")) {
Sys.println("Found settings.json, loading.\r\n");
settings = Json.parse(File.getContent("settings.json"));
} else {
Sys.println("Did not find settings.json, exiting.");
Sys.exit(0);
}
// Start the bot
Bot = new DiscordClient(settings.token, [3276799], settings.debug);
Bot.onReady = onReady;
Bot.onMessageCreate = onMessageCreate;
}
public static function onReady() {
Sys.println("onequestionmark is online.");
Endpoints.sendMessage(settings.devchannel, {content:"onequestionmark-chat alpha test is now running"}, null, false);
}
public static function onMessageCreate(m:Message) {
}
}

5
hxbuild.hxml Normal file
View File

@ -0,0 +1,5 @@
-m Onequestionmark
-L hxdiscord
#-D no-deprecation-warnings
--hl export/onequestionmark.hl
--cmd hl export/onequestionmark.hl