From 920b098df6352df3c1449cff7d75f5cd17fe32c4 Mon Sep 17 00:00:00 2001 From: Ruler229 Date: Thu, 22 May 2025 11:05:15 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20main.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 81ece7b..a6d6afd 100644 --- a/main.py +++ b/main.py @@ -49,18 +49,18 @@ class MyPlugin(Star): ,db='saipo' # 数据库名称 ,charset='utf8' # 字符编码 ) - cur = conn.cursor() + #cur = conn.cursor() time = [];V = [];a = [];b = [] for i in range(0,10): time.append(round(random.uniform(1, 600), 2)) V.append(round(random.uniform(0.01,100), 2)) a.append(time_long(time[i])) b.append(volume(V[i])) - sql = "INSERT INTO dajiao (openid, timelong, volume) VALUES (%s, %s, %s)" - values = (user_name,time[i],V[i]) - cur.execute(sql,values) - conn.commit() - cur.close() + #sql = "INSERT INTO dajiao (openid, timelong, volume) VALUES (%s, %s, %s)" + #values = (user_name,time[i],V[i]) + #cur.execute(sql,values) + #conn.commit() + #cur.close() conn.close() yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())}, 第一次你坚持了{time[0]}s哦,{a[0]}.射出{V[0]}ml,{b[0]}!\n第二次你坚持了{time[1]}s哦,{a[1]}.射出{V[1]}ml,{b[1]}!\n哎呀,一点也打不出来了!") From 9db0c3747ba8ac5ad39553c6386f576e52ab1159 Mon Sep 17 00:00:00 2001 From: Ruler229 Date: Thu, 22 May 2025 11:32:09 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20main.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index a6d6afd..ea3c4d0 100644 --- a/main.py +++ b/main.py @@ -49,20 +49,20 @@ class MyPlugin(Star): ,db='saipo' # 数据库名称 ,charset='utf8' # 字符编码 ) - #cur = conn.cursor() + cur = conn.cursor() time = [];V = [];a = [];b = [] for i in range(0,10): time.append(round(random.uniform(1, 600), 2)) V.append(round(random.uniform(0.01,100), 2)) a.append(time_long(time[i])) - b.append(volume(V[i])) - #sql = "INSERT INTO dajiao (openid, timelong, volume) VALUES (%s, %s, %s)" - #values = (user_name,time[i],V[i]) - #cur.execute(sql,values) - #conn.commit() - #cur.close() + b.append(volume(V[i])) + sql = "INSERT INTO dajiao (openid, timelong, volume) VALUES (%s, %s, %s),(%s, %s, %s),(%s, %s, %s),(%s, %s, %s),(%s, %s, %s),(%s, %s, %s),(%s, %s, %s),(%s, %s, %s),(%s, %s, %s),(%s, %s, %s)" + values = (user_name,time[0],V[0]),(user_name,time[1],V[1]),(user_name,time[2],V[2]),(user_name,time[3],V[3]),(user_name,time[4],V[4]),(user_name,time[5],V[5]),(user_name,time[6],V[6]),(user_name,time[7],V[7]),(user_name,time[8],V[8]),(user_name,time[9],V[9]) + cur.execute(sql,values) + conn.commit() + cur.close() conn.close() - yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())}, 第一次你坚持了{time[0]}s哦,{a[0]}.射出{V[0]}ml,{b[0]}!\n第二次你坚持了{time[1]}s哦,{a[1]}.射出{V[1]}ml,{b[1]}!\n哎呀,一点也打不出来了!") + yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())},准备开始挑战十连咯!\n第一次你坚持了{time[0]}s哦,{a[0]}.射出{V[0]}ml,{b[0]}!\n第二次你坚持了{time[1]}s哦,{a[1]}.射出{V[1]}ml,{b[1]}!\n第三次你坚持了{time[2]}s哦,{a[2]}.射出{V[2]}ml,{b[2]}!\n第四次你坚持了{time[3]}s哦,{a[3]}.射出{V[3]}ml,{b[3]}!\n第五次你坚持了{time[4]}s哦,{a[4]}.射出{V[4]}ml,{b[4]}!\n第六次你坚持了{time[5]}s哦,{a[5]}.射出{V[5]}ml,{b[5]}!\n第七次你坚持了{time[6]}s哦,{a[6]}.射出{V[6]}ml,{b[6]}!\n第八次你坚持了{time[7]}s哦,{a[7]}.射出{V[7]}ml,{b[7]}!\n第九次你坚持了{time[8]}s哦,{a[8]}.射出{V[8]}ml,{b[8]}!\n第十次你坚持了{time[9]}s哦,{a[9]}.射出{V[9]}ml,{b[9]}!\n哎呀,一点也打不出来了!杂鱼!") @filter.command("打打你的") From 8f30dd73ece53f052eb15758352734caf3f9f546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CQAQ=E2=80=9D?= <“1540691861@qq.com”> Date: Thu, 22 May 2025 14:29:05 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E6=B5=8B=E8=AF=95vscode=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index ea3c4d0..c0fe886 100644 --- a/main.py +++ b/main.py @@ -307,7 +307,7 @@ class MyPlugin(Star): @filter.command("麦否?") async def QAQtest(self, event: AstrMessageEvent): - yield event.plain_result("包的") + yield event.plain_result("每日一麦") @filter.command("部署") async def bushutest(self, event: AstrMessageEvent): From 263c2476fcf018e2bbac48eaadc6398d3ffbc7a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CQAQ=E2=80=9D?= <“1540691861@qq.com”> Date: Thu, 22 May 2025 17:41:15 +0800 Subject: [PATCH 04/11] =?UTF-8?q?Dora=E8=A1=A8=E6=83=85=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index c0fe886..999b0a6 100644 --- a/main.py +++ b/main.py @@ -305,9 +305,27 @@ class MyPlugin(Star): testNumber = testNumber + 1 yield event.plain_result(f"累积结果: {testNumber}") - @filter.command("麦否?") - async def QAQtest(self, event: AstrMessageEvent): - yield event.plain_result("每日一麦") + import astrbot.api.message_components as Comp + import aiohttp # 需要异步HTTP客户端 + + @filter.command("Dora") + async def Dora(self, event: AstrMessageEvent): + async with aiohttp.ClientSession() as session: + async with session.get('https://www.doro.asia/api/random-sticker') as resp: + if resp.status == 200: + data = await resp.json() + if data.get('success', False): + image_url = data['sticker']['url'] + chain = [ + Comp.At(qq=event.get_sender_id()), # At 消息发送者 + Comp.Plain("Dora:"), + Comp.Image.fromURL(image_url), # 使用API返回的图片URL + ] + yield event.chain_result(chain) + else: + yield "获取表情包失败" + else: + yield "API请求失败" @filter.command("部署") async def bushutest(self, event: AstrMessageEvent): From 5c6cec0d397cea758dbfc657a1fc20b7db088bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CQAQ=E2=80=9D?= <“1540691861@qq.com”> Date: Thu, 22 May 2025 17:53:47 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9HTTP=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/main.py b/main.py index 999b0a6..cf2945c 100644 --- a/main.py +++ b/main.py @@ -306,26 +306,32 @@ class MyPlugin(Star): yield event.plain_result(f"累积结果: {testNumber}") import astrbot.api.message_components as Comp - import aiohttp # 需要异步HTTP客户端 + import requests + import asyncio @filter.command("Dora") async def Dora(self, event: AstrMessageEvent): - async with aiohttp.ClientSession() as session: - async with session.get('https://www.doro.asia/api/random-sticker') as resp: - if resp.status == 200: - data = await resp.json() - if data.get('success', False): - image_url = data['sticker']['url'] - chain = [ - Comp.At(qq=event.get_sender_id()), # At 消息发送者 - Comp.Plain("Dora:"), - Comp.Image.fromURL(image_url), # 使用API返回的图片URL - ] - yield event.chain_result(chain) - else: - yield "获取表情包失败" - else: - yield "API请求失败" + try: + # 使用 asyncio.to_thread 在异步环境中运行同步 requests + def fetch_sticker(): + resp = requests.get('https://www.doro.asia/api/random-sticker') + resp.raise_for_status() # 检查 HTTP 错误 + return resp.json() + + data = await asyncio.to_thread(fetch_sticker) + + if data.get('success', False): + image_url = data['sticker']['url'] + chain = [ + Comp.At(qq=event.get_sender_id()), + Comp.Plain("Dora:"), + Comp.Image.fromURL(image_url), + ] + yield event.chain_result(chain) + else: + yield "获取表情包失败" + except Exception as e: + yield f"发生错误:{str(e)}" @filter.command("部署") async def bushutest(self, event: AstrMessageEvent): From c769412f71f977381b869498e8ced7333b08daa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CQAQ=E2=80=9D?= <“1540691861@qq.com”> Date: Thu, 22 May 2025 17:58:49 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E4=BD=BF=E7=94=A8aiohttp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/main.py b/main.py index cf2945c..6bc4c99 100644 --- a/main.py +++ b/main.py @@ -306,32 +306,26 @@ class MyPlugin(Star): yield event.plain_result(f"累积结果: {testNumber}") import astrbot.api.message_components as Comp - import requests - import asyncio + import aiohttp # 需要异步HTTP客户端 @filter.command("Dora") async def Dora(self, event: AstrMessageEvent): - try: - # 使用 asyncio.to_thread 在异步环境中运行同步 requests - def fetch_sticker(): - resp = requests.get('https://www.doro.asia/api/random-sticker') - resp.raise_for_status() # 检查 HTTP 错误 - return resp.json() - - data = await asyncio.to_thread(fetch_sticker) - - if data.get('success', False): - image_url = data['sticker']['url'] - chain = [ - Comp.At(qq=event.get_sender_id()), - Comp.Plain("Dora:"), - Comp.Image.fromURL(image_url), - ] - yield event.chain_result(chain) - else: - yield "获取表情包失败" - except Exception as e: - yield f"发生错误:{str(e)}" + async with aiohttp.ClientSession() as session: + async with session.get('https://www.doro.asia/api/random-sticker') as resp: + if resp.status == 200: + data = await resp.json() + if data.get('success', False): + image_url = data['sticker']['url'] + chain = [ + Comp.At(qq=event.get_sender_id()), # At 消息发送者 + Comp.Plain("来看这个图:"), + Comp.Image.fromURL(image_url), # 使用API返回的图片URL + ] + yield event.chain_result(chain) + else: + yield "获取表情包失败" + else: + yield "API请求失败" @filter.command("部署") async def bushutest(self, event: AstrMessageEvent): From 58b02cd42d56bdad5f90a13175566309526bcb09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CQAQ=E2=80=9D?= <“1540691861@qq.com”> Date: Thu, 22 May 2025 18:02:53 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9Import=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 6bc4c99..8b8bd60 100644 --- a/main.py +++ b/main.py @@ -6,6 +6,8 @@ import random from .back import time_long, volume, isUserExist, insertUser, seconds_to_hms, ml_to_l_ml, get_user_name import pymysql from .Tool import get_tool_name +import astrbot.api.message_components as Comp +import aiohttp # 需要异步HTTP客户端 @register("helloworld", "YourName", "一个简单的 Hello World 插件", "1.0.0") class MyPlugin(Star): @@ -305,8 +307,7 @@ class MyPlugin(Star): testNumber = testNumber + 1 yield event.plain_result(f"累积结果: {testNumber}") - import astrbot.api.message_components as Comp - import aiohttp # 需要异步HTTP客户端 + @filter.command("Dora") async def Dora(self, event: AstrMessageEvent): From 306800bec1a88f396c1686bb9397af2d1a26c1b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CQAQ=E2=80=9D?= <“1540691861@qq.com”> Date: Thu, 22 May 2025 20:05:15 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9D=A5=E5=8F=A5?= =?UTF-8?q?=E9=AA=9A=E8=AF=9D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.py b/main.py index 8b8bd60..39c9f09 100644 --- a/main.py +++ b/main.py @@ -327,6 +327,16 @@ class MyPlugin(Star): yield "获取表情包失败" else: yield "API请求失败" + + @filter.command("来句骚话") + async def lovelive(self, event: AstrMessageEvent): + async with aiohttp.ClientSession() as session: + async with session.get('https://api.lovelive.tools/api/SweetNothings') as resp: + chain = [ + Comp.At(qq=event.get_sender_id()), # At 消息发送者 + Comp.Plain(resp) + ] + @filter.command("部署") async def bushutest(self, event: AstrMessageEvent): From f5dc74450712b0c01607b3aae8d55a0d56482bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CQAQ=E2=80=9D?= <“1540691861@qq.com”> Date: Thu, 22 May 2025 20:14:12 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=AA=9A=E8=AF=9D=E6=96=87=E6=9C=AC=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 39c9f09..ee0a6ab 100644 --- a/main.py +++ b/main.py @@ -332,10 +332,15 @@ class MyPlugin(Star): async def lovelive(self, event: AstrMessageEvent): async with aiohttp.ClientSession() as session: async with session.get('https://api.lovelive.tools/api/SweetNothings') as resp: - chain = [ - Comp.At(qq=event.get_sender_id()), # At 消息发送者 - Comp.Plain(resp) + if resp.status == 200: + text = await resp.text() # 获取返回的文本内容 + chain = [ + Comp.At(qq=event.get_sender_id()), # At 消息发送者 + Comp.Plain(text) # 使用API返回的文本 ] + yield event.chain_result(chain) + else: + yield "获取骚话失败" @filter.command("部署") From cbb078eb4a67dadfb678816432df2b90dca34ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CQAQ=E2=80=9D?= <“1540691861@qq.com”> Date: Thu, 22 May 2025 21:16:12 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=95=E5=AD=97?= =?UTF-8?q?=E6=A3=8B=E6=B8=B8=E6=88=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TicTacToeGame.py | 72 +++++++++++++++++++++++++++++++++++ main.py | 97 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 169 insertions(+) create mode 100644 TicTacToeGame.py diff --git a/TicTacToeGame.py b/TicTacToeGame.py new file mode 100644 index 0000000..4848206 --- /dev/null +++ b/TicTacToeGame.py @@ -0,0 +1,72 @@ +import random +from typing import Optional + +class TicTacToeGame: + def __init__(self): + self.board = [" "] * 9 + self.player_symbol = "X" + self.computer_symbol = "O" + self.current_player = "X" # X先走 + + def print_board(self) -> str: + """返回棋盘字符串""" + board_str = ( + f"\n {self.board[0]} | {self.board[1]} | {self.board[2]} \n" + "-----------\n" + f" {self.board[3]} | {self.board[4]} | {self.board[5]} \n" + "-----------\n" + f" {self.board[6]} | {self.board[7]} | {self.board[8]} \n" + ) + return board_str + + def check_winner(self) -> Optional[str]: + """检查是否有玩家获胜""" + win_combinations = [ + [0, 1, 2], [3, 4, 5], [6, 7, 8], # 横向 + [0, 3, 6], [1, 4, 7], [2, 5, 8], # 纵向 + [0, 4, 8], [2, 4, 6] # 对角线 + ] + + for combo in win_combinations: + if self.board[combo[0]] == self.board[combo[1]] == self.board[combo[2]] != " ": + return self.board[combo[0]] + return None + + def is_board_full(self) -> bool: + """检查棋盘是否已满""" + return " " not in self.board + + def computer_move(self) -> int: + """电脑AI移动""" + for i in range(9): + if self.board[i] == " ": + self.board[i] = self.computer_symbol + if self.check_winner() == self.computer_symbol: + return i + self.board[i] = " " + + for i in range(9): + if self.board[i] == " ": + self.board[i] = self.player_symbol + if self.check_winner() == self.player_symbol: + self.board[i] = self.computer_symbol + return i + self.board[i] = " " + + move_order = [4, 0, 2, 6, 8, 1, 3, 5, 7] + for move in move_order: + if self.board[move] == " ": + return move + + return -1 + + def make_move(self, position: int) -> bool: + """玩家移动""" + if 0 <= position <= 8 and self.board[position] == " ": + self.board[position] = self.current_player + return True + return False + + def switch_player(self): + """切换当前玩家""" + self.current_player = "O" if self.current_player == "X" else "X" \ No newline at end of file diff --git a/main.py b/main.py index ee0a6ab..67ba1b3 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,9 @@ from .back import time_long, volume, isUserExist, insertUser, seconds_to_hms, ml import pymysql from .Tool import get_tool_name import astrbot.api.message_components as Comp +from astrbot.session import session_waiter, SessionController import aiohttp # 需要异步HTTP客户端 +from TicTacToeGame import TicTacToeGame @register("helloworld", "YourName", "一个简单的 Hello World 插件", "1.0.0") class MyPlugin(Star): @@ -347,3 +349,98 @@ class MyPlugin(Star): async def bushutest(self, event: AstrMessageEvent): yield event.plain_result("自动部署成功!!") + @filter.command("井字棋") + async def tic_tac_toe_handler(self, event: AstrMessageEvent): + """井字棋游戏处理器""" + try: + # 初始化游戏 + game = TicTacToeGame() + + # 发送初始说明和空棋盘 + instructions = ( + "欢迎来到井字棋游戏!\n" + "输入1-9的数字来选择位置:\n" + " 1 | 2 | 3 \n" + "-----------\n" + " 4 | 5 | 6 \n" + "-----------\n" + " 7 | 8 | 9 \n" + "\n当前棋盘:" + game.print_board() + ) + yield event.plain_result(instructions) + + @session_waiter(timeout=60, record_history_chains=False) + async def game_waiter(controller: SessionController, event: AstrMessageEvent): + nonlocal game + + # 玩家回合 + if game.current_player == game.player_symbol: + try: + move = int(event.message_str) - 1 + if not game.make_move(move): + await event.send(event.make_result(chain=[Comp.Plain("无效移动,请重试。")])) + controller.keep(timeout=60, reset_timeout=True) + return + except ValueError: + await event.send(event.make_result(chain=[Comp.Plain("请输入1-9的数字。")])) + controller.keep(timeout=60, reset_timeout=True) + return + else: + # 电脑回合 + move = game.computer_move() + game.board[move] = game.current_player + + # 检查游戏状态 + winner = game.check_winner() + if winner: + result = event.make_result() + result.chain = [ + Comp.Plain(f"{game.print_board()}\n"), + Comp.Plain("恭喜你赢了!" if winner == game.player_symbol else "电脑赢了!") + ] + await event.send(result) + controller.stop() + return + + if game.is_board_full(): + result = event.make_result() + result.chain = [ + Comp.Plain(f"{game.print_board()}\n"), + Comp.Plain("平局!") + ] + await event.send(result) + controller.stop() + return + + # 切换玩家并继续游戏 + game.switch_player() + + # 发送更新后的棋盘 + result = event.make_result() + if game.current_player == game.player_symbol: + result.chain = [ + Comp.Plain(f"{game.print_board()}\n"), + Comp.Plain("轮到你走了,请输入1-9:") + ] + else: + result.chain = [ + Comp.Plain(f"{game.print_board()}\n"), + Comp.Plain("电脑思考中...") + ] + await event.send(result) + + # 重置超时时间 + controller.keep(timeout=60, reset_timeout=True) + + try: + await game_waiter(event) + except TimeoutError: + yield event.plain_result("井字棋游戏超时结束!") + except Exception as e: + yield event.plain_result(f"游戏出错: {str(e)}") + finally: + event.stop_event() + + except Exception as e: + logger.error(f"井字棋游戏错误: {str(e)}") + yield event.plain_result("游戏发生错误,请稍后再试。") \ No newline at end of file From 3612be8201eefd6780a386a07e3683db43cfa6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CQAQ=E2=80=9D?= <“1540691861@qq.com”> Date: Thu, 22 May 2025 21:31:43 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=95=E7=94=A8astrb?= =?UTF-8?q?ot.core.utils.session=5Fwaiter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 67ba1b3..26eb6e0 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,10 @@ from .back import time_long, volume, isUserExist, insertUser, seconds_to_hms, ml import pymysql from .Tool import get_tool_name import astrbot.api.message_components as Comp -from astrbot.session import session_waiter, SessionController +from astrbot.core.utils.session_waiter import ( + session_waiter, + SessionController, +) import aiohttp # 需要异步HTTP客户端 from TicTacToeGame import TicTacToeGame