Skip to content

Commit

Permalink
Merge pull request #41 from ITCraftDevelopmentTeam/fix-issue-40
Browse files Browse the repository at this point in the history
修复 OneBot V12 反向 WS 逻辑问题
  • Loading branch information
This-is-XiaoDeng authored Jan 11, 2025
2 parents 3701082 + 045d652 commit f10c8e5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 23 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ __pycache__
config.json
.vscode/
.cache/
commands.json
commands.json
.idea/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 IT Craft Development Team
Copyright (c) 2025 IT Craft Development Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@ Discord 平台的 OneBot 实现
[文档](https://onedisc.itcdt.top) · [下载](https://onedisc.itcdt.top/download.html) · [快速开始](https://onedisc.itcdt.top/quickstart.html) · [差异](https://onedisc.itcdt.top/differences.html)
</div>

> [!WARNING]
> 本项目含有部分较为混乱的代码,在阅读时请注意控制您的血压
> [!IMPORTANT]
> 在使用之前,我们建议您阅读: [差异:OneBot V12](https://onedisc.itcdt.top/differences.html)[差异:OneBot V11](https://onedisc.itcdt.top/diff-v11.html)
> [!NOTE]
> OneDisc 的稳定版暂时没有 MacOS 版本[^2],我们建议 MacOS 用户使用测试版
## 兼容性

OneDisc 在 Discord 上实现了 OneBot V11/V12 标准,并做了一些拓展
Expand All @@ -50,7 +44,4 @@ OneDisc 在 Discord 上实现了 OneBot V11/V12 标准,并做了一些拓展
## 性能

内存占用约 70MB[^1],稳定运行无报错

[^1]: 就目前分析表明,这似乎是 `discord_event.py` 造成的,但是我们没有分析出具体原因
[^2]: 我们尝试提供 MacOS 版本,但是 [Actions](https://github.com/ITCraftDevelopmentTeam/OneDisc/actions/workflows/build-release.yml) 报错了
内存占用约 70MB,稳定运行无报错
12 changes: 1 addition & 11 deletions network/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
# from network.v12.http import HTTPServer
# import asyncio
# from network.v12.http_webhook import HttpWebhookConnect
# from network.v11.http import HTTPServer4OB11
# from network.v11.http_post import HTTPPost4OB11
# from network.v11.ws import WebSocket4OB11
# from network.v11.ws_reverse import init_websocket_reverse_connection
# from network.v12.ws import WebSocketServer
# from network.v12.ws_reverse import WebSocketClient

from typing import Callable, Coroutine, Union
import network.v12.http
import network.v12.http_webhook
Expand Down Expand Up @@ -56,7 +46,7 @@ async def start_connection(
network.v12.ws.WebSocketServer(config), "start_server"
),
"ws-reverse": lambda config: start_connection(
network.v12.ws_reverse.WebSocketClient(config), "connect"
network.v12.ws_reverse.WebSocketClient(config), "reconnect"
),
},
11: {
Expand Down

0 comments on commit f10c8e5

Please sign in to comment.