async def METHOD_NAME(ctx: commands.Context | discord.Interaction, user_id: int) -> Optional[discord.Member | discord.User]:
    if ctx.guild and (user := ctx.guild.get_member(user_id)):
        return user
    else:
        bot = ctx.bot if isinstance(ctx, commands.Context) else ctx.client
        return await bot.fetch_user(user_id)