Esempio n. 1
0
def setup(bot_: Bot):
    global bot

    bot = bot_

    # settings
    register('poll.createroles',
             None,
             lambda _: True,
             False,
             'Roles allowed to create polls. Defaults to anyone.',
             filter=create_filter)
    register('poll.voteroles',
             None,
             lambda _: True,
             False,
             'Roles allowed to vote in polls. Defaults to anyone.',
             filter=vote_filter)

    # events
    bot.add_listener(on_raw_reaction_add)
    bot.add_listener(on_raw_reaction_remove)
    bot.add_listener(on_ready)

    bot.add_command(poll)
Esempio n. 2
0
def setup(bot):
    bot.add_check(check_name_only)
    # settings
    register('nameonly', None, lambda x: True, False,
             'If set, the bot will only respond when directly mentioned. '
             '__**Note**__: It is _extremely_ important that you give the bot '
             'a nickname before setting this. If the bot does not have a nick '
             'set, its username will be the same as its role and it will be '
             'very difficult to mention it directly, potentially bricking the '
             'bot altogether.')
    register('nameonly.channel', None, lambda x: True, True,
             'If set, the bot will only respond when mentioned directly '
             '(in this channel). **See warning from `nameonly` setting.**')
Esempio n. 3
0
def setup(bot):
    # settings
    register('settings.adminroles', None, lambda x: True, False,
             'The server roles that are allowed to administer settings. '
             'Separate multiple values with commas. Administrators and '
             'moderators have de facto access to all commands.',
             filter=role_filter)
    cog = Settings(bot)

    for c in cog.get_commands():
        c.add_check(authz)
        c.add_check(channel_only)

    bot.add_cog(cog)
Esempio n. 4
0
def setup(bot: Bot):
    # settings
    register('greet.channel',
             None,
             lambda x: True,
             False,
             'The channel where greetings should be sent.',
             filter=channel_filter)
    register(
        'greet.message', None, lambda x: True, False,
        'The message new members will be greeted with. You may use '
        'the `{name}` token in your message and it will be replaced '
        'automatically with the member\'s username. The `{nl}` token '
        'will be replaced with a line break (new line).')

    bot.add_listener(on_member_join)
Esempio n. 5
0
def setup(bot_: Bot):
    global bot

    bot = bot_

    # settings
    register('roles.catalog', None, lambda x: True, False,
             'The roles members are allowed to add/remove themselves',
             filter=roles_filter)
    register('roles.postexpiry', 60, lambda x: True, False,
             'The length of time (in seconds) to keep self-service posts')

    # events
    bot.add_listener(on_raw_reaction_add)
    bot.add_listener(on_raw_reaction_remove)
    bot.add_listener(on_ready)

    bot.add_command(roles)
    bot.add_command(catalog)
Esempio n. 6
0
def setup(bot: Bot):
    register(
        'prefix', None, lambda _: True, False,
        "The bot's command prefix. Note that it will still respond when "
        'mentioned directly.')