Skip to content Skip to sidebar Skip to footer

How Does Is_owner Works?

So i am trying to add dev only commands me and my devs get confused on doing this as we need the is_owner but i do not know how to implement it any help here? So currently i have a

Solution 1:

If you want to check if that the person using a command is an owner or developer of the bot, first you will need to set their ID as owner_id when you instance the bot:

bot = commands.Bot(command_prefix = '!', owner_id = 123345219197488900, intents = intents)

In case you are a group of developers and want to set more than one as owner_ids:

owners = [123345219197488900, 173545269197488974, 253345719197888931]
bot = commands.Bot(command_prefix = '!', owner_ids = set(owners), intents = intents)

Then you can use a command check to ensure that the user using this command is an owner.

@commands.command(pass_context=True)
@commands.is_owner()
async def shutdown(self, ctx):

Post a Comment for "How Does Is_owner Works?"