LBRYFoundation / lbry-wunderbot

https://chat.lbry.io
MIT License
23 stars 41 forks source link

Error: Configuration property "bot" is not defined #229

Closed Owned67 closed 5 years ago

Owned67 commented 5 years ago

npm -v 6.7.0 node -v v8.9.4 nomades-bot\node_modules\config\lib\config.js:203 throw new Error('Configuration property "' + property + '" is not defined'); Error: Configuration property "bot" is not defined at Config.get (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\config\lib\config.js:203:11) at Object.<anonymous> (C:\Users\Alpha\BotDiscord\nomades-bot\bot\bot.js:7:17) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Function.Module.runMain (module.js:684:10) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3

tzarebczan commented 5 years ago

Hey, thanks for opening this issue. Can you give us more information on when you see this? What steps have you taken? Have you followed https://github.com/lbryio/lbry-wunderbot#installation ?

Owned67 commented 5 years ago

npm install --production

sleep@5.2.3 install C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\sleep node-gyp rebuild

C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\sleep>if not defined npm_config_node_gyp (node "C:\Users\Alpha\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\Alpha\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp ERR! configure error gyp ERR! stack Error: Command failed: D:\Python\Python36\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "", line 1 gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack ^ gyp ERR! stack SyntaxError: invalid syntax gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:275:12) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at maybeClose (internal/child_process.js:925:16) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) gyp ERR! System Windows_NT 10.0.17763 gyp ERR! command "D:\Program Files\nodejs\node.exe" "C:\Users\Alpha\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\sleep gyp ERR! node -v v8.9.4 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN discord.js@11.4.2 requires a peer of bufferutil@^3.0.3 but none is installed. You must install peer dependencies yourself. npm WARN discord.js@11.4.2 requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself. npm WARN discord.js@11.4.2 requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself. npm WARN discord.js@11.4.2 requires a peer of opusscript@^0.0.6 but none is installed. You must install peer dependencies yourself. npm WARN discord.js@11.4.2 requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself. npm WARN discord.js@11.4.2 requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself. npm WARN discord.js@11.4.2 requires a peer of uws@^9.14.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sleep@5.2.3 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sleep@5.2.3 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Alpha\AppData\Roaming\npm-cache_logs\2019-02-07T19_05_39_328Z-debug.log

and after: node bot/bot.js

filipnyquist commented 5 years ago

Hi! Seems you are missing some build tools needed for sleep to build. Try installing https://www.npmjs.com/package/windows-build-tools

Owned67 commented 5 years ago

Thanks but i don't want python 2.x.... i have python 3.x... so close.

V3 is not supported, ok :( RIP

Owned67 commented 5 years ago

Its same...

Status from the installers: ---------- Visual Studio Build Tools ---------- Successfully installed Visual Studio Build Tools. ------------------- Python -------------------- Successfully installed Python 2.7

Now configuring the Visual Studio Build Tools and Python...

All done!

node bot/bot WARNING: No configurations found in configuration directory:C:\Users\Alpha\BotDiscord\nomades-bot\config WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment. C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\config\lib\config.js:203 throw new Error('Configuration property "' + property + '" is not defined'); ^

Error: Configuration property "bot" is not defined at Config.get (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\config\lib\config.js:203:11) at Object. (C:\Users\Alpha\BotDiscord\nomades-bot\bot\bot.js:7:17) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Function.Module.runMain (module.js:684:10) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3

Ok rename config file to default.json and after node bot/bot:

No aliases defined Logged in! Serving in 1 servers { ConfigurationError: Missing configuration field discordToken at Bot.REQUIRED_FIELDS.forEach.field (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord-irc\dist\bot.js:45:15) at Array.forEach () at new Bot (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord-irc\dist\bot.js:43:21) at configFile.forEach.config (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord-irc\dist\helpers.js:30:19) at Array.forEach () at createBots (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord-irc\dist\helpers.js:29:16) at exports.irc (C:\Users\Alpha\BotDiscord\nomades-bot\bot\modules\ircbridge.js:7:3) at Object.exports.addCustomFunc (C:\Users\Alpha\BotDiscord\nomades-bot\bot\bot.js:207:5) at load_plugins (C:\Users\Alpha\BotDiscord\nomades-bot\bot\plugins.js:39:18) at Object.init (C:\Users\Alpha\BotDiscord\nomades-bot\bot\plugins.js:13:3) name: 'ConfigurationError' } Loaded 12 chat commands and 5 custom functions. type /help in Discord for a commands list. Activating claimbot C:\Users\Alpha\BotDiscord\nomades-bot\bot\modules\claimbot.js:22 discordBot.channels.get(channels[0]).send('activating claimbot'); ^

TypeError: Cannot read property 'send' of undefined at Object.init (C:\Users\Alpha\BotDiscord\nomades-bot\bot\modules\claimbot.js:22:39) at Client. (C:\Users\Alpha\BotDiscord\nomades-bot\bot\bot.js:50:12) at emitNone (events.js:111:20) at Client.emit (events.js:208:7) at WebSocketConnection.triggerReady (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:125:17) at WebSocketConnection.checkIfReady (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:141:61) at GuildCreateHandler.handle (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord.js\src\client\websocket\packets\handlers\GuildCreate.js:13:31) at WebSocketPacketManager.handle (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65) at WebSocketConnection.onPacket (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35) at WebSocketConnection.onMessage (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)

Coolguy3289 commented 5 years ago

Please ensure that all fields in the default.json are filled, including the Discord Bot Token (Required). Modules like claimbot, etc. require configuration values as well, so if you don't plan on using them, be sure to remove those functions from bot.js (Just look for the initialization code). If you can't find it, let me know and I'll help you find what I'm talking about!

Owned67 commented 5 years ago

Ive disabled claimbot but { ConfigurationError: Missing configuration field discordToken at Bot.REQUIRED_FIELDS.forEach.field (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord-irc\dist\bot.js:45:15) at Array.forEach () at new Bot (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord-irc\dist\bot.js:43:21) at configFile.forEach.config (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord-irc\dist\helpers.js:30:19) at Array.forEach () at createBots (C:\Users\Alpha\BotDiscord\nomades-bot\node_modules\discord-irc\dist\helpers.js:29:16) at exports.irc (C:\Users\Alpha\BotDiscord\nomades-bot\bot\modules\ircbridge.js:7:3) at Object.exports.addCustomFunc (C:\Users\Alpha\BotDiscord\nomades-bot\bot\bot.js:207:5) at load_plugins (C:\Users\Alpha\BotDiscord\nomades-bot\bot\plugins.js:39:18) at Object.init (C:\Users\Alpha\BotDiscord\nomades-bot\bot\plugins.js:13:3) name: 'ConfigurationError' }

nikooo777 commented 5 years ago

check C:\Users\Alpha\BotDiscord\nomades-bot\bot\modules\ircbridge.js at line 7, it's looking for that token.

Owned67 commented 5 years ago

Thanks