Exemple #1
0
 def ls(self, userId, args):
     robot = self.db.robots.find_one({'owner': userId})
     if not robot:
         self.db.robots.insert({
             "name": generate_name(),
             "inventory": [],
             "x": 0,
             "y": 0,
             "owner": userId,
             "actions": [],
             "instructions": {},
             "messages": [],
             "instructions_stage": 0,
         })
         robot = self.db.robots.find_one({'owner': userId})
     robot = Robot(robot)
     return robot.to_terminal()