fix(bot): 🐛 Fix reply argument conversion.
This commit is contained in:
@@ -28,7 +28,7 @@ class Mods(base.Cog):
|
||||
async def ban(
|
||||
self,
|
||||
ctx: commands.Context,
|
||||
user: discord.User | discord.Member | converters.DiscordUser,
|
||||
user: converters.DiscordUserID,
|
||||
time: converters.Timedelta | None = None,
|
||||
*,
|
||||
reason: str | None = "",
|
||||
@@ -42,13 +42,7 @@ class Mods(base.Cog):
|
||||
- `[<reason>]`: The reason of their ban.
|
||||
"""
|
||||
|
||||
user_id = None
|
||||
|
||||
if isinstance(user, (discord.User, discord.Member)):
|
||||
user_id = user.id
|
||||
|
||||
else:
|
||||
user_id = user
|
||||
user_id = user
|
||||
|
||||
profile = await models.Profile.filter(user_id=user_id).limit(1).first()
|
||||
|
||||
@@ -88,7 +82,7 @@ class Mods(base.Cog):
|
||||
async def unban(
|
||||
self,
|
||||
ctx: commands.Context,
|
||||
user: discord.User | discord.Member | converters.DiscordUser,
|
||||
user: converters.DiscordUserID,
|
||||
) -> None:
|
||||
"""
|
||||
Unbans a user by their ID, pinging them, or replying to their message. The user will be
|
||||
@@ -98,7 +92,7 @@ class Mods(base.Cog):
|
||||
- `<user>`: The user to unban or their ID.
|
||||
"""
|
||||
|
||||
user_id = user if isinstance(user, int) else user.id
|
||||
user_id = user
|
||||
|
||||
await self.bot.unban(user_id)
|
||||
|
||||
@@ -121,7 +115,7 @@ class Mods(base.Cog):
|
||||
async def warn(
|
||||
self,
|
||||
ctx: commands.Context,
|
||||
user: discord.User | discord.Member | converters.DiscordUser,
|
||||
user: converters.DiscordUserID,
|
||||
*,
|
||||
reason: str,
|
||||
) -> None:
|
||||
@@ -133,7 +127,7 @@ class Mods(base.Cog):
|
||||
- `<reason>`: The reason of the warn.
|
||||
"""
|
||||
|
||||
user_id = user if isinstance(user, int) else user.id
|
||||
user_id = user
|
||||
|
||||
user = None
|
||||
|
||||
@@ -316,7 +310,7 @@ class Mods(base.Cog):
|
||||
f"Profiles: {await models.Profile.all().count()}",
|
||||
f"Servers: {await models.Server.all().count()}",
|
||||
f"Shards: {self.bot.shard_count}",
|
||||
f"Current Shard: {ctx.guild.shard_id + 1}"
|
||||
f"Current Shard: {ctx.guild.shard_id + 1}",
|
||||
]
|
||||
|
||||
await ctx.send(f"```\n{"\n".join(stats)}\n```")
|
||||
|
||||
Reference in New Issue
Block a user