38 lines
1.0 KiB
Haxe
38 lines
1.0 KiB
Haxe
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) {
|
|
}
|
|
} |