| src | ||
| .gitignore | ||
| CHANGELOG.md | ||
| hxbuild.hxml | ||
| README.md | ||
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": [],
"previous": [0,0,0,0,0,0,0]
},
"icelist": [],
"debug": false,
"devmode": false,
"devchannel": "000000000000000000",
"botowner": "000000000000000000",
"devserver": "000000000000000000",
"token": "fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf"
}
- onequestionmark will handle most of the
motdvalues itself.dateandpreviousare modified by the bot during normal operations.timedetermines the hour at which the MOTD is posted (24-hour notation, local time).- Using the
?motdcommand adds the current channel to thechannelsarray.
icelistis a channel blacklist for the Ice Autoresponder.?ice.togglewill add/remove the current channel ID from this array.debugdetermines whether HxDiscord's console debug messages are enabled.devmoderestricts the bot's responses to the specified dev server.devchannel,devserver, andbotownermust be filled with the appropriate numerical values. These values can be seen easily in Discord's URLs.tokenis your Discord bot app token. Don't share it.
The Settings file is the only one that must be provided. onequestionmark will generate default custom-cmds.json, echobox-db.json, and motd-db.json files in the data/ directory at startup if it fails to find any of them.
As settings.json contains sensitive information and the data/ folder contains files specific to the running bot instance, they are excluded from this repo. Data files for the official onequestionmark-chat instance can be found here.
Building from source
Requirements
- Haxe Programming Language
- HxDiscord (Izz Fork) originally by FurretPaws
- IzzComLib by Izwzyzx
- HtmlParser by yar3333
- littleBigInt by maitag
Install the libraries from their git repositories (except HtmlParser because its repo isn't set up for that).
Compiling
Navigate to the project folder in a terminal and run haxe hxbuild.hxml -D version=x.y, replacing x.y with the appropriate version info. This will generate onequestionmark.n in the export folder.
As of v1.3-indev5, onequestionmark will refuse to start if
versionis not defined at build time. See Conditional Compilation in the Haxe manual for more details.
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 settings.json file.
It is preferable to stop the bot via its own ?quit command in Discord, so it can save its files before exiting.