跳转至

lifecycle

Ariadne, Adapter 生命周期相关事件

AccountConnectionFail 🔗

Bases: ApplicationLifecycleEvent

和 mirai-api-http 的链接断开,不论是因为连接失败还是配置失败

Source code in src/graia/ariadne/event/lifecycle.py
53
54
class AccountConnectionFail(ApplicationLifecycleEvent):
    """和 mirai-api-http 的链接断开,不论是因为连接失败还是配置失败"""

AccountLaunch 🔗

Bases: ApplicationLifecycleEvent

指示账号的链接已启动.

Source code in src/graia/ariadne/event/lifecycle.py
45
46
class AccountLaunch(ApplicationLifecycleEvent):
    """指示账号的链接已启动."""

AccountShutdown 🔗

Bases: ApplicationLifecycleEvent

指示账号的链接关闭.

Source code in src/graia/ariadne/event/lifecycle.py
49
50
class AccountShutdown(ApplicationLifecycleEvent):
    """指示账号的链接关闭."""

ApplicationLaunch 🔗

Bases: ApplicationLifecycleEvent

指示 Ariadne 启动.

Source code in src/graia/ariadne/event/lifecycle.py
33
34
class ApplicationLaunch(ApplicationLifecycleEvent):
    """指示 Ariadne 启动."""

ApplicationLifecycleEvent 🔗

Bases: Dispatchable

指示有关应用 (Ariadne) 的事件.

Source code in src/graia/ariadne/event/lifecycle.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class ApplicationLifecycleEvent(Dispatchable):
    """指示有关应用 (Ariadne) 的事件."""

    app: "Ariadne"

    def __init__(self, app: "Ariadne") -> None:
        self.app = app

    class Dispatcher(BaseDispatcher):
        @staticmethod
        async def catch(interface: "DispatcherInterface"):
            from ..app import Ariadne

            if isinstance(interface.event, ApplicationLifecycleEvent) and generic_issubclass(
                Ariadne, interface.annotation
            ):
                return interface.event.app

ApplicationShutdown 🔗

Bases: ApplicationLifecycleEvent

指示 Ariadne 关闭.

Source code in src/graia/ariadne/event/lifecycle.py
37
38
class ApplicationShutdown(ApplicationLifecycleEvent):
    """指示 Ariadne 关闭."""