guild = ctx['guild']
    limit = utils.strip_quotes(params_str)
    try:
        limit = int(limit)
    except ValueError:
        if limit:
            return False, "`{}` is not a number.".format(limit)
        else:
            return False, ("You need to specify a number to set the limit to. "
                           "E.g. '{}defaultlimit 4'".format(
                               ctx['print_prefix']))
    await func.set_default_limit(guild, ctx['voice_channel'], limit)
    if int(limit) != 0:
        return True, (
            "Done! From now on, voice channels like the one you're in now will be limited to "
            "{0} users. You can reset this by running `{1}defaultlimit 0`.\n"
            "If you want to set the limit of *only* your channel, "
            "use `{1}limit` instead.".format(limit, ctx['print_prefix']))
    else:
        return True, (
            "Done! From now on, voice channels like the one you're in now will have no user limit."
        )


command = Cmd(
    execute=execute,
    help_text=help_text,
    params_required=1,
    admin_required=True,
    voice_required=True,
)
]]


async def execute(ctx, params):
    guild = ctx['guild']
    settings = ctx['settings']
    textchannels = not settings[
        'text_channels'] if 'text_channels' in settings else True
    settings['text_channels'] = textchannels
    utils.set_serv_settings(guild, settings)
    if textchannels:
        r = "OK, from now on I'll create private text channels for each voice chat."
        perms = guild.me.permissions_in(ctx['channel'])
        if not perms.manage_roles:
            r += (
                "\n:warning: Make sure I have the **Manage Roles** permission in this server and any categories that "
                "contain my voice channels, otherwise I won't be able to make the text channels."
            )
    else:
        r = "Text channel creation is now **OFF** :)"
    return True, r


command = Cmd(
    execute=execute,
    help_text=help_text,
    params_required=0,
    gold_required=True,
    admin_required=True,
)
Exemple #3
0
from commands.base import Cmd

help_text = [[
    ("Usage:", "<PREFIX><COMMAND>"),
    ("Description:",
     "Remove the user limit in your channel. Also removes any limit that may have been "
     "inherited from the primary channel."),
]]


async def execute(ctx, params):
    from commands import limit
    return await limit.command.execute(ctx, ['0'])


command = Cmd(
    execute=execute,
    help_text=help_text,
    params_required=0,
    admin_required=False,
    voice_required=True,
    creator_only=True,
)
                "```{{LIVE??🔴 @@stream_name@@}}```"
                "```{{PLAYERS=1 ?? LFG}}```"
                "```{{PLAYERS<=20 ?? ## [@@game_name@@] // It's a party!}}```"
                "```{{MAX=@@num_playing@@ ?? (Full) // (@@num_playing@@)}}```"
                "```{{RICH??@@party_details@@{{MAX>1?? (@@num_playing@@/@@party_size@@)}}}}```"
                "```{{ROLE:601025860614750229 ?? {{ROLE:615086491235909643??[UK] // {{ROLE:607913610139664444??[DE] // "
                "[EU]}}}}}}```\n"
                "The spaces around the `??` and `//` improve readability but may not be desired if you do not want any "
                "spaces around the result.\n\n"
                "If you have a question or need any help setting up an expression, "
                "please ask me in the [support server](https://discord.io/DotsBotsSupport). "
                "I'd be happy to add any extra variables you need.")
            await channel.send(embed=e)
            return True, "NO RESPONSE"
        else:
            if 'dcnf' not in ctx[
                    'settings'] or ctx['settings']['dcnf'] is False:
                return False, (
                    "`{}` is not a recognized command. Run '**{}help**' "
                    "to get a list of commands".format(c, ctx['print_prefix']))
            else:
                return False, "NO RESPONSE"


command = Cmd(
    execute=execute,
    help_text=help_text,
    params_required=0,
    admin_required=False,
)
except ImportError:
    patreon_info = None

help_text = [[
    ("Usage:", "<PREFIX><COMMAND>"),
    ("Description:",
     "Authenticate yourself as a patron and set this server as your primary server "
     "where your rewards will be unlocked."),
]]


async def execute(ctx, params):
    r = await func.power_overwhelming(ctx, ctx['guild'])
    if params and len(r) > 1:
        response = r[1] if r[1] != "NO RESPONSE" else ""
        if r[0] is True:
            response += (
                "\nNote: If you want to authenticate more than one server, "
                "you need to DM me `power-overwhelming SERVER_ID SERVER_ID SERVER_ID...`"
            )
            return (r[0], response)
    return r


command = Cmd(
    execute=execute,
    help_text=help_text,
    help_link="https://wiki.dotsbots.com/en/gold-patrons",
    params_required=0,
    admin_required=True,
)