reactiflux / discord-irc

Connects Discord and IRC channels by sending messages back and forth.
MIT License
1.2k stars 293 forks source link

The configuration file contains invalid JSON #595

Closed SuatNguyen closed 3 years ago

SuatNguyen commented 3 years ago

Hello, I have some issues. What should I do then?

xxx@xxx:~/git/discord-irc$ npm start -- --config test.json

discord-irc@2.9.0 start node dist/index.js "--config" "test.json"

/home/xxx/git/discord-irc/dist/cli.js:40 throw new _errors.ConfigurationError('The configuration file contains invalid JSON'); ^

ConfigurationError: The configuration file contains invalid JSON at readJSONConfig (/home/xxx/git/discord-irc/dist/cli.js:40:13) at Object.run [as default] (/home/xxx/git/discord-irc/dist/cli.js:58:98) at Object. (/home/xxx/git/discord-irc/dist/index.js:13:27) at Module._compile (node:internal/modules/cjs/loader:1109:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10) at Module.load (node:internal/modules/cjs/loader:989:32) at Function.Module._load (node:internal/modules/cjs/loader:829:14) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) at node:internal/main/run_main_module:17:47

The test.json file

[{ "nickname": "StackHub", "server": "irc.freenode.net", "discordToken": "XXX", "autoSendCommands": [ ["PRIVMSG", "XXX", "Up"] ], "channelMapping": { "#questions": "##stackhub" }, "format": { "commandPrelude": "Command sent by {$nickname}", "ircText": "<{$displayUsername}> {$text}", "urlAttachment": "<{$displayUsername}> {$attachmentURL}", "discord": "<{$author}> {$withMentions}", "webhookAvatarURL": "https://robohash.org/{$nickname}" }, "ircNickColor": true, "ircNickColors": ["light_blue", "dark_blue", "light_red", "dark_red", "light_green", "dark_green", "magenta", "light_magenta", "orange", "yellow", "cyan", "light_cyan"], "parallelPingFix": true, "commandCharacters": ["!", "."], "ircStatusNotices": true, }]

misyltoad commented 3 years ago

There should be no comma after "ircStatusNotices": true