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

[BUG] Can't receive voice message #156

Open
churchilldu opened this issue Jan 20, 2025 · 0 comments
Open

[BUG] Can't receive voice message #156

churchilldu opened this issue Jan 20, 2025 · 0 comments
Labels

Comments

@churchilldu
Copy link

版本信息 Version Info

EH Forwarder Bot
Version: 2.1.1
Python version:
3.8.10

Master channel:
    EFB Telegram Master Channel 2.3.1, running on profile “wechat”, default instance, on EFB 2.1.1.

Slave channel:
    WeChat Slave (blueset.wechat, 2.0.7)

Middleware:
  - Link Preview Middleware (catbaron.link_preview, 0.1.0)
  - MP InstantView Middleware (catbaron.mp_instantview, 0.3.2)
    

问题描述 Describe the bug

I can't receive voice message on telegram. but video/picture/text message is fine.

重现步骤 To Reproduce

截图 Screenshots

Verbose 日志 Log

Verbose 日志


Jan 20 06:07:13 host ehforwarderbot[443]: Message: <Message, <ETMSelfChatMember: You (__self__) @ <ETMPrivateChat: **** ) @ 💬WeChat Slave (blueset.wechat)>>@<ETMPrivateChat: ****  @ 💬WeChat Slave (blueset.wechat)> [Voice]: ; Attributes: None; Delivering to: <efb_telegram_master.TelegramChannel object at **** >; Edited: False; System message: False; Substitutions: None; Target messages: None; UID: [["**** "]]; Reactions: {}; File: <tempfile._TemporaryFileWrapper object at **** > (None @ /tmp/tmp0cuqvn9n), audio/mpeg; Vendor: {}>
Jan 20 06:07:13 host ehforwarderbot[443]: BadRequest()
Jan 20 06:07:13 host ehforwarderbot[443]: Traceback (most recent call last):
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/bot_manager.py", line 357, in send_voice
Jan 20 06:07:13 host ehforwarderbot[443]:     return self.updater.bot.send_voice(*args, **kwargs)
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/bot.py", line 134, in decorator
Jan 20 06:07:13 host ehforwarderbot[443]:     result = func(*args, **kwargs)
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/bot.py", line 1571, in send_voice
Jan 20 06:07:13 host ehforwarderbot[443]:     return self._message(  # type: ignore[return-value]
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/ext/extbot.py", line 203, in _message
Jan 20 06:07:13 host ehforwarderbot[443]:     result = super()._message(
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/bot.py", line 344, in _message
Jan 20 06:07:13 host ehforwarderbot[443]:     result = self._post(endpoint, data, timeout=timeout, api_kwargs=api_kwargs)
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/bot.py", line 299, in _post
Jan 20 06:07:13 host ehforwarderbot[443]:     return self.request.post(
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/utils/request.py", line 359, in post
Jan 20 06:07:13 host ehforwarderbot[443]:     result = self._request_wrapper('POST', url, fields=data, **urlopen_kwargs)
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/utils/request.py", line 279, in _request_wrapper
Jan 20 06:07:13 host ehforwarderbot[443]:     raise BadRequest(message)
Jan 20 06:07:13 host ehforwarderbot[443]: telegram.error.BadRequest: Voice_messages_forbidden
Jan 20 06:07:13 host ehforwarderbot[443]: During handling of the above exception, another exception occurred:
Jan 20 06:07:13 host ehforwarderbot[443]: Traceback (most recent call last):
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/slave_message.py", line 120, in send_message
Jan 20 06:07:13 host ehforwarderbot[443]:     self.dispatch_message(msg, msg_template, old_msg_id, tg_dest, silent)
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/slave_message.py", line 193, in dispatch_message
Jan 20 06:07:13 host ehforwarderbot[443]:     tg_msg = self.slave_message_voice(msg, tg_dest, msg_template, reactions, old_msg_id, target_msg_id,
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/slave_message.py", line 755, in slave_message_voice
Jan 20 06:07:13 host ehforwarderbot[443]:     tg_msg = self.bot.send_voice(tg_dest, file, prefix=msg_template, suffix=reactions,
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/bot_manager.py", line 121, in caption_affix
Jan 20 06:07:13 host ehforwarderbot[443]:     return fn(self, *args, **kwargs)
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/bot_manager.py", line 76, in caption_strip_class_on_failure_wrapper
Jan 20 06:07:13 host ehforwarderbot[443]:     raise e
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/bot_manager.py", line 64, in caption_strip_class_on_failure_wrapper
Jan 20 06:07:13 host ehforwarderbot[443]:     return fn(*args, **kwargs)
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/bot_manager.py", line 130, in retry_on_chat_migration_wrap
Jan 20 06:07:13 host ehforwarderbot[443]:     return fn(self, *args, **kwargs)
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/efb_telegram_master/bot_manager.py", line 359, in send_voice
Jan 20 06:07:13 host ehforwarderbot[443]:     return self.updater.bot.send_document(*args, **kwargs)
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/bot.py", line 134, in decorator
Jan 20 06:07:13 host ehforwarderbot[443]:     result = func(*args, **kwargs)
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/bot.py", line 1007, in send_document
Jan 20 06:07:13 host ehforwarderbot[443]:     return self._message(  # type: ignore[return-value]
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/ext/extbot.py", line 203, in _message
Jan 20 06:07:13 host ehforwarderbot[443]:     result = super()._message(
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/bot.py", line 344, in _message
Jan 20 06:07:13 host ehforwarderbot[443]:     result = self._post(endpoint, data, timeout=timeout, api_kwargs=api_kwargs)
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/bot.py", line 299, in _post
Jan 20 06:07:13 host ehforwarderbot[443]:     return self.request.post(
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/utils/request.py", line 359, in post
Jan 20 06:07:13 host ehforwarderbot[443]:     result = self._request_wrapper('POST', url, fields=data, **urlopen_kwargs)
Jan 20 06:07:13 host ehforwarderbot[443]:   File "/usr/local/lib/python3.8/dist-packages/telegram/utils/request.py", line 279, in _request_wrapper
Jan 20 06:07:13 host ehforwarderbot[443]:     raise BadRequest(message)
Jan 20 06:07:13 host ehforwarderbot[443]: telegram.error.BadRequest: File must be non-empty

备注 Additional context

Maybe it's related to #154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant