|
| 1 | +from discord import Embed, Interaction, app_commands |
| 2 | +from discord.ext.commands import Cog |
| 3 | + |
| 4 | +from bot.main import ActBot |
| 5 | +from bot.ui import EmbedX |
| 6 | + |
| 7 | +ALPHA_PREVIEW_NOTICE = {"title": "", "content": "**: "} |
| 8 | + |
| 9 | + |
| 10 | +def add_preview_notice(embed: Embed): |
| 11 | + embed.set_author(name="FEATURE PREVIEW") |
| 12 | + embed.add_field(name="", value="", inline=False) |
| 13 | + embed.add_field(name="", value="") |
| 14 | + embed.add_field( |
| 15 | + name=":warning: Important Notice", |
| 16 | + value="This feature is not yet functional." |
| 17 | + "It's a work-in-progress and will be released in a future update." |
| 18 | + "Thank you for your patience. 🙏", |
| 19 | + ) |
| 20 | + return embed |
| 21 | + |
| 22 | + |
| 23 | +# ---------------------------------------------------------------------------------------------------- |
| 24 | +# * Item Cog |
| 25 | +# ---------------------------------------------------------------------------------------------------- |
| 26 | +class ItemCog(Cog, description="Allows players to use items."): |
| 27 | + def __init__(self, bot: ActBot): |
| 28 | + self.bot = bot |
| 29 | + |
| 30 | + @app_commands.guild_only() |
| 31 | + @app_commands.command(description="View purchasable items") |
| 32 | + async def shop(self, interaction: Interaction): |
| 33 | + await interaction.response.send_message( |
| 34 | + embed=add_preview_notice( |
| 35 | + EmbedX.info( |
| 36 | + icon="🏬", |
| 37 | + title="Shop", |
| 38 | + description="\n⚔ Sword\n🛡 Shield\n🥾 Boot\n🍎 Apple\n🍌 Banana\n🍔 Burger\n🔫 Gun\n👕 T-Shirt", |
| 39 | + ) |
| 40 | + ) |
| 41 | + ) |
| 42 | + |
| 43 | + @app_commands.guild_only() |
| 44 | + @app_commands.command(description="Purchase an item") |
| 45 | + async def buy(self, interaction: Interaction, item: str): |
| 46 | + await interaction.response.send_message( |
| 47 | + embed=add_preview_notice( |
| 48 | + EmbedX.info( |
| 49 | + icon="🛒", |
| 50 | + title="Purchase", |
| 51 | + description=f"{interaction.user.mention} purchased **{item}**.", |
| 52 | + ) |
| 53 | + ), |
| 54 | + ) |
| 55 | + |
| 56 | + @app_commands.guild_only() |
| 57 | + @app_commands.command(description="View your item inventory") |
| 58 | + async def inventory(self, interaction: Interaction): |
| 59 | + await interaction.response.send_message( |
| 60 | + embed=add_preview_notice( |
| 61 | + EmbedX.info( |
| 62 | + icon="🎒", |
| 63 | + title="Inventory", |
| 64 | + description="🐵 Abducted Monkey **x 3**", |
| 65 | + ), |
| 66 | + ) |
| 67 | + ) |
| 68 | + |
| 69 | + @app_commands.guild_only() |
| 70 | + @app_commands.command(description="Equip an equippable item") |
| 71 | + async def equip(self, interaction: Interaction, item: str): |
| 72 | + command_name = interaction.command.name if interaction.command else "?" |
| 73 | + await interaction.response.send_message( |
| 74 | + embed=add_preview_notice( |
| 75 | + EmbedX.info( |
| 76 | + icon="🎒", |
| 77 | + title="Item Equipage", |
| 78 | + description=f"{interaction.user.mention} equipped **{item}**.", |
| 79 | + ) |
| 80 | + ), |
| 81 | + ) |
| 82 | + |
| 83 | + @app_commands.guild_only() |
| 84 | + @app_commands.command(description="Use a consumable item") |
| 85 | + async def use(self, interaction: Interaction, item: str): |
| 86 | + await interaction.response.send_message( |
| 87 | + embed=add_preview_notice( |
| 88 | + EmbedX.info( |
| 89 | + icon="🎒", |
| 90 | + title="Item Consumption", |
| 91 | + description=f"{interaction.user.mention} used **{item}**.", |
| 92 | + ) |
| 93 | + ), |
| 94 | + ) |
0 commit comments