From 6429dc2e01d9e9907f715ad22aeabc0f950d8d26 Mon Sep 17 00:00:00 2001
From: Romain J <romain.ordi@gmail.com>
Date: Sat, 28 Sep 2019 01:20:44 +0200
Subject: [PATCH] refactor(command|utility): rewrite quote

---
 cogs/utility.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/cogs/utility.py b/cogs/utility.py
index 2d75f7f..382ecda 100644
--- a/cogs/utility.py
+++ b/cogs/utility.py
@@ -114,6 +114,28 @@ class Utility(commands.Cog):
         )
         await ctx.send(embed=e)
 
+    """---------------------------------------------------------------------"""
+
+    @commands.command(name='quote')
+    async def _quote(self, ctx, message_id: discord.Message):
+        e = discord.Embed(
+            colour=message_id.author.colour,
+            description=message_id.clean_content,
+            timestamp=message_id.created_at
+        )
+        e.set_author(
+            name=message_id.author.display_name,
+            icon_url=message_id.author.avatar_url_as(format="jpg")
+        )
+        if len(message_id.attachments) >= 1:
+            e.set_image(url=message_id.attachments[0].url)
+
+        e.add_field(name="**Original**",
+                    value=f"[Go!]({message_id.jump_url})")
+        e.set_footer(text="#" + message_id.channel.name)
+
+        await ctx.send(embed=e)
+
 
 def setup(bot: TuxBot):
     bot.add_cog(Utility(bot))