RolfKoenders / potato

🍿 Mr. Potato is your slackbot for couchpotato!
MIT License
23 stars 8 forks source link

Channel messages are not working #12

Closed claytondukes closed 7 years ago

claytondukes commented 7 years ago

DM's work now (thanks!), but when I try the same commands in a channel, no luck. e.g.: search movie harry potter works in DM, but I tried @couchpotato search movie harry potter and just search movie harry potter in the channel...no reply. (no error log either)

Am I just doing it wrong?

Edit: I just realized it is a private channel, but also just tried creating a public channel. Doesn't work there either :(

claytondukes commented 7 years ago

After a few more minutes, I did get a message in the log, not sure if it is related:

Jun 15 00:07:53 plex systemd[1]: Started Potato Bot.
Jun 15 00:16:29 plex potatoBot[15263]: TypeError: Cannot read property 'name' of undefined
Jun 15 00:16:29 plex potatoBot[15263]:     at Bot._onMessage (/opt/potato/node_modules/slackbotify/lib/bot.js:56:55)
Jun 15 00:16:29 plex potatoBot[15263]:     at emitOne (events.js:96:13)
Jun 15 00:16:29 plex potatoBot[15263]:     at Bot.emit (events.js:188:7)
Jun 15 00:16:29 plex potatoBot[15263]:     at Bot.<anonymous> (/opt/potato/node_modules/slackbots/index.js:62:18)
Jun 15 00:16:29 plex potatoBot[15263]:     at emitTwo (events.js:106:13)
Jun 15 00:16:29 plex potatoBot[15263]:     at WebSocket.emit (events.js:191:7)
Jun 15 00:16:29 plex potatoBot[15263]:     at Receiver.ontext (/opt/potato/node_modules/ws/lib/WebSocket.js:841:10)
Jun 15 00:16:29 plex potatoBot[15263]:     at /opt/potato/node_modules/ws/lib/Receiver.js:536:18
Jun 15 00:16:29 plex potatoBot[15263]:     at Receiver.applyExtensions (/opt/potato/node_modules/ws/lib/Receiver.js:371:5)
Jun 15 00:16:29 plex potatoBot[15263]:     at /opt/potato/node_modules/ws/lib/Receiver.js:508:14
Jun 15 00:16:33 plex potatoBot[15263]: TypeError: Cannot read property 'name' of undefined
Jun 15 00:16:33 plex potatoBot[15263]:     at Bot._onMessage (/opt/potato/node_modules/slackbotify/lib/bot.js:56:55)
Jun 15 00:16:33 plex potatoBot[15263]:     at emitOne (events.js:96:13)
Jun 15 00:16:33 plex potatoBot[15263]:     at Bot.emit (events.js:188:7)
Jun 15 00:16:33 plex potatoBot[15263]:     at Bot.<anonymous> (/opt/potato/node_modules/slackbots/index.js:62:18)
Jun 15 00:16:33 plex potatoBot[15263]:     at emitTwo (events.js:106:13)
Jun 15 00:16:33 plex potatoBot[15263]:     at WebSocket.emit (events.js:191:7)
Jun 15 00:16:33 plex potatoBot[15263]:     at Receiver.ontext (/opt/potato/node_modules/ws/lib/WebSocket.js:841:10)
Jun 15 00:16:33 plex potatoBot[15263]:     at /opt/potato/node_modules/ws/lib/Receiver.js:536:18
Jun 15 00:16:33 plex potatoBot[15263]:     at Receiver.applyExtensions (/opt/potato/node_modules/ws/lib/Receiver.js:371:5)
Jun 15 00:16:33 plex potatoBot[15263]:     at /opt/potato/node_modules/ws/lib/Receiver.js:508:14
Jun 15 00:16:40 plex potatoBot[15263]: TypeError: Cannot read property 'name' of undefined
Jun 15 00:16:40 plex potatoBot[15263]:     at Bot._onMessage (/opt/potato/node_modules/slackbotify/lib/bot.js:56:55)
Jun 15 00:16:40 plex potatoBot[15263]:     at emitOne (events.js:96:13)
Jun 15 00:16:40 plex potatoBot[15263]:     at Bot.emit (events.js:188:7)
Jun 15 00:16:40 plex potatoBot[15263]:     at Bot.<anonymous> (/opt/potato/node_modules/slackbots/index.js:62:18)
Jun 15 00:16:40 plex potatoBot[15263]:     at emitTwo (events.js:106:13)
Jun 15 00:16:40 plex potatoBot[15263]:     at WebSocket.emit (events.js:191:7)
Jun 15 00:16:41 plex potatoBot[15263]:     at Receiver.ontext (/opt/potato/node_modules/ws/lib/WebSocket.js:841:10)
Jun 15 00:16:41 plex potatoBot[15263]:     at /opt/potato/node_modules/ws/lib/Receiver.js:536:18
Jun 15 00:16:41 plex potatoBot[15263]:     at Receiver.applyExtensions (/opt/potato/node_modules/ws/lib/Receiver.js:371:5)
Jun 15 00:16:41 plex potatoBot[15263]:     at /opt/potato/node_modules/ws/lib/Receiver.js:508:14
RolfKoenders commented 7 years ago

I indeed remember there was an issue with channels being created after the bot was already connected. Will investigate!

claytondukes commented 7 years ago

The first channel was created before the bot was connected.

claytondukes commented 7 years ago

Hi Rolf, I tried it out and no longer get an error message but noticed the following from a channel: @cpbot search movie harry potter works in a public channel but not in a private channel. @cpbot download movie harry potter works in a public channel but not in a private channel. @cpbot help doesn't work at all.

RolfKoenders commented 7 years ago

@claytondukes Ive never tried private channels, is the bot invited to the private channel as well? Help works in a channel and in a pm. Just tried a pm.

Screenshot