Commits

Andrew Godwin committed c273a00

/templates

  • Participants
  • Parent commits 9a99035

Comments (0)

Files changed (1)

File myne/plugins/multiworld.py

 
 import random
+import os
 
 from myne.plugins import ProtocolPlugin
 from myne.decorators import *
         "boot": "commandBoot",
         "worlds": "commandWorlds",
         "random": "commandRandom",
+        "templates": "commandTemplates",
     }
     
     @admin_only
         "/worlds - Lists available worlds"
         self.client.sendServerList(["Available worlds:"] + [id for id, world in self.client.factory.worlds.items() if self.client.canEnter(world)])
     
+    def commandTemplates(self, parts):
+        "/templates - Lists available templates"
+        self.client.sendServerList(["Available templates:"] + os.listdir("templates/"))
+    
     def commandRandom(self, parts):
         "/random - Takes you to a random world."
         # Get all public worlds