mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 11:40:12 +01:00
chore: ruff formatting
This commit is contained in:
@@ -30,10 +30,16 @@ class Miscellaneous(commands.GroupCog, name="misc"):
|
||||
embed = discord.Embed(
|
||||
title="Miscellaneous Commands",
|
||||
description="Use `.misc <subcommand>` or `/misc <subcommand>`.",
|
||||
color=0x7289DA
|
||||
color=0x7289DA,
|
||||
)
|
||||
embed.set_author(
|
||||
name="Miscellaneous", icon_url="https://yes.nighty.works/raw/YxMC0r.png"
|
||||
)
|
||||
embed.add_field(
|
||||
name="Available",
|
||||
value="dontasktoask, rr, depart, labubu, duck, tryitandsee, piracy, keanu, support, docs, sigma, silly, color",
|
||||
inline=False,
|
||||
)
|
||||
embed.set_author(name="Miscellaneous", icon_url="https://yes.nighty.works/raw/YxMC0r.png")
|
||||
embed.add_field(name="Available", value="dontasktoask, rr, depart, labubu, duck, tryitandsee, piracy, keanu, support, docs, sigma, silly, color", inline=False)
|
||||
await context.send(embed=embed)
|
||||
|
||||
async def _invoke_hybrid(self, context: Context, name: str):
|
||||
@@ -98,7 +104,9 @@ class Miscellaneous(commands.GroupCog, name="misc"):
|
||||
await self._invoke_hybrid(context, "sigma")
|
||||
|
||||
@miscellaneous_group.command(name="silly")
|
||||
async def miscellaneous_group_silly(self, context: Context, message_type: str = "regular"):
|
||||
async def miscellaneous_group_silly(
|
||||
self, context: Context, message_type: str = "regular"
|
||||
):
|
||||
await self._invoke_hybrid(context, "silly", message_type=message_type)
|
||||
|
||||
@miscellaneous_group.command(name="color")
|
||||
@@ -107,119 +115,83 @@ class Miscellaneous(commands.GroupCog, name="misc"):
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="dontasktoask",
|
||||
description="Shows the 'Don't Ask to Ask' image."
|
||||
name="dontasktoask", description="Shows the 'Don't Ask to Ask' image."
|
||||
)
|
||||
async def dontasktoask(self, context):
|
||||
return await dontasktoask_command()(self, context)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="rr",
|
||||
description="Rickroll"
|
||||
)
|
||||
@commands.hybrid_command(name="rr", description="Rickroll")
|
||||
async def rr(self, context):
|
||||
return await rr_command()(self, context)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="depart",
|
||||
description="Show the departure meme"
|
||||
)
|
||||
@commands.hybrid_command(name="depart", description="Show the departure meme")
|
||||
async def depart(self, context):
|
||||
return await depart_command()(self, context)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="labubu",
|
||||
description="Labubu ASCII art"
|
||||
)
|
||||
@commands.hybrid_command(name="labubu", description="Labubu ASCII art")
|
||||
async def labubu(self, context):
|
||||
return await labubu_command()(self, context)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="duck",
|
||||
description="Duck ASCII art"
|
||||
)
|
||||
@commands.hybrid_command(name="duck", description="Duck ASCII art")
|
||||
async def duck(self, context):
|
||||
return await duck_command()(self, context)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="tryitandsee",
|
||||
description="Try it and see"
|
||||
)
|
||||
@commands.hybrid_command(name="tryitandsee", description="Try it and see")
|
||||
async def tryitandsee(self, context):
|
||||
return await tryitandsee_command()(self, context)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="piracy",
|
||||
description="FBI Anti Piracy Warning"
|
||||
)
|
||||
@commands.hybrid_command(name="piracy", description="FBI Anti Piracy Warning")
|
||||
async def piracy(self, context):
|
||||
return await piracy_command()(self, context)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="keanu",
|
||||
description="Reeves"
|
||||
)
|
||||
@commands.hybrid_command(name="keanu", description="Reeves")
|
||||
async def keanu(self, context):
|
||||
return await keanu_command()(self, context)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="support",
|
||||
description="Support?"
|
||||
)
|
||||
@commands.hybrid_command(name="support", description="Support?")
|
||||
async def support(self, context):
|
||||
return await support_command()(self, context)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="docs",
|
||||
description="Shows the docs image."
|
||||
)
|
||||
@commands.hybrid_command(name="docs", description="Shows the docs image.")
|
||||
async def docs(self, context):
|
||||
return await docs_command()(self, context)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="sigma",
|
||||
description="i feel so sigma!"
|
||||
)
|
||||
@commands.hybrid_command(name="sigma", description="i feel so sigma!")
|
||||
async def sigma(self, context):
|
||||
return await sigma_command()(self, context)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="silly",
|
||||
description="Sends a silly message :3"
|
||||
@commands.hybrid_command(name="silly", description="Sends a silly message :3")
|
||||
@app_commands.describe(message_type="Type of message to send (regular or animated)")
|
||||
@app_commands.choices(
|
||||
message_type=[
|
||||
app_commands.Choice(name="Regular", value="regular"),
|
||||
app_commands.Choice(name="Animated", value="animated"),
|
||||
]
|
||||
)
|
||||
@app_commands.describe(
|
||||
message_type="Type of message to send (regular or animated)"
|
||||
)
|
||||
@app_commands.choices(message_type=[
|
||||
app_commands.Choice(name="Regular", value="regular"),
|
||||
app_commands.Choice(name="Animated", value="animated")
|
||||
])
|
||||
async def silly(self, context, message_type: str = "regular"):
|
||||
return await silly_command()(self, context, message_type=message_type)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(
|
||||
name="color",
|
||||
description="Get a random color."
|
||||
)
|
||||
@commands.hybrid_command(name="color", description="Get a random color.")
|
||||
async def color(self, context):
|
||||
return await color_command()(self, context)
|
||||
|
||||
|
||||
async def setup(bot) -> None:
|
||||
cog = Miscellaneous(bot)
|
||||
await bot.add_cog(cog)
|
||||
|
||||
|
||||
bot.logger.info("Loaded extension 'miscellaneous.dontasktoask'")
|
||||
bot.logger.info("Loaded extension 'miscellaneous.rr'")
|
||||
bot.logger.info("Loaded extension 'miscellaneous.depart'")
|
||||
@@ -232,4 +204,4 @@ async def setup(bot) -> None:
|
||||
bot.logger.info("Loaded extension 'miscellaneous.docs'")
|
||||
bot.logger.info("Loaded extension 'miscellaneous.sigma'")
|
||||
bot.logger.info("Loaded extension 'miscellaneous.silly'")
|
||||
bot.logger.info("Loaded extension 'miscellaneous.color'")
|
||||
bot.logger.info("Loaded extension 'miscellaneous.color'")
|
||||
|
||||
@@ -3,6 +3,7 @@ from discord.ext import commands
|
||||
import random
|
||||
import colorsys
|
||||
|
||||
|
||||
def color_command():
|
||||
@commands.hybrid_command(name="color", description="Get a random color.")
|
||||
async def color(self, context):
|
||||
@@ -13,25 +14,39 @@ def color_command():
|
||||
color = discord.Color(random_color_int)
|
||||
|
||||
r, g, b = color.r, color.g, color.b
|
||||
|
||||
|
||||
rgb_decimal = (r / 255, g / 255, b / 255)
|
||||
|
||||
|
||||
h, l, s = colorsys.rgb_to_hls(rgb_decimal[0], rgb_decimal[1], rgb_decimal[2])
|
||||
h_hsv, s_hsv, v_hsv = colorsys.rgb_to_hsv(rgb_decimal[0], rgb_decimal[1], rgb_decimal[2])
|
||||
h_hsv, s_hsv, v_hsv = colorsys.rgb_to_hsv(
|
||||
rgb_decimal[0], rgb_decimal[1], rgb_decimal[2]
|
||||
)
|
||||
|
||||
embed = discord.Embed(color=color)
|
||||
embed.set_author(name="Random Color", icon_url="https://yes.nighty.works/raw/YxMC0r.png")
|
||||
|
||||
embed.set_author(
|
||||
name="Random Color", icon_url="https://yes.nighty.works/raw/YxMC0r.png"
|
||||
)
|
||||
|
||||
embed.add_field(name="Hex", value=str(color))
|
||||
embed.add_field(name="RGB", value=f"rgb({r}, {g}, {b})")
|
||||
embed.add_field(name="RGB Decimal", value=f"{rgb_decimal[0]:.3f}, {rgb_decimal[1]:.3f}, {rgb_decimal[2]:.3f}")
|
||||
|
||||
embed.add_field(name="HSL", value=f"hsl({h*360:.0f}, {s*100:.0f}%, {l*100:.0f}%)")
|
||||
embed.add_field(name="HSV", value=f"hsv({h_hsv*360:.0f}, {s_hsv*100:.0f}%, {v_hsv*100:.0f}%)")
|
||||
embed.add_field(
|
||||
name="RGB Decimal",
|
||||
value=f"{rgb_decimal[0]:.3f}, {rgb_decimal[1]:.3f}, {rgb_decimal[2]:.3f}",
|
||||
)
|
||||
|
||||
embed.add_field(
|
||||
name="HSL", value=f"hsl({h * 360:.0f}, {s * 100:.0f}%, {l * 100:.0f}%)"
|
||||
)
|
||||
embed.add_field(
|
||||
name="HSV",
|
||||
value=f"hsv({h_hsv * 360:.0f}, {s_hsv * 100:.0f}%, {v_hsv * 100:.0f}%)",
|
||||
)
|
||||
embed.add_field(name="Integer", value=str(random_color_int))
|
||||
|
||||
embed.set_thumbnail(url=f"https://singlecolorimage.com/get/{str(color).replace('#', '')}/150x150")
|
||||
embed.set_thumbnail(
|
||||
url=f"https://singlecolorimage.com/get/{str(color).replace('#', '')}/150x150"
|
||||
)
|
||||
|
||||
await context.send(embed=embed)
|
||||
|
||||
return color
|
||||
|
||||
return color
|
||||
|
||||
@@ -26,5 +26,5 @@ def depart_command():
|
||||
await inter.followup.send(file=file, ephemeral=True)
|
||||
else:
|
||||
await context.send(file=file)
|
||||
|
||||
|
||||
return depart
|
||||
|
||||
@@ -4,14 +4,12 @@ from discord.ext.commands import Context
|
||||
import aiohttp
|
||||
import io
|
||||
|
||||
|
||||
def docs_command():
|
||||
@commands.hybrid_command(
|
||||
name="docs",
|
||||
description="Shows the docs image."
|
||||
)
|
||||
@commands.hybrid_command(name="docs", description="Shows the docs image.")
|
||||
async def docs(self, context):
|
||||
url = "https://yes.nighty.works/raw/akdx0q.webp"
|
||||
|
||||
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(url) as resp:
|
||||
data = await resp.read()
|
||||
@@ -20,10 +18,16 @@ def docs_command():
|
||||
if getattr(context, "interaction", None):
|
||||
inter = context.interaction
|
||||
if not inter.response.is_done():
|
||||
await inter.response.send_message("## Dont be like the rest, read the docs", file=file, ephemeral=False)
|
||||
await inter.response.send_message(
|
||||
"## Dont be like the rest, read the docs",
|
||||
file=file,
|
||||
ephemeral=False,
|
||||
)
|
||||
else:
|
||||
await inter.followup.send("## Dont be like the rest, read the docs", file=file, ephemeral=True)
|
||||
await inter.followup.send(
|
||||
"## Dont be like the rest, read the docs", file=file, ephemeral=True
|
||||
)
|
||||
else:
|
||||
await context.send("## Dont be like the rest, read the docs", file=file)
|
||||
|
||||
|
||||
return docs
|
||||
|
||||
@@ -4,14 +4,14 @@ from discord.ext.commands import Context
|
||||
import aiohttp
|
||||
import io
|
||||
|
||||
|
||||
def dontasktoask_command():
|
||||
@commands.hybrid_command(
|
||||
name="dontasktoask",
|
||||
description="Shows the 'Don't Ask to Ask' image."
|
||||
name="dontasktoask", description="Shows the 'Don't Ask to Ask' image."
|
||||
)
|
||||
async def dontasktoask(self, context):
|
||||
image_url = "https://yes.nighty.works/raw/KecbCr.jpg"
|
||||
|
||||
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(image_url) as resp:
|
||||
data = await resp.read()
|
||||
@@ -25,5 +25,5 @@ def dontasktoask_command():
|
||||
await inter.followup.send(file=file, ephemeral=True)
|
||||
else:
|
||||
await context.send(file=file)
|
||||
|
||||
|
||||
return dontasktoask
|
||||
|
||||
@@ -27,10 +27,12 @@ def duck_command():
|
||||
if getattr(context, "interaction", None):
|
||||
inter = context.interaction
|
||||
if not inter.response.is_done():
|
||||
await inter.response.send_message(f"```ansi\n{duck_art}\n```", ephemeral=False)
|
||||
await inter.response.send_message(
|
||||
f"```ansi\n{duck_art}\n```", ephemeral=False
|
||||
)
|
||||
else:
|
||||
await inter.followup.send(f"```ansi\n{duck_art}\n```", ephemeral=True)
|
||||
else:
|
||||
await context.send(f"```ansi\n{duck_art}\n```")
|
||||
|
||||
|
||||
return duck
|
||||
|
||||
@@ -28,14 +28,16 @@ def keanu_command():
|
||||
"https://yes.nighty.works/raw/C7gy4v.jpg",
|
||||
"https://yes.nighty.works/raw/XqHg1q.jpg",
|
||||
"https://yes.nighty.works/raw/RUXNK7.png",
|
||||
"https://yes.nighty.works/raw/CBNs9L.jpg"
|
||||
"https://yes.nighty.works/raw/CBNs9L.jpg",
|
||||
]
|
||||
|
||||
|
||||
embed = discord.Embed(
|
||||
description="## Reeves",
|
||||
color=0x7289DA,
|
||||
)
|
||||
embed.set_author(name="Keanu", icon_url="https://yes.nighty.works/raw/YxMC0r.png")
|
||||
embed.set_author(
|
||||
name="Keanu", icon_url="https://yes.nighty.works/raw/YxMC0r.png"
|
||||
)
|
||||
embed.set_image(url=random.choice(images))
|
||||
if getattr(context, "interaction", None):
|
||||
inter = context.interaction
|
||||
@@ -45,5 +47,5 @@ def keanu_command():
|
||||
await inter.followup.send(embed=embed, ephemeral=True)
|
||||
else:
|
||||
await context.send(embed=embed)
|
||||
|
||||
|
||||
return keanu
|
||||
|
||||
@@ -49,9 +49,11 @@ def labubu_command():
|
||||
description=f"```ansi\n{labubu_art}\n```",
|
||||
color=0x7289DA,
|
||||
)
|
||||
embed.set_author(name="Labubu", icon_url="https://yes.nighty.works/raw/YxMC0r.png")
|
||||
embed.set_author(
|
||||
name="Labubu", icon_url="https://yes.nighty.works/raw/YxMC0r.png"
|
||||
)
|
||||
embed.set_footer(text=f"May look broken on mobile")
|
||||
|
||||
|
||||
if getattr(context, "interaction", None):
|
||||
inter = context.interaction
|
||||
if not inter.response.is_done():
|
||||
@@ -60,5 +62,5 @@ def labubu_command():
|
||||
await inter.followup.send(embed=embed, ephemeral=True)
|
||||
else:
|
||||
await context.send(embed=embed)
|
||||
|
||||
|
||||
return labubu
|
||||
|
||||
@@ -26,5 +26,5 @@ def piracy_command():
|
||||
await inter.followup.send(file=file, ephemeral=True)
|
||||
else:
|
||||
await context.send(file=file)
|
||||
|
||||
|
||||
return piracy
|
||||
|
||||
@@ -26,5 +26,5 @@ def rr_command():
|
||||
await inter.followup.send(file=file, ephemeral=True)
|
||||
else:
|
||||
await context.send(file=file)
|
||||
|
||||
|
||||
return rr
|
||||
|
||||
@@ -26,5 +26,5 @@ def sigma_command():
|
||||
await inter.followup.send(file=file, ephemeral=True)
|
||||
else:
|
||||
await context.send(file=file)
|
||||
|
||||
|
||||
return sigma
|
||||
|
||||
@@ -13,7 +13,7 @@ def silly_command():
|
||||
message = "https://yes.nighty.works/raw/LX4nqt.gif"
|
||||
else:
|
||||
message = ":3"
|
||||
|
||||
|
||||
interaction = getattr(context, "interaction", None)
|
||||
if interaction is not None:
|
||||
await interaction.response.defer(ephemeral=True)
|
||||
@@ -28,5 +28,5 @@ def silly_command():
|
||||
except:
|
||||
pass
|
||||
await context.channel.send(message)
|
||||
|
||||
return silly
|
||||
|
||||
return silly
|
||||
|
||||
@@ -4,14 +4,12 @@ from discord.ext.commands import Context
|
||||
import aiohttp
|
||||
import io
|
||||
|
||||
|
||||
def support_command():
|
||||
@commands.hybrid_command(
|
||||
name="support",
|
||||
description="Shows the support image."
|
||||
)
|
||||
@commands.hybrid_command(name="support", description="Shows the support image.")
|
||||
async def support(self, context):
|
||||
url = "https://yes.nighty.works/raw/wGzHIV.gif"
|
||||
|
||||
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(url) as resp:
|
||||
data = await resp.read()
|
||||
@@ -25,5 +23,5 @@ def support_command():
|
||||
await inter.followup.send(file=file, ephemeral=True)
|
||||
else:
|
||||
await context.send(file=file)
|
||||
|
||||
|
||||
return support
|
||||
|
||||
@@ -10,7 +10,7 @@ def tryitandsee_command():
|
||||
)
|
||||
async def tryitandsee(self, context):
|
||||
link = "https://tryitands.ee/"
|
||||
|
||||
|
||||
if getattr(context, "interaction", None):
|
||||
inter = context.interaction
|
||||
if not inter.response.is_done():
|
||||
@@ -19,5 +19,5 @@ def tryitandsee_command():
|
||||
await inter.followup.send(link, ephemeral=True)
|
||||
else:
|
||||
await context.send(link)
|
||||
|
||||
|
||||
return tryitandsee
|
||||
|
||||
Reference in New Issue
Block a user