mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-06 20:06:12 +08:00
'revert some file change'
This commit is contained in:
parent
f8f7a8a102
commit
eb4aa32565
@ -331,11 +331,6 @@ group_manage_matcher = on_command(
|
||||
)
|
||||
|
||||
|
||||
@group_manage_matcher.handle()
|
||||
async def send_group_list(bot: Bot, event: GroupMessageEvent, state: T_State):
|
||||
await group_manage_matcher.finish(Message("该功能只支持私聊使用,请私聊Bot"))
|
||||
|
||||
|
||||
@group_manage_matcher.handle()
|
||||
async def send_group_list_private(bot: Bot, event: GroupMessageEvent, state: T_State):
|
||||
await group_manage_matcher.finish(Message("该功能只支持私聊使用,请私聊Bot"))
|
||||
|
@ -29,11 +29,8 @@ class Bilibili(NewMessage):
|
||||
|
||||
async def get_target_name(self, target: Target) -> Optional[str]:
|
||||
async with httpx.AsyncClient() as client:
|
||||
headers = {"content-type": "application/json", "Accept-Charset": "UTF-8"}
|
||||
res = await client.get(
|
||||
"https://api.bilibili.com/x/space/acc/info",
|
||||
params={"mid": target},
|
||||
headers=headers,
|
||||
"https://api.bilibili.com/x/space/acc/info", params={"mid": target}
|
||||
)
|
||||
res_data = json.loads(res.text)
|
||||
if res_data["code"]:
|
||||
@ -42,12 +39,10 @@ class Bilibili(NewMessage):
|
||||
|
||||
async def get_sub_list(self, target: Target) -> list[RawPost]:
|
||||
async with httpx.AsyncClient() as client:
|
||||
headers = {"content-type": "application/json", "Accept-Charset": "UTF-8"}
|
||||
params = {"host_uid": target, "offset": 0, "need_top": 0}
|
||||
res = await client.get(
|
||||
"https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history",
|
||||
params=params,
|
||||
headers=headers,
|
||||
timeout=4.0,
|
||||
)
|
||||
res_dict = json.loads(res.text)
|
||||
|
@ -8,7 +8,7 @@ class PlugConfig(BaseSettings):
|
||||
bison_use_pic: bool = False
|
||||
bison_init_filter: bool = True
|
||||
bison_use_queue: bool = True
|
||||
bison_outer_url: str = "http://localhost:15556/bison/"
|
||||
bison_outer_url: str = "http://localhost:8080/bison/"
|
||||
bison_filter_log: bool = False
|
||||
bison_to_me: bool = True
|
||||
bison_skip_browser_check: bool = False
|
||||
|
@ -1,6 +1,5 @@
|
||||
import time
|
||||
from email import message
|
||||
from typing import List, Literal, Union
|
||||
from typing import Literal, Union
|
||||
|
||||
from nonebot.adapters.onebot.v11.bot import Bot
|
||||
from nonebot.adapters.onebot.v11.message import Message, MessageSegment
|
||||
@ -34,18 +33,6 @@ async def _do_send(
|
||||
await bot.send_group_forward_msg(group_id=user, messages=msg)
|
||||
|
||||
|
||||
async def _do_send_forward(bot: "Bot", user: str, msgs: list):
|
||||
group_msg = []
|
||||
bot_info = await bot.call_api("get_login_info") # 猜测返回list 第一个为user_id,第二个为nickname
|
||||
for msg in msgs:
|
||||
sub_msg = {
|
||||
"type": "node",
|
||||
"data": {"name": f"{bot_info[0]}", "uin": f"{bot_info[1]}", "content": msg},
|
||||
}
|
||||
group_msg.append(sub_msg)
|
||||
await bot.call_api("send_group_forward_msg", group_id=user, message=group_msg)
|
||||
|
||||
|
||||
async def do_send_msgs():
|
||||
global LAST_SEND_TIME
|
||||
if time.time() - LAST_SEND_TIME < 1.5:
|
||||
|
Loading…
x
Reference in New Issue
Block a user