Skip to content
Devin Spikowski edited this page Jul 21, 2022 · 14 revisions

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

  • servers array, required - An array of server objects to make accessible to D-Zone. Your bot must already be in these servers.
  • url string, optional - The site URL where the simulation can be viewed. This is where you will uploaded the web files.
  • infoCommand string, optional - The bot will respond to this command with the site URL specified in url above. The server ID parameter will automatically be appended to the URL.

Server object

  • id string, required - The snowflake ID of the server. This can be found in Discord under Server Settings > Widget
  • default boolean, required once - This property must exist and equal true for exactly one server in your servers array. It determines which server comes up by default for a new visitor.
  • hideOffline boolean - Set this to true to 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.
  • password string, optional - Adding this property will prompt the user for a password when connecting
  • ignoreChannels array, optional - Ignore messages in these channels. You can use channel IDs or names. Can not be used together with listenChannels
  • listenChannels array, optional - Listen to messages only in these channels. You can use channel IDs or names. Can not be used together with ignoreChannels
  • ignoreUsers array, optional - Ignore messages from these users, and do not include them in the simulation. User IDs must be used.
  • alias string, 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

  • address string, required - The IP of the server or computer that is running npm 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 network
  • port string, 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

  • textbox object - Parameters related to chat message text boxes
    • maxWidth integer - Maximum width (in pixels) of text boxes. Do not set this below 16
    • linesPerPage integer - Maximum number of lines on each page of text before the box is cleared and the next page continues
    • scrollSpeeds array - 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 or 0. For example, [0,3] means for any message greater or equal to length 0 (which is every message), use tick speed 3. Adding [50,2] to the list means that if the message is 50 or more characters, tick speed 2 will be used instead.
    • pageDelay integer - Multiplier for scroll speed when the end of a page is reached. For example, if a message is scrolling at speed 2 and the pageDelay is 5, there will be a 10 tick pause at the end of each page, except for the last page.
    • finalDelay integer - Multiplier for scroll speed when the end of the message is reached. This works the same as pageDelay except only occurs after the last of the message has appeared.
    • openTime integer - Duration of the text box opening animation in ticks (1 tick is 1/60th of a second)
    • closeTime integer - Duration of the text box closing animation in ticks
    • bgColor rgba string - Background color of the text box. This must be an rgba string in the format of rgba(255, 255, 255, 1), which represents Red, Green, Blue, and Opacity. Opacity can be decimal value from 0-1.