-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
121 additions
and
613 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Empty file.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved | ||
@Time : 2024/8/19 下午10:44 | ||
@Author : snowykami | ||
@Email : [email protected] | ||
@File : __init__.py.py | ||
@Software: PyCharm | ||
该模块参考并引用了nonebot-plugin-alconna的消息段定义 | ||
""" | ||
from typing import Any | ||
|
||
from magicoca import Chan, select | ||
from mypy.server.objgraph import Iterable | ||
from six import Iterator | ||
|
||
|
||
def message_handler_thread(i_chans: Iterable[Chan[Any]]): | ||
""" | ||
Args: | ||
i_chans: 多路输入管道组 | ||
Returns: | ||
""" | ||
for msg in select(*i_chans): | ||
print("Recv from anybot", msg) |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from pydantic import BaseModel | ||
|
||
class User(BaseModel): | ||
""" | ||
用户信息 | ||
Attributes: | ||
id: 用户ID | ||
name: 用户名 | ||
nick: 用户昵称 | ||
avatar: 用户头像图链接 | ||
""" | ||
id: str | ||
name: str | None | ||
nick: str | None | ||
avatar: str | None | ||
|
||
class Scene(BaseModel): | ||
""" | ||
场景信息 | ||
Attributes: | ||
id: 场景ID | ||
type: 场景类型 | ||
name: 场景名 | ||
avatar: 场景头像图链接 | ||
parent: 父场景 | ||
""" | ||
id: str | ||
type: str | ||
name: str | None | ||
avatar: str | None | ||
parent: "Scene | None" | ||
|
||
class Session(BaseModel): | ||
""" | ||
会话信息 | ||
Attributes: | ||
self_id: 机器人ID | ||
adapter: 适配器ID | ||
scope: 会话范围 | ||
scene: 场景信息 | ||
user: 用户信息 | ||
member: 成员信息,仅频道及群聊有效 | ||
operator: 操作者信息,仅频道及群聊有效 | ||
""" | ||
self_id: str | ||
adapter: str | ||
scope: str | ||
scene: Scene | ||
user: User | ||
member: "Member | None" | ||
operator: "Member | None" |
This file contains 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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.