Initial commit
This commit is contained in:
commit
b74b3a12b6
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# ignore all files in export dir
|
||||||
|
export/
|
||||||
|
|
||||||
|
# ignore bot settings file
|
||||||
|
settings.json
|
38
Onequestionmark.hx
Normal file
38
Onequestionmark.hx
Normal 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
5
hxbuild.hxml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
-m Onequestionmark
|
||||||
|
-L hxdiscord
|
||||||
|
#-D no-deprecation-warnings
|
||||||
|
--hl export/onequestionmark.hl
|
||||||
|
--cmd hl export/onequestionmark.hl
|
Loading…
x
Reference in New Issue
Block a user