From de0c05011ad7cea3a52ab4fd212f6b04b8409480 Mon Sep 17 00:00:00 2001 From: FrozenChen Date: Sat, 3 Jun 2023 22:39:29 -0300 Subject: [PATCH] extras.py: Add serverbanner command --- cogs/extras.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cogs/extras.py b/cogs/extras.py index bc54af1c9..5a5ecc188 100644 --- a/cogs/extras.py +++ b/cogs/extras.py @@ -734,6 +734,16 @@ async def servericon(self, ctx: GuildContext): embed.set_image(url=ctx.guild.icon.url) await ctx.send(embed=embed, ephemeral=True) + @commands.guild_only() + @commands.hybrid_command() + async def serverbanner(self, ctx: GuildContext): + """Sends embed with the server's banner.""" + if ctx.guild.banner is None: + return await ctx.send("This server has no banner set.", ephemeral=True) + embed = discord.Embed(title=f"{ctx.guild.name} Banner") + embed.set_image(url=ctx.guild.banner.url) + await ctx.send(embed=embed, ephemeral=True) + @commands.guild_only() @commands.command(name='close', aliases=['solved']) async def close_thread(self, ctx: GuildContext):