2024-10-27 11:23:12 -05:00
2024-11-14 19:07:33 -06:00
2025-04-01 23:01:39 -05:00
2025-04-01 23:01:39 -05:00
2024-11-09 14:22:29 -06:00

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]
	},
	"debug": false,
	"devmode": false,
	"devchannel": "000000000000000000",
	"botowner": "000000000000000000",
	"devserver": "000000000000000000",
	"token": "fhqwhgadshgnsdhjsdbkhsdabkfabkveybvf"
}
  • onequestionmark will handle most of the motd values itself.
    • date and previous are 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 the channels array.
  • debug determines whether HxDiscord's console debug messages are enabled.
  • devmode restricts the bot's responses to the specified dev server.
  • devchannel, devserver, and botowner 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

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.

Description
No description provided
Readme 141 KiB
2025-02-15 19:55:05 +00:00
Languages
Haxe 100%