Skip to content

Commit

Permalink
feat(qq_api): ✨ add get_event_loop api
Browse files Browse the repository at this point in the history
  • Loading branch information
AnzhiZhang committed Feb 26, 2023
1 parent 65c8f01 commit 9da5329
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions qq_api/qq_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

__all__ = [
"MessageEvent",
"get_event_loop",
"get_bot",
]

Expand Down Expand Up @@ -133,6 +134,14 @@ def on_unload(server: PluginServerInterface):
time.sleep(0.1)


def get_event_loop() -> AbstractEventLoop:
"""
Get asyncio event loop
:return: AbstractEventLoop.
"""
return __event_loop


def get_bot() -> CQHttp:
"""
Get CQHttp instance.
Expand Down
6 changes: 5 additions & 1 deletion qq_api/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ example:

### API

#### get_event_loop()

用于获取 `asyncio` 的 `event_loop`。

#### get_bot()

用于获取 `bot` 对象
用于获取 `CQHttp` 的实例。

0 comments on commit 9da5329

Please sign in to comment.