Compare commits
2 Commits
aef43f0720
...
a6944e856c
Author | SHA1 | Date | |
---|---|---|---|
a6944e856c | |||
![]() |
f5dc744507 |
7
main.py
7
main.py
@ -332,10 +332,15 @@ class MyPlugin(Star):
|
|||||||
async def lovelive(self, event: AstrMessageEvent):
|
async def lovelive(self, event: AstrMessageEvent):
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
async with session.get('https://api.lovelive.tools/api/SweetNothings') as resp:
|
async with session.get('https://api.lovelive.tools/api/SweetNothings') as resp:
|
||||||
|
if resp.status == 200:
|
||||||
|
text = await resp.text() # 获取返回的文本内容
|
||||||
chain = [
|
chain = [
|
||||||
Comp.At(qq=event.get_sender_id()), # At 消息发送者
|
Comp.At(qq=event.get_sender_id()), # At 消息发送者
|
||||||
Comp.Plain(resp)
|
Comp.Plain(text) # 使用API返回的文本
|
||||||
]
|
]
|
||||||
|
yield event.chain_result(chain)
|
||||||
|
else:
|
||||||
|
yield "获取骚话失败"
|
||||||
|
|
||||||
|
|
||||||
@filter.command("部署")
|
@filter.command("部署")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user