-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
[BUG] Using telegram bot local server can't send / receive Files #133
Comments
我也遇到这个问题,但是我可以接收文件,但是发送文件时会提示
以下是我使用的主端和从端版本
日志
|
我参考这个用nginx将接收到的文件暴露出来解决了问题 |
问题1:发送文件失败,提示 FileNotFoundError: [Errno 2] No such file or directory: 'file:///tmp/tmpp5_qox2o’ 解决方法:efb_telegram_master/slave_message.py文件中process_file_obj 修改为:
问题2:接收文件失败,提示invalid Token 解决方法:profiles/default/blueset.telegram/config.yaml 中 api_base_file_url 填写telegram bot api的work dir,例如: api_base_file_url: "/home/pangxiezhou/.telegram_bot_server/" |
Describe the bug
Using telegram bot local server can't send / receive Files
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When I change the telegram api to the local server,the bot can received the text,but when I sent the pictures or
any files, the bot prompts that
"Unknown error has occurred while trying to process this message. See log for details.
InvalidToken() " 。
When I received files, nothing prompted and couldn't receive them
Screenshots
If applicable, add screenshots to help explain your problem.
Version information (please complete the following information):
ehforwarderbot --version
)Additional context
elete_chat_photo': False, 'channel_chat_created': False, 'caption_entities': [], 'from': {'id': xxxxx, 'is_bot': False, 'first_name': 'xxxx', 'language_code': 'zh-hans'}}, 'update_id': xxxxx}.
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.8/site-packages/efb_telegram_master/master_message.py", line 103, in message_worker
self.msg(update, context)
File "/home/ubuntu/.local/lib/python3.8/site-packages/efb_telegram_master/master_message.py", line 207, in msg
return self.process_telegram_message(update, context, destination, quote=quote, edited=edited)
File "/home/ubuntu/.local/lib/python3.8/site-packages/efb_telegram_master/master_message.py", line 426, in process_telegram_message
if m.file:
File "/home/ubuntu/.local/lib/python3.8/site-packages/efb_telegram_master/message.py", line 130, in get_file
self._load_file()
File "/home/ubuntu/.local/lib/python3.8/site-packages/efb_telegram_master/message.py", line 77, in _load_file
file_meta.download(out=file)
File "/home/ubuntu/.local/lib/python3.8/site-packages/telegram/files/file.py", line 148, in download
buf = self.bot.request.retrieve(url)
File "/home/ubuntu/.local/lib/python3.8/site-packages/telegram/utils/request.py", line 385, in retrieve
return self._request_wrapper('GET', url, **urlopen_kwargs)
File "/home/ubuntu/.local/lib/python3.8/site-packages/telegram/utils/request.py", line 281, in _request_wrapper
raise InvalidToken()
telegram.error.InvalidToken: Invalid token
The text was updated successfully, but these errors were encountered: