fix fetchuser
This commit is contained in:
parent
417d371f6e
commit
157b8b5bab
@ -42,9 +42,15 @@ class FetchUserCog(commands.Cog, name="FetchUser"):
|
||||
await sendable(embed=embed)
|
||||
|
||||
@commands.hybrid_command(name="fetchuser", description="Fetch a user by ID and show info.")
|
||||
async def fetchuser(self, ctx: commands.Context, user_id: int):
|
||||
async def fetchuser(self, ctx: commands.Context, user_id: str):
|
||||
"""Fetch a Discord user by ID."""
|
||||
await self._fetch_user_and_send(ctx.send, user_id)
|
||||
try:
|
||||
user_id_int = int(user_id)
|
||||
except ValueError:
|
||||
await ctx.send("❌ Invalid user ID provided.")
|
||||
return
|
||||
|
||||
await self._fetch_user_and_send(ctx.send, user_id_int)
|
||||
|
||||
async def setup(bot: commands.Bot):
|
||||
await bot.add_cog(FetchUserCog(bot))
|
||||
|
Loading…
x
Reference in New Issue
Block a user