Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with new bot #10

Open
grainsoflight opened this issue Jun 4, 2020 · 3 comments
Open

Issue with new bot #10

grainsoflight opened this issue Jun 4, 2020 · 3 comments

Comments

@grainsoflight
Copy link

I couldn't figure out how to contact you via glitch, but the new bot you built is unresponsive when you try to give it commands in discord.

@AlexanderLindsay
Copy link
Owner

This works as a way to get in touch with me. Until and unless I make a github for the other bot, which I will make a note on this one if I do that.

It is hard to know what is going wrong from just that but I can guess at some likely causes:

  1. check to make sure that the bot has the required permissions to see the chat (that it can read the message history of the channel that you are sending it messages in)
  2. check to make sure that the message you are sending it is correct (the bot is not good about telling you when it doesn't understand commands and just fails silently)

If those aren't the issues I would need more information to help fix it. You can look at the logs in the glitch project to see if any error message appears there. (Tools (in the bottom left) -> Logs). If you do see an error message you can add it to this thread.

Hopefully that gives you some directions to go look for the error.

@grainsoflight
Copy link
Author

An error occurred in the categorize middleware: TypeError: Cannot read property 'indexOf' of undefined
at isMention (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/botkit-discord/0.1.3/node_modules/botkit-discord/middleware/categorize.js:1:52)
at categorize (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/botkit-discord/0.1.3/node_modules/botkit-discord/middleware/categorize.js:21:6)
at Ware.module.exports.handler (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/botkit-discord/0.1.3/node_modules/botkit-discord/middleware/categorize.js:33:2)
at Ware. (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/wrap-fn/0.1.5/node_modules/wrap-fn/index.js:45:19)
at next (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/ware/1.3.0/node_modules/ware/lib/index.js:85:20)
at Ware.run (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/ware/1.3.0/node_modules/ware/lib/index.js:88:3)
at Object.Botkit.botkit.categorize (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/botkit/0.6.21/node_modules/botkit/lib/CoreBot.js:118:38)
at /rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/botkit/0.6.21/node_modules/botkit/lib/CoreBot.js:112:20
at next (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/ware/1.3.0/node_modules/ware/lib/index.js:82:27)
at /rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/wrap-fn/0.1.5/node_modules/wrap-fn/index.js:121:18
(node:113) UnhandledPromiseRejectionWarning: Error: User is not in a voice channel
at Object.joinVoiceChannel (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/botkit-discord/0.1.3/node_modules/botkit-discord/api/index.js:3:9)
at /app/skills/hears.js:14:38
at /rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/botkit/0.6.21/node_modules/botkit/lib/CoreBot.js:1348:32
at next (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/ware/1.3.0/node_modules/ware/lib/index.js:82:27)
at Ware.run (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/ware/1.3.0/node_modules/ware/lib/index.js:88:3)
at Object. (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/botkit/0.6.21/node_modules/botkit/lib/CoreBot.js:1347:49)
at Object.Botkit.botkit.trigger (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/botkit/0.6.21/node_modules/botkit/lib/CoreBot.js:1396:47)
at /rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/botkit/0.6.21/node_modules/botkit/lib/CoreBot.js:149:32
at Object.bot.findConversation (/rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/botkit-discord/0.1.3/node_modules/botkit-discord/bot.js:52:3)
at /rbd/pnpm-volume/9edb1cd0-2e0c-4e54-85db-7a721babbdc9/node_modules/.registry.npmjs.org/botkit/0.6.21/node_modules/botkit/lib/CoreBot.js:145:21
(node:113) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:113) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@AlexanderLindsay
Copy link
Owner

Thanks for showing the error! It appears that the error is occurring because the user who is talking to the bot is not in a voice channel when they do so, the bot joins the voice channel that the user is in. So it should work if you join a voice channel before talking to the bot.

This shows the issue with not having good documentation or error handling 😅, sorry that it wasn't clear.

let me know if it works when you are in a voice channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants