From 922c96bfa2c0fc620e914e22da9492968d0af412 Mon Sep 17 00:00:00 2001 From: Stijn De Clercq Date: Tue, 29 Sep 2020 23:35:47 +0200 Subject: [PATCH] Created say command Fixes #12 --- cogs/modcommands.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 cogs/modcommands.py diff --git a/cogs/modcommands.py b/cogs/modcommands.py new file mode 100644 index 0000000..f28fee0 --- /dev/null +++ b/cogs/modcommands.py @@ -0,0 +1,29 @@ +import discord +from discord.ext import commands +from functions import checks + + +class ModCommands(commands.Cog): + def __init__(self, client): + self.client = client + + def cog_check(self, ctx): + return checks.isModPlus(ctx) + + @commands.command(name="Say") + async def say(self, ctx, *, arg): + # Delete the original message + await ctx.message.delete() + + # Attach the server icon as a file + file = discord.File("files/images/server_icon.png", filename="icon.png") + + # Set up the embed + embed = discord.Embed(colour=discord.Colour.orange()) + embed.set_author(name=ctx.author.display_name, icon_url="attachment://icon.png") + embed.description = arg + await ctx.send(embed=embed, file=file) + + +def setup(client): + client.add_cog(ModCommands(client)) \ No newline at end of file