Closed yevheniikulisidi closed 8 months ago
You need to configure the files plugin in the same way you configure the bot.
However, environment
is actually not supported by the plugin yet. I will quickly add it.
@yevheniikulisidi can you run
npm install github:grammyjs/files#env
and see if that allows you to configure the plugin correctly? Use
hydrateFiles(bot.token, {
client: { environment: environment === 'production' ? 'prod' : 'test' }
})
and please approve #8 if that fixes your problem.
@KnorpelSenf It's not working!
Remember that when you say it “doesn't work”, we cannot login to your computer and figure out what's wrong. You need to explain what you are doing, what you are expecting to happen, and what is actually happening. If there's an error, share the full error message, too :)
When a bot class has an environment variable
test
:Using this code:
The
fileUrl
variable ishttps://api.telegram.org/file/bot<token>/<file_path>
It should behttps://api.telegram.org/file/bot<token>/test/<file_path>