commit b74b3a12b6405bb6ac9dac81e3383360a4ba9ba2 Author: Izwzyzx <184772711+Izwzyzx@users.noreply.github.com> Date: Sun Feb 26 14:46:18 2023 -0600 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea05849 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# ignore all files in export dir +export/ + +# ignore bot settings file +settings.json \ No newline at end of file diff --git a/Onequestionmark.hx b/Onequestionmark.hx new file mode 100644 index 0000000..5869c78 --- /dev/null +++ b/Onequestionmark.hx @@ -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) { + } +} \ No newline at end of file diff --git a/hxbuild.hxml b/hxbuild.hxml new file mode 100644 index 0000000..91abe1c --- /dev/null +++ b/hxbuild.hxml @@ -0,0 +1,5 @@ +-m Onequestionmark +-L hxdiscord +#-D no-deprecation-warnings +--hl export/onequestionmark.hl +--cmd hl export/onequestionmark.hl \ No newline at end of file