From c889e9be0fea74137c68980c2ac3e6519ae5eda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=B6=E3=82=AB=E3=83=AA=E3=82=A2=E3=82=B9=E3=83=BB?= =?UTF-8?q?=E3=82=A6=E3=82=A3=E3=83=AA=E3=82=A2=E3=83=A0=E3=83=BB=E3=83=9D?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=BC?= <26689019-pancakes1234@users.noreply.gitlab.com> Date: Thu, 5 Jun 2025 02:41:42 +0900 Subject: [PATCH] Edit world_time.py --- cogs/world_time.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cogs/world_time.py b/cogs/world_time.py index f9c3d65..22d48aa 100644 --- a/cogs/world_time.py +++ b/cogs/world_time.py @@ -9,13 +9,12 @@ class WorldTime(commands.Cog): def __init__(self, bot): self.bot = bot - @app_commands.command(name="worldtime", description="Display time in different timezones") + @app_commands.command(name="world_time", description="Display timezones") @app_commands.describe(timezone="The timezone to display (optional)") async def worldtime(self, interaction: discord.Interaction, timezone: str = None): now = datetime.datetime.now(datetime.timezone.utc) if timezone: - # User specified a timezone try: tz = pytz.timezone(timezone) local_time = now.astimezone(tz) @@ -24,12 +23,12 @@ class WorldTime(commands.Cog): # Handle invalid timezone await interaction.response.send_message(f"Unknown timezone: `{timezone}`\nTry using a timezone from the IANA Time Zone Database (e.g., 'America/New_York', 'Europe/London')", ephemeral=True) else: - # No timezone specified, show 5 random timezones + # no selected zone so displays fuckass zones :3 all_timezones = list(pytz.all_timezones) random_timezones = random.sample(all_timezones, 5) embed = discord.Embed(title="World Time", color=discord.Color.blue()) - embed.description = "Here are 5 random timezones:" + embed.description = "Timezones" for tz_name in random_timezones: tz = pytz.timezone(tz_name)