fix(app): made changes for deploying to vercel
Changes
- Added dotenv for Vercel deployment configuration
- Added ping-pong command functionality:
-
/pingcommand and text msgpingnow respond with "pong"
-
- Added Ukrainian (uk) localization with translations for all commands and messages
- Createed [src/bot/handlers/commands/command-definitions.ts] to simplify adding new commands.
- Updated [src/bot/handlers/commands/setcommands.ts]
Link to the working bot @grammy_vercel_bot
@semklim Hi, I used your commit to make it work, but get error in vercel logs. Not sure what's wrong here
Error: Invalid config
at createConfigFromEnvironment (file:///var/task/build/src/config.js:62:15)
at file:///var/task/build/src/config.js:67:16
... 2 lines matching cause stack trace ...
at async d (/opt/rust/nodejs.js:16:18009) {
[cause]: ValiError: Invalid type: Expected string but received undefined
at Module.parse (file:///var/task/node_modules/valibot/dist/index.js:5219:11)
at createConfig (file:///var/task/build/src/config.js:53:14)
at createConfigFromEnvironment (file:///var/task/build/src/config.js:58:24)
at file:///var/task/build/src/config.js:67:16
at ModuleJob.run (node:internal/modules/esm/module_job:268:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:543:26)
at async d (/opt/rust/nodejs.js:16:18009) {
issues: [ [Object] ]
}
}
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.
[cause]: ValiError: Invalid type: Expected string but received undefined
I going to check localy your problem, but please check your .env file. I think you forgot to add the variable(s).
Here’s my .env file that worked on Vercel:
@m0sviatoslav
I allready try it on my local machine and all works. Try this .env.
BOT_TOKEN=
BOT_MODE=polling
LOG_LEVEL=debug
DEBUG=true
BOT_WEBHOOK=https://www.example.com/webhook
BOT_WEBHOOK_SECRET="super-secret-key"
SERVER_HOST=localhost
SERVER_PORT=3000
BOT_ADMINS=[1]
@semklim thank you!
@m0sviatoslav, I also found where the problem was. Problem with the vercel Sensitive flag. I am going to correct the readme.