添加注释,增加redis支持,添加了聊天记录构建支持

This commit is contained in:
2026-01-02 17:10:42 +08:00
parent 3163bbf8c1
commit 01b83803c1
24 changed files with 965 additions and 313 deletions

View File

@@ -1,3 +1,8 @@
"""
今日人品插件
提供 /jrcd 和 /bbcd 指令,用于娱乐。
"""
import random
from datetime import datetime
@@ -19,7 +24,7 @@ JRCDMSG_2 = [
JRCDMSG_3 = [
"今天的长度是%scm哦豁听说你很勇哦(✧◡✧)",
"今天的长度是%scm嘶哈嘶哈(((o(*°▽°*)o)))...",
"今天的长度是%scm我靠让哥哥爽一爽吧(((o(*°▽°*)o)))...",
"今天的长度是%scm我靠让哥哥爽一-爽吧!(((o(*°▽°*)o)))...",
"今天的长度是%scm单是看到哥哥的长度就....(〃w〃)",
]
@@ -38,6 +43,12 @@ BBCDMSG7 = ["试试刺刀看看谁能赢吧!"]
def get_jrcd(user_id: int) -> int:
"""
根据用户ID和当前日期生成一个伪随机的“长度”值。
:param user_id: 用户QQ号。
:return: 返回一个1到30之间的整数。
"""
current_time = (
datetime.now().year * 100 + datetime.now().month * 100 + datetime.now().day
)
@@ -52,11 +63,11 @@ def get_jrcd(user_id: int) -> int:
@matcher.command("jrcd")
async def handle_jrcd(bot: Bot, event: MessageEvent, args: list[str]):
"""
处理 jrcd 指令,来看看你的长度吧!
处理 jrcd 指令,回复用户的“今日长度”。
:param bot: Bot 实例
:param event: 消息事件对象
:param args: 指令参数列表
:param bot: Bot 实例
:param event: 消息事件对象
:param args: 指令参数列表(未使用)。
"""
user_id = event.user_id
jrcd = get_jrcd(user_id)
@@ -73,11 +84,11 @@ async def handle_jrcd(bot: Bot, event: MessageEvent, args: list[str]):
@matcher.command("bbcd")
async def handle_bbcd(bot: Bot, event: MessageEvent, args: list[str]):
"""
处理 bbcd 指令,和别人比比长度吧!
处理 bbcd 指令,比较两位用户的“长度”。
:param bot: Bot 实例
:param event: 消息事件对象
:param args: 指令参数列表
:param bot: Bot 实例
:param event: 消息事件对象
:param args: 指令参数列表(未使用)。
"""
message = event.message
print(message)