Пример #1
0
 async def sell(self, ctx, *args):
     """Sells the player's inventory for gold pieces."""
     if has_post_permission(ctx.guild.id, ctx.channel.id):
         number, item = ch.parse_number_and_name(args)
         if number and item:
             out = item_helpers.sell(ctx.author.id, item, number=number)
             await ctx.send(out)
Пример #2
0
 async def _vis_buy(self, ctx, *args):
     """Buys an item from the vis wax shop."""
     if has_post_permission(ctx.guild.id, ctx.channel.id):
         number, item = ch.parse_number_and_name(args)
         if item:
             await ctx.send(
                 vis_helpers.shop_buy(ctx.user_object, item, number))
Пример #3
0
 async def buy(self, ctx, *args):
     """Buys something from the shop."""
     if has_post_permission(ctx.guild.id, ctx.channel.id):
         number, item = ch.parse_number_and_name(args)
         if number and item:
             out = item_helpers.buy(ctx.author.id, item, number=number)
             await ctx.send(out)
Пример #4
0
 async def bury(self, ctx, *args):
     """Buries items for prayer experience."""
     if has_post_permission(ctx.guild.id, ctx.channel.id):
         number, name = ch.parse_number_and_name(args)
         if number and name:
             out = ch.bury(ctx.user_object, name,
                           min(number, MAX_PER_ACTION))
             await ctx.send(out)
Пример #5
0
 async def cook(self, ctx, *args):
     """Cooks (a given amount of) an item."""
     if has_post_permission(ctx.guild.id, ctx.channel.id):
         number, food = ch.parse_number_and_name(args)
         if number and food:
             out = craft_helpers.cook(ctx.user_object,
                                      food,
                                      n=min(number, MAX_PER_ACTION))
             await ctx.send(out)
Пример #6
0
 async def craft(self, ctx, *args):
     """Crafts (a given number of) an item."""
     if has_post_permission(ctx.guild.id, ctx.channel.id):
         number, recipe = ch.parse_number_and_name(args)
         if number and recipe:
             out = craft_helpers.craft(ctx.user_object,
                                       recipe,
                                       n=min(number, MAX_PER_ACTION))
             await ctx.send(out)
Пример #7
0
 async def runecraft(self, ctx, *args):
     """Starts a runecrafting session."""
     if has_post_permission(ctx.guild.id, ctx.channel.id):
         number, rune = ch.parse_number_and_name(args)
         if number and rune:
             out = craft_helpers.start_runecraft(
                 ctx.guild.id, ctx.channel.id, ctx.user_object, rune,
                 min(number, MAX_PER_ACTION))
             await ctx.send(out)
Пример #8
0
    async def pull(self, ctx, *args):
        if has_post_permission(ctx.guild.id, ctx.channel.id):
            number, name = ch.parse_number_and_name(args)
            other_person = User.objects.filter(
                Q(name__icontains=name) or Q(nick__icontains=name))[0]

            if other_person:
                out = ch.claim(ctx.user_object,
                               "christmas cracker",
                               number,
                               other_person=other_person)
                await ctx.send(out)
            else:
                await ctx.send(
                    "You need to type the name of someone with whom you want to pull."
                )
Пример #9
0
 async def claim(self, ctx, *args):
     """Claims xp/items from another item."""
     if has_post_permission(ctx.guild.id, ctx.channel.id):
         number, name = ch.parse_number_and_name(args)
         out = ch.claim(ctx.user_object, name, number)
         await ctx.send(out)