3.0 KiB
onequestionmark-chat
onequestionmark is a Discord bot written in Haxe.
Name origin
Following the established naming scheme of Maralis and Derxwna's fivequestionmarks and Kuschelyagi's tenquestionmarks, onequestionmark is named after the glitch Pokémon known only as "?" (which amusingly has two question marks as its sprite).
"onequestionmark" is never capitalized.
Configuration
A settings.json
file is required to run the bot. An example is provided below:
{
"motd": {
"date": "",
"time": 8,
"channels": []
},
"debug": false,
"devmode": false,
"devchannel": "000000000000000000",
"botowner": "000000000000000000",
"devserver": "000000000000000000",
"token": "fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf"
}
- onequestionmark will handle most of the
motd
values itself.date
is modified by the bot during normal operations.time
determines the hour at which the MOTD is posted (24-hour notation, local time).- Using the
?motd
command adds the current channel to thechannels
array.
debug
determines whether HxDiscord's console debug messages are enabled.devmode
restricts the bot's responses to the specified dev server.devchannel
,devserver
, andbotowner
must be filled with the appropriate numerical values. These values can be seen easily in Discord's URLs.token
is your Discord bot app token. Don't share it.
An echobox-db.json
file will also be generated by onequestionmark upon starting if it fails to find one.
The motd-db.json
, yesno-db.json
, and hug-db.json
files provided in this repo are examples that will need to be replaced with correct data. Any of these three files can also be removed. If onequestionmark cannot find one of these files at startup, the bot will simply disable the corresponding function.
settings.json
and echobox-db.json
are the only files modified by the bot during operation. As they can contain sensitive data, they are excluded from Git tracking.
Building from source
Requirements
- Haxe Programming Language
- HxDiscord by FurretPaws
- IzzComLib by Izwzyzx
Install the libraries from their git repositories.
Compiling
Navigate to the project folder in a terminal and run haxe hxbuild.hxml
. This will generate onequestionmark.n
in the export folder.
The provided hxbuild.hxml
file is set up to immediately run the bot after compiling.
Running
neko onequestionmark.n
onequestionmark is designed and tested to run in NekoVM (included with Haxe). Other Haxe targets not guaranteed to work (see HxDiscord library's compatibility).
onequestionmark.n
should be placed in the same directory as its JSON files.
It is preferable to stop the bot via its own ?quit
command in Discord, so it can save its settings file before exiting.