curious.commands.conditions

Commonly used conditions.

Functions

author_has_permissions([bypass_owner]) A condition() that ensures the author of the message has all of the specified permissions.
author_has_perms([bypass_owner]) A condition() that ensures the author of the message has all of the specified permissions.
author_has_roles(*roles[, bypass_owner]) A condition() that ensures the author of the message has all of the specified roles.
bot_has_permissions([bypass_owner]) A condition() that ensures the bot has all of the specified permissions.
bot_has_perms([bypass_owner]) A condition() that ensures the bot has all of the specified permissions.
bot_has_roles(*roles[, bypass_owner]) A condition() that ensures the bot has all of the specified roles.
is_guild_owner([bypass_owner]) A condition() that ensures the author of the message is also the owner of the guild.
is_owner() A condition() that ensures the author of the message is the owner of the bot.
curious.commands.conditions.is_owner()[source]

A condition() that ensures the author of the message is the owner of the bot.

The owner is checked automatically by using the application info of the bot.

Example:

@command()
@is_owner()
async def kill(ctx: Context):
    await ctx.bot.kill()
curious.commands.conditions.author_has_permissions(bypass_owner=True, **permissions)[source]

A condition() that ensures the author of the message has all of the specified permissions.

Example:

@command()
@author_has_permissions(kick_members=True)
async def kick(ctx: Context, member: Member):
    await member.kick()
    await ctx.channel.messages.send(':wave:')
Parameters:
  • bypass_owner (bool) – Determines if the owner of the bot can run the command regardless of if the condition failed or not.
  • permissions – A mapping of permissions to check.
curious.commands.conditions.bot_has_permissions(bypass_owner=False, **permissions)[source]

A condition() that ensures the bot has all of the specified permissions.

Example:

@command()
@bot_has_permissions(send_messages=True)
async def test(ctx: Context):
    await ctx.channel.messages.send('The bot can send messages.')
Parameters:
  • bypass_owner (bool) – Determines if the owner of the bot can run the command regardless of if the condition failed or not.
  • permissions – A mapping of permissions to check.
curious.commands.conditions.author_has_perms(bypass_owner=True, **permissions)

A condition() that ensures the author of the message has all of the specified permissions.

Example:

@command()
@author_has_permissions(kick_members=True)
async def kick(ctx: Context, member: Member):
    await member.kick()
    await ctx.channel.messages.send(':wave:')
Parameters:
  • bypass_owner (bool) – Determines if the owner of the bot can run the command regardless of if the condition failed or not.
  • permissions – A mapping of permissions to check.
curious.commands.conditions.bot_has_perms(bypass_owner=False, **permissions)

A condition() that ensures the bot has all of the specified permissions.

Example:

@command()
@bot_has_permissions(send_messages=True)
async def test(ctx: Context):
    await ctx.channel.messages.send('The bot can send messages.')
Parameters:
  • bypass_owner (bool) – Determines if the owner of the bot can run the command regardless of if the condition failed or not.
  • permissions – A mapping of permissions to check.
curious.commands.conditions.author_has_roles(*roles, bypass_owner=True)[source]

A condition() that ensures the author of the message has all of the specified roles.

The role names must all be exact matches.

Example:

@command()
@author_has_roles('Cool')
async def cool(ctx: Context):
    await ctx.channel.messages.send('You are cool.')
Parameters:
  • roles (str) – A collection of role names.
  • bypass_owner (bool) – Determines if the owner of the bot can run the command regardless of if the condition failed or not.
curious.commands.conditions.bot_has_roles(*roles, bypass_owner=False)[source]

A condition() that ensures the bot has all of the specified roles.

The role names must all be exact matches.

Example:

@command()
@bot_has_roles('Cool')
async def cool(ctx: Context):
    await ctx.channel.messages.send('The bot is cool.')
Parameters:
  • roles (str) – A collection of role names.
  • bypass_owner (bool) – Determines if the owner of the bot can run the command regardless of if the condition failed or not.
curious.commands.conditions.is_guild_owner(bypass_owner=True)[source]

A condition() that ensures the author of the message is also the owner of the guild.

Example:

@command()
@is_guild_owner()
async def test(ctx: Context):
    await ctx.channel.messages.send('You are the owner of this guild.')
Parameters:bypass_owner (bool) – Determines if the owner of the bot can run the command regardless of if the condition failed or not.