|
22 | 22 | ) |
23 | 23 | from ballsdex.core.utils.utils import can_mention, inventory_privacy, is_staff |
24 | 24 | from bd_models.enums import DonationPolicy |
25 | | -from bd_models.models import BallInstance, Player, Special, Trade, TradeObject, balls |
| 25 | +from bd_models.models import Ball, BallInstance, Player, Special, Trade, TradeObject, balls |
26 | 26 | from settings.models import settings |
27 | 27 |
|
28 | 28 | from .countryballs_paginator import CountryballsDuplicateSource, CountryballsViewer |
@@ -954,3 +954,46 @@ async def collection( |
954 | 954 | await interaction.followup.send(embed=embed, file=file) |
955 | 955 | else: |
956 | 956 | await interaction.followup.send(embed=embed) |
| 957 | + |
| 958 | + @app_commands.command() |
| 959 | + @app_commands.checks.cooldown(1, 5, key=lambda i: i.user.id) |
| 960 | + async def details( |
| 961 | + self, |
| 962 | + interaction: discord.Interaction["BallsDexBot"], |
| 963 | + countryball: BallEnabledTransform, |
| 964 | + ): |
| 965 | + """ |
| 966 | + Display detailed statistics for a specific countryball. |
| 967 | +
|
| 968 | + Parameters |
| 969 | + ---------- |
| 970 | + countryball: Ball |
| 971 | + The countryball you want to inspect. |
| 972 | + """ |
| 973 | + await interaction.response.defer(thinking=True) |
| 974 | + |
| 975 | + ball = await Ball.objects.select_related("regime", "economy").aget(pk=countryball.pk) |
| 976 | + |
| 977 | + emoji = self.bot.get_emoji(ball.emoji_id) or "" |
| 978 | + |
| 979 | + regime_name = ball.regime.name if ball.regime else "N/A" |
| 980 | + economy_name = ball.economy.name if ball.economy else "N/A" |
| 981 | + |
| 982 | + embed = discord.Embed( |
| 983 | + title=f"{emoji} {ball.country} Information", |
| 984 | + description=( |
| 985 | + f"⋄ **Short Name:** {ball.short_name or 'N/A'}\n" |
| 986 | + f"⋄ **Catch Names:** {ball.catch_names or 'N/A'}\n" |
| 987 | + f"⋄ **Regime:** {regime_name}\n" |
| 988 | + f"⋄ **Economy:** {economy_name}\n" |
| 989 | + f"⋄ **Rarity:** {ball.rarity}\n" |
| 990 | + f"⋄ **Attack:** {ball.attack}\n" |
| 991 | + f"⋄ **Health:** {ball.health}\n" |
| 992 | + f"⋄ **Capacity Name:** {ball.capacity_name}\n" |
| 993 | + f"⋄ **Capacity Description:** {ball.capacity_description}\n" |
| 994 | + f"⋄ **Image Credits:** {ball.credits}\n" |
| 995 | + ).replace("⋄", "⋄"), |
| 996 | + color=discord.Color.blurple() |
| 997 | + ) |
| 998 | + |
| 999 | + await interaction.followup.send(embed=embed) |
0 commit comments