minya_hotomoe/modules/Maze.py

23 lines
717 B
Python
Raw Permalink Normal View History

2023-10-09 08:41:46 +02:00
import os
from module_interface import ModuleInterface
from mipac.models import Note
class MyModule(ModuleInterface):
def __init__(self):
super().__init__()
self.name = "Maze"
self.regex_pattern = r".*미로|Maze|maze.*"
print("[Maze] Maze Module loaded.")
async def execute_module(self, ctx: Note):
print(f"[Maze] {self.name} 실행: {ctx.content}")
await self.manager.require("MazeGenerator").get_func("generate_maze")()
file = await self.manager.bot.client.drive.file.action.upload_file(file=os.path.dirname(os.path.abspath(__file__)) + "/maze/maze.png")
await ctx.api.action.reply("미로를 생성했어요!", files=[file])