claabs / markov-discord

A Markov chain Discord chat bot. Generates unique messages by learning from past messages. Also occasionally attaches images to messages.
77 stars 20 forks source link

Getting ZodError when attempting to start bot #38

Open llamacomma opened 2 years ago

llamacomma commented 2 years ago

When I attempt to run this bot using docker I get a strange ZodError, could you possibly help?

ZodError: [ { "validation": "regex", "code": "invalid_string", "message": "Invalid", "path": [] } ] at new ZodError (/usr/app/node_modules/zod/src/ZodError.ts:140:5) at handleResult (/usr/app/node_modules/zod/src/types.ts:72:19) at ZodString.ZodType.safeParse (/usr/app/node_modules/zod/src/types.ts:184:12) at ZodString.ZodType.parse (/usr/app/node_modules/zod/src/types.ts:162:25) at X (/usr/app/node_modules/@discordjs/builders/src/interactions/slashCommands/Assertions.ts:15:16) at MixedClass.setName (/usr/app/node_modules/@discordjs/builders/src/interactions/slashCommands/mixins/NameAndDescription.ts:14:3) at Object. (/usr/app/src/deploy-commands.ts:18:4) at Module._compile (node:internal/modules/cjs/loader:1103:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10) at Module.load (node:internal/modules/cjs/loader:981:32)

claabs commented 2 years ago

Are you setting a custom slashCommandName in your config?

llamacomma commented 2 years ago

I am!

llamacomma commented 2 years ago

Thank you so much for the speedy response

claabs commented 2 years ago

I think the command names need to be under 32 characters long, all lowercase, and use dashes/underscore for separation.

The Discord docs have the full regex if you get that: https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-naming

llamacomma commented 2 years ago

That fixed one issue, thank you so much!

Sadly I got another error, is there a setting I forgot to activate in my bot? /usr/app/node_modules/discord.js/src/rest/RequestHandler.js:350 throw new DiscordAPIError(data, res.status, request); ^ DiscordAPIError: Missing Access at RequestHandler.execute (/usr/app/node_modules/discord.js/src/rest/RequestHandler.js:350:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at RequestHandler.push (/usr/app/node_modules/discord.js/src/rest/RequestHandler.js:51:14) at GuildApplicationCommandManager.set (/usr/app/node_modules/discord.js/src/managers/ApplicationCommandManager.js:146:18) at async Promise.all (index 0) at Client. (/usr/app/src/index.ts:642:5)

claabs commented 2 years ago

I can't diagnose that one as quickly. I'd recommend double checking your bot permissions.

llamacomma commented 2 years ago

No problem at all, thank you anyways! I love your bot, I use it all the time!