From 8a64a9bc759dcb8bf85d53a136b1b3b67aedaf83 Mon Sep 17 00:00:00 2001 From: neoarz Date: Mon, 15 Sep 2025 07:12:38 -0400 Subject: [PATCH] chore: fix the look of randomfunfact.py --- cogs/fun/coinflip.py | 4 ++-- cogs/fun/randomfact.py | 23 ++++++++--------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/cogs/fun/coinflip.py b/cogs/fun/coinflip.py index f8ec451..0827a3a 100644 --- a/cogs/fun/coinflip.py +++ b/cogs/fun/coinflip.py @@ -8,14 +8,14 @@ class Choice(discord.ui.View): super().__init__() self.value = None - @discord.ui.button(label="Heads", style=discord.ButtonStyle.blurple) + @discord.ui.button(label="Heads", style=discord.ButtonStyle.primary) async def confirm( self, interaction: discord.Interaction, button: discord.ui.Button ) -> None: self.value = "heads" self.stop() - @discord.ui.button(label="Tails", style=discord.ButtonStyle.red) + @discord.ui.button(label="Tails", style=discord.ButtonStyle.primary) async def cancel( self, interaction: discord.Interaction, button: discord.ui.Button ) -> None: diff --git a/cogs/fun/randomfact.py b/cogs/fun/randomfact.py index 6be4e14..fb211ca 100644 --- a/cogs/fun/randomfact.py +++ b/cogs/fun/randomfact.py @@ -1,11 +1,3 @@ -""" -Copyright © Krypton 2019-Present - https://github.com/kkrypt0nn (https://krypton.ninja) -Description: -🐍 A simple template to start to code your own and personalized Discord bot in Python - -Version: 6.4.0 -""" - import aiohttp import discord from discord.ext import commands @@ -18,26 +10,27 @@ class RandomFact(commands.Cog, name="randomfact"): @commands.hybrid_command(name="randomfact", description="Get a random fact.") async def randomfact(self, context: Context) -> None: - """ - Get a random fact. - - :param context: The hybrid command context. - """ async with aiohttp.ClientSession() as session: async with session.get( "https://uselessfacts.jsph.pl/random.json?language=en" ) as request: if request.status == 200: data = await request.json() - embed = discord.Embed(description=data["text"], color=0xD75BF4) + embed = discord.Embed( + title="Random Fact", + description=data["text"], + color=0x7289DA + ) + embed.set_author(name="Fun", icon_url="https://yes.nighty.works/raw/eW5lLm.webp") else: embed = discord.Embed( title="Error!", description="There is something wrong with the API, please try again later", color=0xE02B2B, ) + embed.set_author(name="Fun", icon_url="https://yes.nighty.works/raw/eW5lLm.webp") await context.send(embed=embed) async def setup(bot) -> None: - await bot.add_cog(RandomFact(bot)) + await bot.add_cog(RandomFact(bot)) \ No newline at end of file