Exemplo n.º 1
0
async def loadcons():
    thing = []
    capes = await loadcapes()
    for id in capes:
        x = cape.Cape(id, capes[id])
        thing.append(x)
    return thing
Exemplo n.º 2
0
 async def fullhistory(self, ctx, *args):
     '''Reveal prior experiences of your cape
     '''
     id = str(ctx.author.id)
     capes = await loadcapes()
     if id not in capes:
         await ctx.send("You don't have a cape.")
         return
     x = cape.Cape(id,capes[id])
     await ctx.send("```" + x.history() + "```")
Exemplo n.º 3
0
 async def status(self, ctx, *args):
     '''Displays current status of your cape
     '''
     id = str(ctx.author.id)
     capes = await loadcapes()
     if id not in capes:
         await ctx.send("You don't have a cape.")
         return
     x = cape.Cape(id,capes[id])
     await ctx.send("```" + x.status() + "```")
Exemplo n.º 4
0
 async def addcape(self,ctx,*args):
     id = random.randint(0,10000)
     capes = await loadcapes()
     x = cape.Cape(id, None)
     x.pc = False
     x.givePlayer('None')
     entry = x.jsonDict()
     capes[id] = entry
     with open('autocape/capes.json', 'w+') as capefile:
         json.dump(capes, capefile)
     await ctx.send("```" + x.status() + "```")
     await ctx.send("Cape created.")
Exemplo n.º 5
0
 async def rename(self, ctx, *args):
     thing = str(ctx.author.id)
     capes = await loadcapes()
     if thing not in capes:
         await ctx.send("You don't have anyone to rename.")
         return
     x = cape.Cape(thing, capes[thing])
     newAlias = ''
     for arg in args:
         newAlias += arg + ' '
     newAlias = newAlias[:-1]
     x.alias = newAlias
     await x.updateCape()
     await ctx.send("Your cape is now named " + newAlias + ".")
Exemplo n.º 6
0
 async def history(self,ctx,*args):
     id = str(ctx.author.id)
     capes = await loadcapes()
     if id not in capes:
         await ctx.send("You don't have a cape.")
         return
     x = cape.Cape(id,capes[id])
     final = ''
     shorten = x.history()
     shorten = shorten.splitlines()
     if len(shorten) >= 5:
         for z in range(0,5):
             final += shorten[len(shorten) - z - 1]
             final += "\n"
         await ctx.send("```" + final + "```")
     else:
         await ctx.send("```" + x.history() + "```")
Exemplo n.º 7
0
 async def gen(self, ctx, *args):
     '''Generate a cape for the autocape city
     '''
     id = str(ctx.author.id)
     capes = await loadcapes()
     if id in capes:
         await ctx.send("You already have a cape.")
         return
     x = cape.Cape(str(ctx.author.id),None)
     x.pc = True
     x.givePlayer(ctx.author.display_name)
     entry = x.jsonDict()
     capes[id] = entry
     with open('autocape/capes.json', 'w+') as capefile:
         json.dump(capes, capefile)
     await ctx.send("```" + x.status() + "```")
     await ctx.send("Cape created.")