jerrita 9 tháng trước cách đây
mục cha
commit
0aff48e16f
2 tập tin đã thay đổi với 6 bổ sung8 xóa
  1. 2 1
      main.py
  2. 4 7
      plugins/anon/base.py

+ 2 - 1
main.py

@@ -9,6 +9,7 @@ if __name__ == '__main__':
     anon.register_plugins([
         'plugins.anon.base',
         'plugins.anon.muri',
-        'plugins.anon.turing'
+        'plugins.anon.turing',
+        'plugins.corpus.bang'
     ])
     anon.loop()

+ 4 - 7
plugins/anon/base.py

@@ -15,21 +15,18 @@ class AnonPlugin(Plugin):
         await Bot().send_private_message(782981223, f"Anon Started at: {datetime.datetime.now()}")
 
     async def on_event(self, event: MessageEvent):
-        if event.raw == 'anon':
-            await event.reply('は?')
-
         # repeater
         if isinstance(event, GroupMessage):
             group_id = event.gid
             if group_id not in repeater:
-                repeater[group_id] = [event.raw, 1]
+                repeater[group_id] = [event.msg, 1]
             else:
-                if repeater[group_id][0] == event.raw:
+                if repeater[group_id][0].text() == event.msg.text():
                     repeater[group_id][1] += 1
                     if repeater[group_id][1] == 3:
-                        await event.reply(event.raw, quote=False)
+                        await event.reply(event.msg, quote=False)
                 else:
-                    repeater[group_id] = [event.raw, 1]
+                    repeater[group_id] = [event.msg, 1]
 
     async def on_shutdown(self):
         await Bot().send_private_message(782981223, f'Anon shutdown at: {datetime.datetime.now()}')