Beispiel #1
0
    async def owner(self, ctx):
        if ctx.invoked_subcommand is None:
            title = ':joystick: __Guild Owner Manual__ :joystick: '
            description = "All available commands to operate with guild system."
            list_of_values = [{
                "name": ":bellhop: Register Guild :bellhop: ",
                "value": f"`{self.command_string}owner register`"
            }, {
                "name": ":bar_chart: Guild Crypto Link Stats :bar_chart: ",
                "value": f"`{self.command_string}owner stats`"
            }, {
                "name": ":service_dog: Guild Applied Services :service_dog: ",
                "value": f"`{self.command_string}owner services`"
            }, {
                "name":
                ":satellite_orbital: Crypto Link Commands :satellite_orbital: ",
                "value": f"`{self.command_string}owner uplink`"
            }]

            await customMessages.embed_builder(ctx=ctx,
                                               title=title,
                                               description=description,
                                               data=list_of_values,
                                               destination=1,
                                               c=Colour.dark_gold())
Beispiel #2
0
def warning(message: str) -> Embed:
    """
    Constructs warning embed with fixed title:Warning and color:gold
    :param message: embed description
    :return: Embed object
    """
    return simple_embed(message, "Warning", Colour.dark_gold())
    async def stats(self, ctx):
        stats = await self.backoffice.guild_profiles.get_guild_stats(guild_id=ctx.guild.id)

        stats_info = Embed(title=":bank: __Guild Statistics__ :bank: ",
                           timestamp=datetime.utcnow(),
                           colour=Colour.dark_gold())
        stats_info.add_field(name='Wallets registered',
                             value=f'`{stats["registeredUsers"]}`',
                             inline=False)
        xlm_stats = stats["xlm"]
        stats_info.set_thumbnail(url=self.bot.user.avatar_url)
        stats_info.add_field(name=":incoming_envelope: Transactions sent :incoming_envelope:",
                             value=f'`{xlm_stats["txCount"]}`')
        stats_info.add_field(name=":money_with_wings: Volume :money_with_wings:",
                             value=f'`{xlm_stats["volume"]}`')
        stats_info.add_field(name=":cowboy: Public Transactions :cowboy: ",
                             value=f'`{xlm_stats["publicCount"]}`')
        stats_info.add_field(name=":detective: Private Transactions :detective:",
                             value=f'`{xlm_stats["privateCount"]}`')
        stats_info.add_field(name=":person_juggling: Roles Sold :person_juggling: ",
                             value=f'`{xlm_stats["roleTxCount"]}`')
        stats_info.add_field(name=":japanese_ogre: Emoji Transactions :japanese_ogre: ",
                             value=f'`{xlm_stats["emojiTxCount"]}`')
        stats_info.add_field(name=":family_man_woman_boy: Multi tx :family_man_woman_boy: ",
                             value=f'`{xlm_stats["multiTxCount"]}`')
        await ctx.channel.send(embed=stats_info)
Beispiel #4
0
 def colour(self) -> int:
     """Get the associated colour of a Task."""
     if self is TaskType.Hunt:
         return Colour.dark_gold()
     elif self is TaskType.Mine:
         return Colour.dark_gray()
     elif self is TaskType.Gather:
         return Colour.blue()
     elif self is TaskType.Lumber:
         return Colour.from_rgb(165, 42, 42)  # Brown
     else:
         return Colour.blurple()
    async def merch(self, ctx):
        if ctx.invoked_subcommand is None:
            title = ':convenience_store: __Crypto Link Uplink manual__ :convenience_store: '
            description = "All available commands to activate and operate with merchant service."
            list_of_values = [
                {"name": ":pencil:  Open/Reigster for Merchant system :pencil:  ",
                 "value": f"```{self.command_string}owner merchant open ```"},
                {"name": ":joystick: Access commands for merchant :joystick: ",
                 "value": f"```{self.command_string}merchant```"}
            ]

            await customMessages.embed_builder(ctx=ctx, title=title, description=description, data=list_of_values,
                                               destination=1, c=Colour.dark_gold())
    async def uplink(self, ctx):
        if ctx.invoked_subcommand is None:
            title = ':satellite_orbital: __Crypto Link Uplink manual__ :satellite_orbital:'
            description = "All available commands to operate with guild system"
            list_of_values = [
                {"name": "Apply Channel for CL feed",
                 "value": f"`{self.command_string}owner uplink apply <#discord.Channel>`"},
                {"name": "Remove Channel for CL feed",
                 "value": f"`{self.command_string}owner uplink remove`"}
            ]

            await customMessages.embed_builder(ctx=ctx, title=title, description=description, data=list_of_values,
                                               c=Colour.dark_gold())
Beispiel #7
0
    def get_random_color() -> Colour:

        """
        TODO: Add more colors that look good
        :return:
        """

        colors = [
            Colour.blurple(), Colour.dark_blue(), Colour.dark_orange(),
            Colour.dark_magenta(), Colour.teal(), Colour.magenta(),
            Colour.dark_gold(), Colour.blurple()
        ]

        return random.choice(colors)
Beispiel #8
0
 async def user_message(self):
     embed = Embed(color=Colour.dark_gold())
     if self.bot.messager:
         embed.set_author(name=f'Message from {self.bot.messager.name}',
                          url=self.bot.messager.steam_id.community_url,
                          icon_url=self.bot.messager.get_avatar_url())
     embed.add_field(name='User Message:',
                     value=f'You have a message from a user:\n> {self.bot.user_message.split(":", 1)[1]}'
                           f'\nType {self.bot.prefix}acknowledged if you have dealt with this', inline=False)
     self.bot.message = await self.bot.owner.send(embed=embed)
     if self.first:
         try:
             await self.bot.message.pin()
         except HTTPException:
             pass
         self.first = False
    async def services(self, ctx):
        service_status = await self.backoffice.guild_profiles.get_service_statuses(guild_id=ctx.guild.id)
        explorer_channel = self.bot.get_channel(id=int(service_status["explorerSettings"]["channelId"]))

        service_info = Embed(title=":service_dog: __Guild Service Status__ :service_dog: ",
                             timestamp=datetime.utcnow(),
                             description=f'All activated services on Crypto Link system and their relays',
                             colour=Colour.dark_gold())
        service_info.set_thumbnail(url=self.bot.user.avatar_url)

        if explorer_channel:
            service_info.add_field(name=':satellite_orbital: Crypto Link Uplink :satellite_orbital: ',
                                   value=f'```{explorer_channel} ({explorer_channel.id})```')
        else:
            service_info.add_field(name=':satellite_orbital: Crypto Link Uplink :satellite_orbital: ',
                                   value=f':red_circle:')

        await ctx.channel.send(embed=service_info)
Beispiel #10
0
    async def action(self, msg, args, client):
        args_list = list(args)
        param1 = args_list[0]
        triggers = ""
        config_file_path = Path(str(msg.guild.id) + "/triggers.ini")
        trigger_config = configparser.ConfigParser()
        trigger_config.read(config_file_path)
        text_triggers = Logger.get_triggers(Logger)

        if param1 == "add" and args_list[2]:
            key = args_list[1]
            value = args_list[2]
            text_triggers[key] = value
            await msg.channel.send("Trigger :**" + key + "** Added")
            trigger_config.set("text_triggers", key, value)
            with open(config_file_path, "w") as config_file:
                trigger_config.write(config_file)

        elif param1 == "del":
            key = args_list[1]
            if key in text_triggers:
                del text_triggers[key]
                trigger_config.remove_option("text_triggers", key)
                with open(config_file_path, "w") as config_file:
                    trigger_config.write(config_file)
                await msg.channel.send("Trigger **" + key + "** deleted")
            else:
                await msg.channel.send("This triggers doesn't exist")

        elif param1 == "list":
            embedded_message = Embed(title="Voici la liste des triggers",
                                     colour=Colour.dark_gold())
            embedded_message.set_author(
                name="Gaspé",
                icon_url=
                "https://www.beautifulworld.com/wp-content/uploads/2016/10/perce-rock-quebec-canada.jpg"
            )

            for key in text_triggers:
                triggers += key + ": " + text_triggers[key] + "\n"

            embedded_message.add_field(name="so", value=triggers, inline=True)
            embedded_message.set_footer(text="Asteur décrisses")
            await msg.channel.send(embed=embedded_message)
Beispiel #11
0
    async def shop(self, ctx):
        if not user.registered(ctx.author.id):
            await user.send_notregistered_msg(ctx)

        embed = Embed(title="User Shop",
                      description="Buy useful items and boosters!",
                      colour=Colour.dark_gold())
        embed.set_thumbnail(
            url=
            "https://i.pinimg.com/originals/77/c3/66/77c366436d8bd35fe8b3ce5b8c66992e.png"
        )
        embed.add_field(
            name="1. Pickaxe :pick:",
            value=
            f"`Price: ${settings.PRICE_PICKAXE}` | `Bonus: 50% Work Salary`",
            inline=True)
        drill = utils.get(self.bot.emojis, name="drill")
        embed.add_field(
            name=f"2. Drill {str(drill)}",
            value=
            f"`Price: ${settings.PRICE_DRILL}` | `Bonus: 75% Work Salary`",
            inline=True)
        jackhammer = utils.get(self.bot.emojis, name="jackhammer")
        embed.add_field(
            name=f"3. Jackhammer {str(jackhammer)}",
            value=
            f"`Price: ${settings.PRICE_JACKHAMMER}` | `Bonus: 100% Work Salary`",
            inline=True)
        metal_detector = utils.get(self.bot.emojis, name="metal_detector")
        embed.add_field(
            name=f"4. Metal Detector {str(metal_detector)}",
            value=
            f"`Price: ${settings.PRICE_METALDETECTOR}` | `Metal Chance: {settings.MD_VALUABLE_CHANCE}%`",
            inline=True)
        gold_detector = utils.get(self.bot.emojis, name="metal_detector")
        embed.add_field(
            name=f"5. Gold Detector {str(gold_detector)}",
            value=
            f"`Price: ${settings.PRICE_GOLDDETECTOR}` | `Gold Chance: {settings.GD_VALUABLE_CHANCE}%`",
            inline=True)
        diamond_detector = utils.get(self.bot.emojis, name="metal_detector")
        embed.add_field(
            name=f"6. Diamond Detector {str(diamond_detector)}",
            value=
            f"`Price: ${settings.PRICE_DIAMONDDETECTOR}` | `Diamond Chance: {settings.DD_VALUABLE_CHANCE}%`",
            inline=True)
        minecart = utils.get(self.bot.emojis, name="minecart")
        embed.add_field(
            name=f"7. Minecart {str(minecart)}",
            value=
            f"`Price: ${settings.PRICE_MINECART}` | `Bonus: -10% Work Cooldown`",
            inline=True)
        minetransport = utils.get(self.bot.emojis, name="minetransport")
        embed.add_field(
            name=f"8. Mine Transport {str(minetransport)}",
            value=
            f"`Price: ${settings.PRICE_MINETRANSPORT}` | `Bonus: -25% Work Cooldown`",
            inline=True)
        embed.add_field(
            name="9. Transport Plane :airplane:",
            value=
            f"`Price: ${settings.PRICE_TRANSPORTPLANE}` | `Bonus: -50% Work Cooldown`",
            inline=True)
        embed.add_field(name="How to Buy?",
                        value="To buy, use the command `!buy [item number]`.",
                        inline=False)
        await ctx.channel.trigger_typing()
        await asyncio.sleep(2)
        await ctx.send(embed=embed)
Beispiel #12
0
    async def buy(self, ctx, item=0):
        if not user.registered(ctx.author.id):
            await user.send_notregistered_msg(ctx)
        # Item: Pickaxe
        # Price: 2500
        # Description: %50 Work Salary Bonus
        if int(item) == 1:
            if user.has_pickaxe(ctx.author) >= 1:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send("ERROR: You already have this item!")
                return
            if user.get_cash(ctx.author) < settings.PRICE_PICKAXE:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(
                    "ERROR: You don't have any money bud, try working in the mines [!work]"
                )
                return
            query = """
                UPDATE
                equipment
                SET
                equipment_pickaxe=?
                WHERE
                uid=?
            """
            Connection.SQL_Cursor.execute(query, (1, user.get_uid(ctx.author)))
            Connection.SQL_Handle.commit()

            user.update_cash(ctx.author, -settings.PRICE_PICKAXE)
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(
                f"You have bought a `pickaxe` for ${settings.PRICE_PICKAXE}!")
        # Item: Drill
        # Price: 5000
        # Description: %75 Work Salary Bonus
        elif int(item) == 2:
            if user.has_drill(ctx.author) >= 1:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send("ERROR: You already have this item!")
                return
            if user.get_cash(ctx.author) < settings.PRICE_DRILL:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(
                    "ERROR: You don't have any money bud, try working in the mines [!work]"
                )
                return
            query = """
                UPDATE
                equipment
                SET
                equipment_drill=?
                WHERE
                uid=?
            """
            Connection.SQL_Cursor.execute(query, (1, user.get_uid(ctx.author)))
            Connection.SQL_Handle.commit()

            user.update_cash(ctx.author, -settings.PRICE_DRILL)
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(
                f"You have bought a `drill` for ${settings.PRICE_DRILL}!")
        # Item: Jackhammer
        # Price: 15000
        # Description: %100 Work Salary Bonus
        elif int(item) == 3:
            if user.has_jackhammer(ctx.author) >= 1:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send("ERROR: You already have this item!")
                return
            if user.get_cash(ctx.author) < settings.PRICE_JACKHAMMER:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(
                    "ERROR: You don't have any money bud, try working in the mines [!work]"
                )
                return
            query = """
                UPDATE
                equipment
                SET
                equipment_jackhammer=?
                WHERE
                uid=?
            """
            Connection.SQL_Cursor.execute(query, (1, user.get_uid(ctx.author)))
            Connection.SQL_Handle.commit()

            user.update_cash(ctx.author, -settings.PRICE_JACKHAMMER)
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(
                f"You have bought a `jackhammer` for ${settings.PRICE_JACKHAMMER}!"
            )
        # Item: Metal Detector
        # Price: 7500
        # Description: %10 Chance of getting valuable metals
        elif int(item) == 4:
            if user.has_metaldetector(ctx.author) >= 1:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send("ERROR: You already have this item!")
                return
            if user.get_cash(ctx.author) < settings.PRICE_METALDETECTOR:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(
                    "ERROR: You don't have any money bud, try working in the mines [!work]"
                )
                return
            query = """
                UPDATE
                equipment
                SET
                equipment_metal_detector=?
                WHERE
                uid=?
            """
            Connection.SQL_Cursor.execute(query, (1, user.get_uid(ctx.author)))
            Connection.SQL_Handle.commit()

            user.update_cash(ctx.author, -settings.PRICE_METALDETECTOR)
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(
                f"You have bought a `metal detector` for ${settings.PRICE_METALDETECTOR}!"
            )
        # Item: Gold Detector
        # Price: 15000
        # Description: %20 Chance of getting valuable metals
        elif int(item) == 5:
            if user.has_golddetector(ctx.author) >= 1:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send("ERROR: You already have this item!")
                return
            if user.get_cash(ctx.author) < settings.PRICE_GOLDDETECTOR:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(
                    "ERROR: You don't have any money bud, try working in the mines [!work]"
                )
                return
            query = """
                UPDATE
                equipment
                SET
                equipment_gold_detector=?
                WHERE
                uid=?
            """
            Connection.SQL_Cursor.execute(query, (1, user.get_uid(ctx.author)))
            Connection.SQL_Handle.commit()

            user.update_cash(ctx.author, -settings.PRICE_GOLDDETECTOR)
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(
                f"You have bought a `gold detector` for ${settings.PRICE_GOLDDETECTOR}!"
            )
        # Item: Diamond Detector
        # Price: 25000
        # Description: %35 Chance of getting valuable metals / diamonds
        elif int(item) == 6:
            if user.has_diamonddetector(ctx.author) >= 1:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send("ERROR: You already have this item!")
                return
            if user.get_cash(ctx.author) < settings.PRICE_DIAMONDDETECTOR:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(
                    "ERROR: You don't have any money bud, try working in the mines [!work]"
                )
                return
            query = """
                UPDATE
                equipment
                SET
                equipment_diamond_detector=?
                WHERE
                uid=?
            """
            Connection.SQL_Cursor.execute(query, (1, user.get_uid(ctx.author)))
            Connection.SQL_Handle.commit()

            user.update_cash(ctx.author, -settings.PRICE_DIAMONDDETECTOR)
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(
                f"You have bought a `diamond detector` for ${settings.PRICE_DIAMONDDETECTOR}!"
            )
        # Item: Mine Cart
        # Price: 35000
        # Description: -%10 Work Cooldown
        elif int(item) == 7:
            if user.has_minecart(ctx.author) >= 1:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send("ERROR: You already have this item!")
                return
            if user.get_cash(ctx.author) < settings.PRICE_MINECART:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(
                    "ERROR: You don't have any money bud, try working in the mines [!work]"
                )
                return
            query = """
                UPDATE
                equipment
                SET
                equipment_minecart=?
                WHERE
                uid=?
            """
            Connection.SQL_Cursor.execute(query, (1, user.get_uid(ctx.author)))
            Connection.SQL_Handle.commit()

            user.update_cash(ctx.author, -settings.PRICE_MINECART)
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(
                f"You have bought a `minecart` for ${settings.PRICE_MINECART}!"
            )
        # Item: Mine Transport
        # Price: 55000
        # Description: -%25 Work Cooldown
        elif int(item) == 8:
            if user.has_minetransport(ctx.author) >= 1:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send("ERROR: You already have this item!")
                return
            if user.get_cash(ctx.author) < settings.PRICE_MINETRANSPORT:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(
                    "ERROR: You don't have any money bud, try working in the mines [!work]"
                )
                return
            query = """
                UPDATE
                equipment
                SET
                equipment_minetransport=?
                WHERE
                uid=?
            """
            Connection.SQL_Cursor.execute(query, (1, user.get_uid(ctx.author)))
            Connection.SQL_Handle.commit()

            user.update_cash(ctx.author, -settings.PRICE_MINETRANSPORT)
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(
                f"You have bought a `mine transport` for ${settings.PRICE_MINETRANSPORT}!"
            )
        # Item: Transport Plane
        # Price: 150000
        # Description: -%50 Work Cooldown
        elif int(item) == 9:
            if user.has_transportplane(ctx.author) >= 1:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send("ERROR: You already have this item!")
                return
            if user.get_cash(ctx.author) < settings.PRICE_TRANSPORTPLANE:
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(
                    "ERROR: You don't have any money bud, try working in the mines [!work]"
                )
                return

            query = """
                UPDATE
                equipment
                SET
                equipment_transportplane=?
                WHERE
                uid=?
            """
            Connection.SQL_Cursor.execute(query, (1, user.get_uid(ctx.author)))
            Connection.SQL_Handle.commit()

            user.update_cash(ctx.author, -settings.PRICE_TRANSPORTPLANE)
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(
                f"You have bought a `transport plane` for ${settings.PRICE_TRANSPORTPLANE}!"
            )
        else:
            embed = Embed(title="USAGE:",
                          description="!buy [item id]",
                          colour=Colour.dark_gold())
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(embed=embed)
Beispiel #13
0
    async def sell(self, ctx, item=0, amount=0):
        if not user.registered(ctx.author.id):
            embed = Embed(
                title="ERROR",
                description=
                "You are not registered to the database!\n**TIP:** `!register`",
                colour=Colour.red())
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(embed=embed)

        slot_item = {
            "pickaxe": 0,
            "drill": 0,
            "jackhammer": 0,
            "metal_detector": 0,
            "gold_detector": 0,
            "diamond_detector": 0,
            "minecart": 0,
            "minetransport": 0,
            "transportplane": 0,
            "metal": 0,
            "gold": 0,
            "diamond": 0,
        }

        slot_num = 0
        if user.has_pickaxe(ctx.author):
            slot_num += 1
            slot_item["pickaxe"] = slot_num
        if user.has_drill(ctx.author):
            slot_num += 1
            slot_item["drill"] = slot_num
        if user.has_jackhammer(ctx.author):
            slot_num += 1
            slot_item["jackhammer"] = slot_num
        if user.has_metaldetector(ctx.author):
            slot_num += 1
            slot_item["metal_detector"] = slot_num
        if user.has_golddetector(ctx.author):
            slot_num += 1
            slot_item["gold_detector"] = slot_num
        if user.has_diamonddetector(ctx.author):
            slot_num += 1
            slot_item["diamond_detector"] = slot_num
        if user.has_minecart(ctx.author):
            slot_num += 1
            slot_item["minecart"] = slot_num
        if user.has_minetransport(ctx.author):
            slot_num += 1
            slot_item["minetransport"] = slot_num
        if user.has_transportplane(ctx.author):
            slot_num += 1
            slot_item["transportplane"] = slot_num
        if user.metal(ctx.author):
            slot_num += 1
            slot_item["metal"] = slot_num
        if user.gold(ctx.author):
            slot_num += 1
            slot_item["gold"] = slot_num
        if user.diamond(ctx.author):
            slot_num += 1
            slot_item["diamond"] = slot_num
        if not int(item):
            embed = Embed(title="USAGE:",
                          description="!sell [item id]",
                          colour=Colour.dark_gold())
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(embed=embed)
            return

        if int(item) == slot_item["pickaxe"]:
            if user.has_pickaxe(ctx.author):
                slot_equipment("equipment_pickaxe",
                               settings.PRICE_PICKAXE * 0.5, ctx.author)
                embed = Embed(
                    title="Item Sold!",
                    description=
                    f"You have sold your pickaxe for `${settings.PRICE_PICKAXE * 0.5}`\
                     50% of the original price.",
                    colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)

        elif int(item) == slot_item["drill"]:
            if user.has_drill(ctx.author):
                slot_equipment("equipment_drill", settings.PRICE_DRILL * 0.5,
                               ctx.author)
                embed = Embed(
                    title="Item Sold!",
                    description=
                    f"You have sold your drill for `${settings.PRICE_DRILL * 0.5}`\
                     50% of the original price.",
                    colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)

        elif int(item) == slot_item["jackhammer"]:
            if user.has_jackhammer(ctx.author):
                slot_equipment("equipment_jackhammer",
                               settings.PRICE_JACKHAMMER * 0.5, ctx.author)
                embed = Embed(
                    title="Item Sold!",
                    description=
                    f"You have sold your jackhammer for `${settings.PRICE_JACKHAMMER * 0.5}`\
                     50% of the original price.",
                    colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)

        elif int(item) == slot_item["metal_detector"]:
            if user.has_metaldetector(ctx.author):
                slot_equipment("equipment_metal_detector",
                               settings.PRICE_METALDETECTOR * 0.5, ctx.author)
                embed = Embed(
                    title="Item Sold!",
                    description=
                    f"You have sold your metal detector for `${settings.PRICE_METALDETECTOR * 0.5}`\
                     50% of the original price.",
                    colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)

        elif int(item) == slot_item["gold_detector"]:
            if user.has_golddetector(ctx.author):
                slot_equipment("equipment_gold_detector",
                               settings.PRICE_GOLDDETECTOR * 0.5, ctx.author)
                embed = Embed(
                    title="Item Sold!",
                    description=
                    f"You have sold your gold detector for `${settings.PRICE_GOLDDETECTOR * 0.5}`\
                     50% of the original price.",
                    colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)

        elif int(item) == slot_item["diamond_detector"]:
            if user.has_diamonddetector(ctx.author):
                slot_equipment("equipment_diamond_detector",
                               settings.PRICE_DIAMONDDETECTOR * 0.5,
                               ctx.author)
                embed = Embed(
                    title="Item Sold!",
                    description=
                    f"You have sold your diamond detector for `${settings.PRICE_DIAMONDDETECTOR * 0.5}`\
                     50% of the original price.",
                    colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)

        elif int(item) == slot_item["minecart"]:
            if user.has_minecart(ctx.author):
                slot_equipment("equipment_minecart",
                               settings.PRICE_MINECART * 0.5, ctx.author)
                embed = Embed(
                    title="Item Sold!",
                    description=
                    f"You have sold your mine cart for `${settings.PRICE_MINECART * 0.5}`\
                     50% of the original price.",
                    colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)

        elif int(item) == slot_item["minetransport"]:
            if user.has_minetransport(ctx.author):
                slot_equipment("equipment_minetransport",
                               settings.PRICE_MINETRANSPORT * 0.5, ctx.author)
                embed = Embed(
                    title="Item Sold!",
                    description=
                    f"You have sold your mine transport for `${settings.PRICE_MINETRANSPORT * 0.5}`\
                     50% of the original price.",
                    colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)

        elif int(item) == slot_item["transportplane"]:
            if user.has_transportplane(ctx.author):
                slot_equipment("equipment_transportplane",
                               settings.PRICE_TRANSPORTPLANE * 0.5, ctx.author)
                embed = Embed(
                    title="Item Sold!",
                    description=
                    f"You have sold your transport plane for `${settings.PRICE_TRANSPORTPLANE * 0.5}`\
                     50% of the original price.",
                    colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)

        elif int(item) == slot_item["metal"]:
            if user.metal(ctx.author):
                if not amount:
                    embed = Embed(title="USAGE:",
                                  description="!sell metal [amount]",
                                  colour=Colour.dark_gold())
                    await ctx.channel.trigger_typing()
                    await asyncio.sleep(2)
                    await ctx.send(embed=embed)
                    return
                slot_inventory("metal_metal",
                               (settings.PRICE_METAL * 0.5) * amount,
                               ctx.author, amount)
                embed = Embed(
                    title="Item Sold!",
                    description=
                    f"You have sold {amount} metal/s for `${settings.PRICE_METAL * amount}`",
                    colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)

        elif int(item) == slot_item["gold"]:
            if not amount:
                embed = Embed(title="USAGE:",
                              description="!sell gold [amount]",
                              colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)
                return
            if user.gold(ctx.author):
                slot_inventory("metal_gold",
                               (settings.PRICE_GOLD * 0.5) * amount,
                               ctx.author, amount)
                embed = Embed(
                    title="Item Sold!",
                    description=
                    f"You have sold {amount} gold/s for `${settings.PRICE_GOLD * amount}`",
                    colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)

        elif int(item) == slot_item["diamond"]:
            if not amount:
                embed = Embed(title="USAGE:",
                              description="!sell diamond [amount]",
                              colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)
                return
            if user.diamond(ctx.author):
                slot_inventory("metal_diamond",
                               (settings.PRICE_DIAMOND * 0.5) * amount,
                               ctx.author, amount)
                embed = Embed(
                    title="Item Sold!",
                    description=
                    f"You have sold {amount} diamond/s for `${settings.PRICE_DIAMOND * amount}`",
                    colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)

            else:
                embed = Embed(title="ERROR:",
                              description="You don't have that item!",
                              colour=Colour.dark_gold())
                await ctx.channel.trigger_typing()
                await asyncio.sleep(2)
                await ctx.send(embed=embed)
        else:
            embed = Embed(title="USAGE:",
                          description="!sell [item id]",
                          colour=Colour.dark_gold())
            await ctx.channel.trigger_typing()
            await asyncio.sleep(2)
            await ctx.send(embed=embed)
Beispiel #14
0
 async def ping(self, ctx: commands.Context):
     embed = Embed(color=Colour.dark_gold())
     embed.title = 'Pong'
     embed.description = f'{ctx.bot.latency:.3f}ms'
     await handler.send_message(ctx, logger, embed=embed)
Beispiel #15
0
from random import seed, randint
from datetime import datetime

seed(datetime.now())

colours = [
    Colour.teal(),
    Colour.dark_teal(),
    Colour.green(),
    Colour.dark_green(),
    Colour.blue(),
    Colour.dark_blue(),
    Colour.purple(),
    Colour.dark_purple(),
    Colour.magenta(),
    Colour.dark_magenta(),
    Colour.gold(),
    Colour.dark_gold(),
    Colour.orange(),
    Colour.dark_orange(),
    Colour.red(),
    Colour.dark_red(),
    Colour.lighter_grey(),
    Colour.light_grey(),
    Colour.dark_grey(),
    Colour.darker_grey(),
    Colour.blurple(),
    Colour.greyple(),
    Colour.from_rgb(randint(0, 255), randint(0, 255), randint(0, 255))
]