Configuration - d-zone-org/d-zone GitHub Wiki
Configuration Files
Token
Set in your system's environment variables, or with .env
A variable named token should contain your Discord bot's authentication token, found here.
Discord
discord-config.json
Changes to this file do not require running build again
{
"url": "http://pixelatomy.com/dzone",
"infoCommand": "!d-zone",
"servers": [
{
"id": "1234567891234567",
"default": true,
"ignoreChannels": ["members-Only","testing"]
}
]
}
Properties
serversarray, required - An array of server objects to make accessible to D-Zone. Your bot must already be in these servers.urlstring, optional - The site URL where the simulation can be viewed. This is where you will uploaded the web files.infoCommandstring, optional - The bot will respond to this command with the site URL specified inurlabove. The server ID parameter will automatically be appended to the URL.
Server object
idstring, required - The snowflake ID of the server. This can be found in Discord under Server Settings > Widgetdefaultboolean, required once - This property must exist and equaltruefor exactly one server in yourserversarray. It determines which server comes up by default for a new visitor.hideOfflineboolean - Set this totrueto hide offline users from the server. Users who go offline or come online while viewing the simulation will disappear or reappear as needed. Recommended for larger servers.passwordstring, optional - Adding this property will prompt the user for a password when connectingignoreChannelsarray, optional - Ignore messages in these channels. You can use channel IDs or names. Can not be used together withlistenChannelslistenChannelsarray, optional - Listen to messages only in these channels. You can use channel IDs or names. Can not be used together withignoreChannelsignoreUsersarray, optional - Ignore messages from these users, and do not include them in the simulation. User IDs must be used.aliasstring, optional - Change the name of your server as it appears in D-Zone
Socket
socket-config.json
Changes to this file require running build again and re-uploading bundle.js
{
"address": "192.168.0.1",
"port": "3000"
}
Properties
addressstring, required - The IP of the server or computer that is runningnpm start. This must be an external IP if your D-Zone is to be viewed by the rest of the internet, or any computer outside of the server's local networkportstring, required - The port number for the websocket to run on. This port must not be in use by any other application, and must be accessible from outside traffic (check port-forwarding on your router). It is recommended that you use a number above 3000 to avoid reserved ports.
Misc
misc-config.json
Changes to this file require running build again and re-uploading bundle.js
The existence of this file and all properties within is optional
{
"textbox": {
"maxWidth": 96,
"linesPerPage": 4,
"scrollSpeeds": [
[0, 3],
[75, 2],
[150, 1]
],
"pageDelay": 5,
"finalDelay": 30,
"openTime": 10,
"closeTime": 8,
"bgColor": "rgba(0, 0, 0, 0.7)"
}
}
Properties
textboxobject - Parameters related to chat message text boxesmaxWidthinteger - Maximum width (in pixels) of text boxes. Do not set this below16linesPerPageinteger - Maximum number of lines on each page of text before the box is cleared and the next page continuesscrollSpeedsarray - Contains integer 2-tuples ([0,3]) indicating scroll speed for a minimum message length. The speed is measured in number of ticks per character (1 tick is 1/60th of a second), so a higher number means slower speed. Do not use decimals or0. For example,[0,3]means for any message greater or equal to length0(which is every message), use tick speed3. Adding[50,2]to the list means that if the message is50or more characters, tick speed2will be used instead.pageDelayinteger - Multiplier for scroll speed when the end of a page is reached. For example, if a message is scrolling at speed2and thepageDelayis5, there will be a10tick pause at the end of each page, except for the last page.finalDelayinteger - Multiplier for scroll speed when the end of the message is reached. This works the same aspageDelayexcept only occurs after the last of the message has appeared.openTimeinteger - Duration of the text box opening animation in ticks (1 tick is 1/60th of a second)closeTimeinteger - Duration of the text box closing animation in ticksbgColorrgba string - Background color of the text box. This must be anrgbastring in the format ofrgba(255, 255, 255, 1), which represents Red, Green, Blue, and Opacity. Opacity can be decimal value from 0-1.