chore: perf platform messages#2073
Closed
RockChinQ wants to merge 27 commits into
Closed
Conversation
- TelegramAdapter inherits AbstractPlatformAdapter with all capabilities - TelegramEventConverter handles all Update types: message, edited_message, chat_member, my_chat_member, callback_query, message_reaction - TelegramAPIMixin implements: edit_message, delete_message, forward_message, get_group_info, get_group_member_list/info, get_user_info, get_file_url, mute/unmute/kick_member, leave_group - PLATFORM_API_MAP for call_platform_api: pin/unpin message, set chat title/desc, get admins, send chat action, create invite link, answer callback query - Full backward compat: legacy FriendMessage/GroupMessage listeners still work - Preserves all existing functionality: stream output, markdown card, forum topics - Old sources/telegram.py untouched for gradual migration
| task.cancel() | ||
| try: | ||
| await asyncio.wait_for(task, timeout=3) | ||
| except (asyncio.CancelledError, asyncio.TimeoutError): |
| request = ( | ||
| CreateImageRequest.builder() | ||
| .request_body( | ||
| CreateImageRequestBody.builder().image_type('message').image(open(temp_file_path, 'rb')).build() |
| CreateFileRequestBody.builder() | ||
| .file_type(file_type) | ||
| .file_name(file_name) | ||
| .file(open(temp_file_path, 'rb')) |
This was referenced May 28, 2026
| self._ws_task.cancel() | ||
| try: | ||
| await self._ws_task | ||
| except asyncio.CancelledError: |
| self._ws_task = asyncio.create_task(self.bot.connect_gateway_loop(on_event, on_ready, on_error)) | ||
| try: | ||
| await self._ws_task | ||
| except asyncio.CancelledError: |
| server_task.cancel() | ||
| try: | ||
| await server_task | ||
| except asyncio.CancelledError: |
| server_task.cancel() | ||
| try: | ||
| await server_task | ||
| except asyncio.CancelledError: |
| task.cancel() | ||
| try: | ||
| await task | ||
| except asyncio.CancelledError: |
| self.heartbeat_task.cancel() | ||
| try: | ||
| await self.heartbeat_task | ||
| except asyncio.CancelledError: |
| await asyncio.sleep(30) | ||
| if self.ws: | ||
| await self.ws.send(json.dumps({'s': 2, 'sn': self.current_sn})) | ||
| except asyncio.CancelledError: |
Member
Author
|
recheck |
Contributor
|
All contributors have signed the CLA. ✅ 所有贡献者均已签署 CLA。 |
Member
Author
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Member
|
I have read the CLA Document and I hereby sign the CLA |
RockChinQ
added a commit
to langbot-app/cla
that referenced
this pull request
Jun 14, 2026
Member
Author
|
Continue in #2277 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述 / Overview
更改前后对比截图 / Screenshots
检查清单 / Checklist
PR 作者完成 / For PR author
请在方括号间写
x以打勾 / Please tick the box withx项目维护者完成 / For project maintainer