To get this you need to first enable Member Intents on your bot.
Example Below:

and after you enable the intents you have to enable intents on your main bot file's code.
Here is what you need to add.
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix=prefix, intents=intents)
After that, your bot should have intents on.
Now, if you want to get the owner's ID, you can use ctx.guild.owner_id
to get the owner's ID.
I hope this solved your problem, Have a nice day, and Best of luck on your bot.