From cd1a5a6b1642a92b8715ca01eee0192aa19683b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= <tlovinator@gmail.com>
Date: Sat, 17 Apr 2021 21:43:12 +0200
Subject: [PATCH] Use embed for !reminders

---
 main.py | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/main.py b/main.py
index 6b5699c..571d8d1 100644
--- a/main.py
+++ b/main.py
@@ -40,12 +40,18 @@ async def on_ready():
 
 @bot.command()
 async def reminders(ctx):
-    msg = ""
+    embed = discord.Embed(
+        colour=discord.Colour.random(),
+        title="discord-reminder-bot by TheLovinator#9276",
+        description=f"Reminders for {ctx.guild.name}",
+        url="https://github.com/TheLovinator1/discord-reminder-bot",
+    )
     jobs = scheduler.get_jobs()
     for job in jobs:
         channel_id = job.kwargs.get("channel_id")
         for channel in ctx.guild.channels:
             if channel.id == channel_id:
+
                 message = job.kwargs.get("message")
 
                 trigger_time = job.trigger.run_date
@@ -66,10 +72,16 @@ async def reminders(ctx):
                 if minutes != 0:
                     the_final_countdown += f"{minutes} minutes"
 
-                msg += f'{message} at {trigger_time.strftime("%Y-%m-%d %H:%M:%S")} (in {the_final_countdown})\n'
-    if not msg:
+                embed.add_field(
+                    name=f"{message}",
+                    value=f"{trigger_time.strftime('%Y-%m-%d %H:%M')} (in {the_final_countdown})",
+                    inline=False,
+                )
+    if len(embed) == 0:
         msg = f"{ctx.guild.name} has no reminders."
-    await ctx.send(msg)
+        await ctx.send(msg)
+    else:
+        await ctx.send(embed=embed)
 
 
 @bot.command(aliases=["reminder", "remindme", "at"])