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

Sending files locally #700

Open
SajjadMomen opened this issue Jan 19, 2025 · 1 comment
Open

Sending files locally #700

SajjadMomen opened this issue Jan 19, 2025 · 1 comment

Comments

@SajjadMomen
Copy link

Hello.
How can I use, for example, a file located in the path /root/mymusic.mp3 to telegram-bot-api that is running locally in methods such as sendAudio and sendDocument?

I tried the following cases but they did not work and I get the error Bad Request: wrong file identifier/HTTP URL specified.

file:///localhost/root/mymusic.mp3
file://localhost/root/mymusic.mp3
file:/localhost/root/mymusic.mp3
localhost/root/mymusic.mp3
/root/mymusic.mp3
https://localhost/root/mymusic.mp3
http://localhost/root/mymusic.mp3
https://SERVERIP/root/mymusic.mp3
http://SERVERIP/root/mymusic.mp3

I received a Bad Request error in all cases.

@levlam
Copy link
Contributor

levlam commented Jan 19, 2025

See https://en.wikipedia.org/wiki/File_URI_scheme#Examples.

Also, make sure that you run the Bot API server in local mode as described at https://github.com/tdlib/telegram-bot-api?tab=readme-ov-file#usage.

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