jerrita hace 9 meses
padre
commit
07fef22b9b
Se han modificado 2 ficheros con 18 adiciones y 6 borrados
  1. 17 5
      plugins/anon/base.py
  2. 1 1
      plugins/anon/muri.py

+ 17 - 5
plugins/anon/base.py

@@ -1,7 +1,19 @@
-from anon.plugin import PluginManager
+import asyncio
+import datetime
+
+from anon import Bot
+from anon.event.event import Event
+from anon.plugin import PluginManager, Plugin
 from anon.event import MessageEvent
 
-@PluginManager().register_event([MessageEvent])
-async def anon(event: MessageEvent):
-    if event.raw == 'anon':
-        await event.reply('は?')
+class AnonPlugin(Plugin):
+    def on_load(self):
+        super().on_load()
+        self.interested = [MessageEvent]
+        asyncio.run(Bot().send_private_message(78298122, f"Anon Started at: {datetime.datetime.now()}"))
+    
+    async def on_event(self, event: MessageEvent):
+        if event.raw == 'anon':
+            await event.reply('は?')
+
+PluginManager().register_plugin(AnonPlugin())

+ 1 - 1
plugins/anon/muri.py

@@ -36,7 +36,7 @@ async def muri(event: GroupMessage):
             ans = []
             for i in db:
                 ans.append(i)
-                await event.reply('/'.join(ans), quote=False)
+            await event.reply('/'.join(ans), quote=False)
         elif msg in db:
             random.seed(datetime.datetime.now())
             await event.reply(random.choice(db[msg].split('/')))