Skip to content

Commit

Permalink
🚨 make ruff happy
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Sep 23, 2023
1 parent d8647fe commit 902496f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 78 deletions.
39 changes: 0 additions & 39 deletions nonebot/adapters/onebot/v11/bot.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class Bot(BaseBot):
nonebot.adapters.onebot.exception.NetworkError: 网络错误
nonebot.adapters.onebot.exception.ActionFailed: API 调用失败
"""
...
async def handle_event(self, event: Event) -> None: ...
async def send(
self, event: Event, message: str | Message | MessageSegment, **kwargs: Any
Expand All @@ -52,7 +51,6 @@ class Bot(BaseBot):
auto_escape: 消息内容是否作为纯文本发送(即不解析 CQ 码),
只在 `message` 字段是字符串时有效
"""
...
async def send_group_msg(
self,
*,
Expand All @@ -68,7 +66,6 @@ class Bot(BaseBot):
auto_escape: 消息内容是否作为纯文本发送(即不解析 CQ 码),
只在 `message` 字段是字符串时有效
"""
...
async def send_msg(
self,
*,
Expand All @@ -89,7 +86,6 @@ class Bot(BaseBot):
auto_escape: 消息内容是否作为纯文本发送(即不解析 CQ 码),
只在 `message` 字段是字符串时有效
"""
...
async def delete_msg(
self,
*,
Expand All @@ -100,7 +96,6 @@ class Bot(BaseBot):
参数:
message_id: 消息 ID
"""
...
async def get_msg(
self,
*,
Expand All @@ -111,7 +106,6 @@ class Bot(BaseBot):
参数:
message_id: 消息 ID
"""
...
async def get_forward_msg(
self,
*,
Expand All @@ -122,7 +116,6 @@ class Bot(BaseBot):
参数:
id: 合并转发 ID
"""
...
async def send_like(
self,
*,
Expand All @@ -135,7 +128,6 @@ class Bot(BaseBot):
user_id: 对方 QQ 号
times: 赞的次数,每个好友每天最多 10 次
"""
...
async def set_group_kick(
self,
*,
Expand All @@ -150,7 +142,6 @@ class Bot(BaseBot):
user_id: 要踢的 QQ 号
reject_add_request: 拒绝此人的加群请求
"""
...
async def set_group_ban(
self,
*,
Expand All @@ -165,7 +156,6 @@ class Bot(BaseBot):
user_id: 要禁言的 QQ 号
duration: 禁言时长,单位秒,`0` 表示取消禁言
"""
...
async def set_group_anonymous_ban(
self,
*,
Expand All @@ -182,7 +172,6 @@ class Bot(BaseBot):
anonymous_flag: 可选,要禁言的匿名用户的 flag(需从群消息上报的数据中获得)
duration: 禁言时长,单位秒,无法取消匿名用户禁言
"""
...
async def set_group_whole_ban(
self,
*,
Expand All @@ -195,7 +184,6 @@ class Bot(BaseBot):
group_id: 群号
enable: 是否禁言
"""
...
async def set_group_admin(
self,
*,
Expand All @@ -210,7 +198,6 @@ class Bot(BaseBot):
user_id: 要设置管理员的 QQ 号
enable: `True` 为设置,`False` 为取消
"""
...
async def set_group_anonymous(
self,
*,
Expand All @@ -223,7 +210,6 @@ class Bot(BaseBot):
group_id: 群号
enable: 是否允许匿名聊天
"""
...
async def set_group_card(
self,
*,
Expand All @@ -238,7 +224,6 @@ class Bot(BaseBot):
user_id: 要设置的 QQ 号
card: 群名片内容,不填或空字符串表示删除群名片
"""
...
async def set_group_name(
self,
*,
Expand All @@ -251,7 +236,6 @@ class Bot(BaseBot):
group_id: 群号
group_name: 新群名
"""
...
async def set_group_leave(
self,
*,
Expand All @@ -264,7 +248,6 @@ class Bot(BaseBot):
group_id: 群号
is_dismiss: 是否解散,如果登录号是群主,则仅在此项为 True 时能够解散
"""
...
async def set_group_special_title(
self,
*,
Expand All @@ -281,7 +264,6 @@ class Bot(BaseBot):
special_title: 专属头衔,不填或空字符串表示删除专属头衔
duration: 专属头衔有效期,单位秒,-1 表示永久
"""
...
async def set_friend_add_request(
self,
*,
Expand All @@ -296,7 +278,6 @@ class Bot(BaseBot):
approve: 是否同意请求
remark: 添加后的好友备注(仅在同意时有效)
"""
...
async def set_group_add_request(
self,
*,
Expand All @@ -314,10 +295,8 @@ class Bot(BaseBot):
approve: 是否同意请求/邀请
reason: 拒绝理由(仅在拒绝时有效)
"""
...
async def get_login_info(self) -> dict[str, Any]:
"""获取登录号信息。"""
...
async def get_stranger_info(
self,
*,
Expand All @@ -330,10 +309,8 @@ class Bot(BaseBot):
user_id: QQ 号
no_cache: 是否不使用缓存(使用缓存可能更新不及时,但响应更快)
"""
...
async def get_friend_list(self) -> list[dict[str, Any]]:
"""获取好友列表。"""
...
async def get_group_info(
self,
*,
Expand All @@ -346,10 +323,8 @@ class Bot(BaseBot):
group_id: 群号
no_cache: 是否不使用缓存(使用缓存可能更新不及时,但响应更快)
"""
...
async def get_group_list(self) -> list[dict[str, Any]]:
"""获取群列表。"""
...
async def get_group_member_info(
self,
*,
Expand All @@ -364,7 +339,6 @@ class Bot(BaseBot):
user_id: QQ 号
no_cache: 是否不使用缓存(使用缓存可能更新不及时,但响应更快)
"""
...
async def get_group_member_list(
self,
*,
Expand All @@ -375,7 +349,6 @@ class Bot(BaseBot):
参数:
group_id: 群号
"""
...
async def get_group_honor_info(
self,
*,
Expand All @@ -390,7 +363,6 @@ class Bot(BaseBot):
可传入 `talkative` `performer` `legend` `strong_newbie` `emotion`
以分别获取单个类型的群荣誉数据,或传入 `all` 获取所有数据
"""
...
async def get_cookies(
self,
*,
Expand All @@ -401,10 +373,8 @@ class Bot(BaseBot):
参数:
domain: 需要获取 cookies 的域名
"""
...
async def get_csrf_token(self) -> dict[str, Any]:
"""获取 CSRF Token。"""
...
async def get_credentials(
self,
*,
Expand All @@ -415,7 +385,6 @@ class Bot(BaseBot):
参数:
domain: 需要获取 cookies 的域名
"""
...
async def get_record(
self,
*,
Expand All @@ -430,7 +399,6 @@ class Bot(BaseBot):
out_format: 要转换到的格式,
目前支持 `mp3`、`amr`、`wma`、`m4a`、`spx`、`ogg`、`wav`、`flac`
"""
...
async def get_image(
self,
*,
Expand All @@ -442,19 +410,14 @@ class Bot(BaseBot):
file: 收到的图片文件名(CQ 码的 `file` 参数),
如 `6B4DE3DFD1BD271E3297859D41C530F5.jpg`
"""
...
async def can_send_image(self) -> dict[str, Any]:
"""检查是否可以发送图片。"""
...
async def can_send_record(self) -> dict[str, Any]:
"""检查是否可以发送语音。"""
...
async def get_status(self) -> dict[str, Any]:
"""获取插件运行状态。"""
...
async def get_version_info(self) -> dict[str, Any]:
"""获取版本信息。"""
...
async def set_restart(
self,
*,
Expand All @@ -465,7 +428,5 @@ class Bot(BaseBot):
参数:
delay: 要延迟的毫秒数,如果默认情况下无法重启,可以尝试设置延迟为 2000 左右
"""
...
async def clean_cache(self) -> None:
"""清理数据目录。"""
...
Loading

0 comments on commit 902496f

Please sign in to comment.