From 76a903c5ee49ea36623334ba7cac582bddc0ba36 Mon Sep 17 00:00:00 2001
From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
Date: Sun, 21 Apr 2024 20:43:23 -0400
Subject: [PATCH] fix: provide a discord.Member object instead of string to
 slash commands (#273)

---
 src/discord_bot.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/discord_bot.py b/src/discord_bot.py
index 15bba3a..6db1806 100644
--- a/src/discord_bot.py
+++ b/src/discord_bot.py
@@ -53,6 +53,13 @@ async def on_ready():
 
     bot.add_view(DonateCommandView())  # register view for persistent listening
 
+    # try to force sync commands
+    # calling an outdated command seems to force a sync
+    await bot.sync_commands(
+        commands=bot.commands,
+        force=True,
+    )
+
     try:
         os.environ['DAILY_TASKS']
     except KeyError:
@@ -181,7 +188,7 @@ async def channel(ctx: discord.ApplicationContext,
 )
 async def donate_command(ctx: discord.ApplicationContext,
                          user: Option(
-                             input_type=discord.Member,
+                             discord.Member,
                              description=user_mention_desc,
                              required=False)
                          ):
@@ -210,7 +217,7 @@ async def donate_command(ctx: discord.ApplicationContext,
 )
 async def random_command(ctx: discord.ApplicationContext,
                          user: Option(
-                             input_type=discord.Member,
+                             discord.Member,
                              description=user_mention_desc,
                              required=False)
                          ):
@@ -258,7 +265,7 @@ async def random_command(ctx: discord.ApplicationContext,
 )
 async def docs_command(ctx: discord.ApplicationContext,
                        user: Option(
-                           input_type=discord.Member,
+                           discord.Member,
                            description=user_mention_desc,
                            required=False)
                        ):
@@ -300,7 +307,7 @@ async def docs_command(ctx: discord.ApplicationContext,
 )
 async def refund_command(ctx: discord.ApplicationContext,
                          user: Option(
-                             input_type=discord.Member,
+                             discord.Member,
                              description=user_mention_desc,
                              required=False)
                          ):