mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-Nonebot.git
synced 2026-04-01 22:04:51 +00:00
更新codeforces二维码
This commit is contained in:
parent
7afaf7e52e
commit
d9d71cd716
2 changed files with 10 additions and 1 deletions
BIN
src/image/codeforces/cfContestQR.png
Normal file
BIN
src/image/codeforces/cfContestQR.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
|
|
@ -1,6 +1,8 @@
|
|||
import requests
|
||||
from nonebot.plugin import on_command
|
||||
from nonebot.rule import to_me
|
||||
from nonebot.adapters.qq import Message, MessageEvent, MessageSegment
|
||||
from pathlib import Path
|
||||
|
||||
cf_query = on_command("cf", rule=to_me(), priority=10, block=True)
|
||||
@cf_query.handle()
|
||||
|
|
@ -21,7 +23,14 @@ async def get_cf_rounds():
|
|||
all_matches = "".join([all_matches, until_start])
|
||||
if matches["phase"] == "FINISHED":
|
||||
break
|
||||
await cf_query.finish(all_matches)
|
||||
|
||||
cf_image_path = './src/image/codeforces/cfContestQR.png'
|
||||
msg = Message([
|
||||
MessageSegment.file_image(Path(cf_image_path)),
|
||||
MessageSegment.text(all_matches),
|
||||
])
|
||||
|
||||
await cf_query.finish(msg)
|
||||
|
||||
|
||||
def get_match_phase(phase):
|
||||
|
|
|
|||
Loading…
Reference in a new issue