예제 #1
0
def get_commands(bot):
    new_commands = []

    new_commands.append(Command(
        'botman', subcommands=[
            SubCommand(
                Opt('change'), Opt('avatar', optional=True), Opt('status', optional=True),
                doc='Changes the avatar, status, or both from the list files.'),
            SubCommand(
                Opt('nick'), Arg('nickname', argtype=ArgTypes.MERGED_OPTIONAL, default=None),
                doc='Sets or clears the nickname for the current server.',
                elevated_level=1, allow_direct=False),
            SubCommand(
                Opt('name'), Arg('name', argtype=ArgTypes.MERGED),
                doc='Sets the bot\'s name.'),
            SubCommand(
                Opt('status'), Arg('text', argtype=ArgTypes.MERGED_OPTIONAL, default=None),
                doc='Sets or clears the bot\'s "now playing" message.'),
            SubCommand(
                Opt('avatar'), Arg('url', argtype=ArgTypes.MERGED_OPTIONAL),
                doc='Sets or clears the bot\'s avatar.')],
        description='Change simple bot stuff, like the avatar and status.',
        elevated_level=3, category='bot utilities', function=get_response))

    return new_commands
예제 #2
0
def get_commands(bot):
    return [
        Command(
            'autolog',
            subcommands=[
                SubCommand(
                    Opt('channels'),
                    Arg('channel',
                        argtype=ArgTypes.SPLIT_OPTIONAL,
                        convert=utilities.ChannelConverter(
                            constraint=discord.TextChannel),
                        doc='Toggles logging in these channels.'),
                    doc=
                    'Shows logged channels or toggles logging in the given channel(s).',
                    function=autolog_channels),
                SubCommand(
                    Opt('messages'),
                    Arg('number',
                        quotes_recommended=False,
                        convert=int,
                        check=lambda b, m, v, *a: 50 <= v <= 500,
                        check_error=
                        'Must be between 50 and 500 messages inclusive.'),
                    doc='Sets the number of messages to log.',
                    function=autolog_messages),
                SubCommand(Opt('setchannel'),
                           Arg('channel',
                               argtype=ArgTypes.MERGED,
                               convert=utilities.ChannelConverter(
                                   constraint=discord.TextChannel)),
                           doc='Sets the logging channel.',
                           function=autolog_setchannel),
                SubCommand(Opt('dump'),
                           Opt('details',
                               optional=True,
                               attached='text',
                               always_include=True,
                               default='No details provided.'),
                           Opt('query',
                               optional=True,
                               attached='user ID',
                               convert=int,
                               always_include=True,
                               quotes_recommended=False),
                           Arg('channel',
                               argtype=ArgTypes.SPLIT_OPTIONAL,
                               convert=utilities.ChannelConverter(
                                   constraint=discord.TextChannel)),
                           doc='Dumps logs.',
                           function=autolog_dump)
            ],
            description='Automatically logs chat when a user is banned.',
            elevated_level=1,
            allow_direct=False,
            category='tools')
    ]
예제 #3
0
def get_commands(bot):
    return [Command(
        'character', subcommands=[
            SubCommand(
                Opt('create'),
                Attachment(
                    'character file', optional=True,
                    doc='If you have a character file saved from the entry creator, '
                        'you can use it directly here.'),
                doc='Creates a character entry under your name.',
                function=character_create),
            SubCommand(
                Opt('remove'),
                Arg('character name', argtype=ArgTypes.MERGED, convert=CharacterConverter()),
                doc='Removes the given character entry under your name.',
                function=character_remove),
            SubCommand(
                Opt('edit'),
                Arg('character name', argtype=ArgTypes.MERGED, convert=CharacterConverter()),
                doc='Provides a link that allows you to edit the given character.',
                function=character_edit),
            SubCommand(
                Opt('list'),
                Arg('user', argtype=ArgTypes.MERGED_OPTIONAL,
                    convert=utilities.MemberConverter(server_only=False)),
                doc='Lists the characters of the given user.',
                function=character_list),
            SubCommand(
                Opt('search'),
                Arg('tag', argtype=ArgTypes.SPLIT),
                doc='Searches for characters with the given tag(s).',
                function=character_search),
            SubCommand(
                Opt('browse'),
                Arg('letter', argtype=ArgTypes.MERGED_OPTIONAL),
                doc='Browses all characters.',
                function=character_browse),
            SubCommand(
                Opt('forceremove'),
                Arg('user', convert=utilities.MemberConverter()),
                Arg('character name', argtype=ArgTypes.MERGED),
                doc='Forcibly removes the given character.',
                elevated_level=3, function=character_forceremove),
            SubCommand(
                Opt('user', attached='owner name', optional=True,
                    convert=utilities.MemberConverter(server_only=False),
                    doc='Searches for characters this user has made.'),
                Arg('character name', argtype=ArgTypes.MERGED_OPTIONAL),
                doc='Displays a list of character entries of the given user.',
                confidence_threshold=3, function=character_display)],
        description='Character database.', category='user data')]
예제 #4
0
def get_commands(bot):
    new_commands = []

    new_commands.append(
        Command(
            'gdq',
            subcommands=[
                SubCommand(doc='Shows the GDQ menu.'),
                SubCommand(Opt('about'),
                           doc='Shows some basic information about GDQ.'),
                SubCommand(
                    Opt('status'),
                    doc=
                    'Shows the stream status and total amount amount of money raised.'
                ),
                SubCommand(Opt('current'),
                           doc='Shows the current game being played.'),
                SubCommand(
                    Opt('next'),
                    Arg('number',
                        convert=int,
                        check=lambda b, m, v, *a: 1 <= v <= 5,
                        check_error='Must be between 1 and 5 inclusive.',
                        default=1,
                        argtype=ArgTypes.OPTIONAL,
                        quotes_recommended=False),
                    doc=
                    'Shows the next game(s). If a number is given (between 1 and 5 '
                    'inclusive), it will show the next number of games.'),
                SubCommand(Opt('search'),
                           Arg('title', argtype=ArgTypes.MERGED),
                           doc='Searches for the given game.'),
                SubCommand(
                    Opt('notify'),
                    Opt('channel',
                        optional=True,
                        check=lambda b, m, v, *a: data.is_mod(
                            b, m.guild, m.author.id),
                        check_error=
                        'Only bot moderators can notify the channel.'),
                    Arg('title', argtype=ArgTypes.MERGED),
                    doc=
                    'Sends a message to either the user or the channel for the given '
                    'game when it is about to be streamed (approximately 5-10 minutes '
                    'beforehand).\nOnly bot moderators can use the channel option.'
                )
            ],
            description='Games Done Quick for Discord.',
            category='service'))

    return new_commands
예제 #5
0
def get_commands(bot):
    new_commands = []
    
    new_commands.append(Command(
        'find', subcommands=[
            SubCommand(
                Opt('start'),
                Arg('character_name'),
                Arg('bell'),
                doc='Initalizes the search for a given user.',
                function=to_be_named),
            SubCommand(
                Opt('stop'),
                Arg('character_name'),
                doc='Stops searching for a given user.',
                function=to_be_stopped),
            SubCommand(
                Opt('clear'),
                Arg('character_name'),
                Arg('server'), # optional all
                doc='Resets a server or the entire search',
                function=to_be_cleared),
            SubCommand(
                Opt('call'),
                Arg('character_name'),
                Arg('server'),
                Arg('status'),
                doc='Calls wether or not a user has been found to be there or not',
                function=to_be_called),
            SubCommand(
                Opt('bell'),
                Arg('server'),
                Arg('bell_minutes'),
                doc='Calls out a server for having a bell.',
                function=to_be_belled),
            SubCommand(
                Opt('clearbell'),
                Arg('server'),
                doc='Clears a bell from a server',
                function=to_be_bellcleared),
            SubCommand(
                Opt('info')
                Arg('character_name'),
                doc='Gets basic info on a character and their search history.',
                function=to_be_info),
            SubCommand(
                Opt('list')
                doc='Gets a list of names for who has been searched for in the past.',
                function=to_be_list)
                ],
        description='Keep track of what servers has been searched in BDO'))
예제 #6
0
def get_commands(bot):
    new_commands = []

    new_commands.append(
        Command(
            'wolfram',
            subcommands=[
                SubCommand(
                    Opt('pro'),
                    doc=
                    'Learn about Wolfram|Alpha Pro and what it can help you accomplish.',
                    function=get_pro_info),
                SubCommand(Opt('ip'),
                           Arg('IP address', quotes_recommended=False),
                           doc='Sets the default IP address used for queries.',
                           allow_direct=False,
                           function=set_ip_address),
                SubCommand(Opt('units'),
                           doc='Toggles between metric and US standard units.',
                           allow_direct=False,
                           function=set_units),
                SubCommand(
                    Opt('text', optional=True,
                        doc='Only get textual results.'),
                    Opt('results',
                        attached='number of results',
                        optional=True,
                        default=3,
                        convert=int,
                        check=lambda b, m, v, *a: 1 <= v <= 8,
                        check_error='Must be between 1 and 8 inclusive.',
                        quotes_recommended=False,
                        doc='The number of results to display.'),
                    Arg('query', argtype=ArgTypes.MERGED),
                    doc='Uses Wolfram|Alpha to parse the given query.',
                    function=run_query)
            ],
            shortcuts=[
                Shortcut('wa', '{arguments}',
                         Arg('arguments', argtype=ArgTypes.MERGED)),
                Shortcut('swa', 'text results 1 {query}',
                         Arg('query', argtype=ArgTypes.MERGED))
            ],
            description='Wolfram|Alpha integration.',
            other='API calls are limited. Please use responsibly!',
            category='tools'))

    return new_commands
예제 #7
0
def get_commands(bot):
    return [
        Command(
            'awoo',
            subcommands=[
                SubCommand(doc='Get fined.', allow_direct=False,
                           function=awoo),
                SubCommand(
                    Opt('stats'),
                    Arg('user',
                        argtype=ArgTypes.MERGED_OPTIONAL,
                        convert=utilities.MemberConverter(server_only=False)),
                    doc='See how much money you or the given user owes.',
                    function=awoo_stats),
                SubCommand(Opt('leaderboard'),
                           doc='See the list of worst offenders.',
                           function=awoo_leaderboard),
                SubCommand(Opt('toggle'),
                           Arg('channel',
                               argtype=ArgTypes.SPLIT_OPTIONAL,
                               convert=utilities.ChannelConverter(
                                   constraint=discord.TextChannel),
                               doc='Toggles detection in this channel.'),
                           doc='Toggles awoo detection.',
                           function=awoo_toggle,
                           elevated_level=1),
                SubCommand(Opt('whitelist'),
                           Arg('user',
                               argtype=ArgTypes.MERGED_OPTIONAL,
                               convert=utilities.MemberConverter()),
                           doc='Whitelist users from detection.',
                           function=awoo_whitelist,
                           elevated_level=1),
                SubCommand(Opt('reset'),
                           Arg('user',
                               argtype=ArgTypes.MERGED,
                               convert=utilities.MemberConverter()),
                           function=awoo_reset,
                           elevated_level=3)
            ],
            shortcuts=[
                Shortcut('astats', 'stats {arguments}',
                         Arg('arguments', argtype=ArgTypes.MERGED_OPTIONAL)),
                Shortcut('aleaderboard', 'leaderboard')
            ],
            description='Consult the criminal database.')
    ]
예제 #8
0
def get_commands(bot):
    return [Command(
        'role', subcommands=[
            SubCommand(
                Opt('join'),
                Arg('role name', argtype=ArgTypes.SPLIT, convert=utilities.RoleConverter()),
                doc='Join a role (or multiple).',
                function=role_joinleave, id='join'),
            SubCommand(
                Opt('leave'),
                Arg('role name', argtype=ArgTypes.SPLIT, convert=utilities.RoleConverter()),
                doc='Leave a role (or multiple).',
                function=role_joinleave, id='leave'),
            SubCommand(
                Opt('toggle'),
                Arg('role name', argtype=ArgTypes.SPLIT, convert=utilities.RoleConverter()),
                doc='Toggle self-assignable roles.',
                elevated_level=1, function=role_toggle),
            SubCommand(
                Opt('create'),
                Opt('mentionable', optional=True, group='options'),
                Opt('hoisted', optional=True, group='options'),
                Opt('color', optional=True, attached='hex color', group='options',
                    convert=utilities.HexColorConverter()),
                Arg('role name', argtype=ArgTypes.MERGED),
                doc='Creates roles and allows them to be self-assignable.',
                elevated_level=1, function=role_create),
            SubCommand(
                Opt('delete'),
                Arg('role name', argtype=ArgTypes.SPLIT, convert=utilities.RoleConverter()),
                doc='Deletes the given roles.',
                elevated_level=1, function=role_delete),
            SubCommand(
                Opt('verification'),
                Arg('role name', argtype=ArgTypes.MERGED_OPTIONAL,
                    convert=utilities.RoleConverter()),
                doc='If self-assignable roles requires a role itself, '
                    'it can be set or cleared with this command.',
                elevated_level=1, function=role_verification),
            SubCommand(
                Opt('list'),
                Arg('role name', argtype=ArgTypes.MERGED_OPTIONAL,
                    convert=utilities.RoleConverter()),
                doc='Lists available self-assignable roles, or members with the given role.',
                function=role_list)],
        allow_direct=False,
        description='Assigns or removes roles.', category='user tools')]
예제 #9
0
def get_commands(bot):
    return [
        Command(
            'commission',
            subcommands=[
                SubCommand(Opt('configure'),
                           Opt('channel',
                               attached='channel name',
                               optional=True,
                               convert=utilities.ChannelConverter(
                                   constraint=discord.TextChannel,
                                   attribute='id')),
                           Opt('cooldown',
                               attached='seconds',
                               optional=True,
                               convert=int,
                               check=lambda b, m, v, *a: v > 0,
                               check_error='Must be greater than 0 seconds.',
                               quotes_recommended=False),
                           doc='Configures the commission channel rules.',
                           elevated_level=1,
                           function=commission_configure),
                SubCommand(
                    Opt('whitelist'),
                    Arg('user',
                        argtype=ArgTypes.MERGED_OPTIONAL,
                        convert=utilities.MemberConverter(attribute='id')),
                    doc='Whitelists a user from the commission channel limits.',
                    elevated_level=1,
                    function=commission_whitelist),
                SubCommand(Opt('reset'),
                           Arg('user',
                               argtype=ArgTypes.MERGED_OPTIONAL,
                               convert=utilities.MemberConverter()),
                           doc='Resets a user\'s post cooldown.',
                           elevated_level=1,
                           function=commission_reset),
                SubCommand(
                    Opt('list'),
                    doc=
                    'Lists users that have advertised in the commission channel.',
                    elevated_level=1,
                    function=commission_list)
            ],
            description='Imposes the limits on the commission channel.',
            allow_direct=False)
    ]
예제 #10
0
def get_commands(bot):
    return [Command(
        'translate', subcommands=[
            SubCommand(
                Opt('default'),
                Arg('language', argtype=ArgTypes.MERGED_OPTIONAL),
                doc='Sets the default translation language. (Default is `en`)',
                elevated_level=1, function=translate_default),
            SubCommand(
                Opt('languages'),
                doc='Gets a list of valid language codes.',
                function=translate_languages),
            SubCommand(
                Opt('from', attached='language', optional=True),
                Opt('to', attached='language', optional=True),
                Arg('text', argtype=ArgTypes.MERGED),
                doc='Translates text.',
                function=translate)],
        shortcuts=[Shortcut('ft', 'from igbo {text}', Arg('text', argtype=ArgTypes.MERGED))],
        description='Translates text.', other=LANGUAGE_LINK, category='tools')]
예제 #11
0
def get_commands(bot):
    return [Command(
        'tagremote', subcommands=[
            SubCommand(doc='Gets the current remote session.', function=tagremote),
            SubCommand(
                Opt('start'),
                doc='Starts a sound tag remote session.',
                function=tagremote_start),
            SubCommand(
                Opt('stop'),
                doc='Stops the current sound tag remote session.',
                function=tagremote_stop),
            SubCommand(
                Opt('update'),
                doc='Provides a refreshed tag list. Updates can be '
                    'applied in the settings menu of the tag remote app.',
                function=tagremote_update)
        ],
        description='Call sound tags through your phone.',
        allow_direct=False
    )]
예제 #12
0
def get_commands(bot):
    """Returns a list of commands associated with this plugin."""
    new_commands = []

    new_commands.append(Command(
        'sheet', subcommands=[
            SubCommand(
                Opt('new'),
                Arg('family_name'), 
                Arg('daily_pay_value', convert=int, check=lambda n, f, v, *a: 0 <= v <= 5000000,
                    check_error='Daily pay value must be between 0 and 5000000 inclusive.', 
                    argtype=ArgTypes.MERGED), 
                doc='Updates Google Sheet with a new 10k renewal.',
                function=update_to_sheet,
                elevated_level=Elevation.BOT_MODERATORS),
            SubCommand(
                Opt('kick'),
                Arg('family_name'),
                doc='Kicks a member from the spreadsheet.',
                function=kick_member,
                elevated_level=Elevation.GUILD_OWNERS),
            SubCommand(
                Opt('add'),
                Arg('family_name'),
                Arg('discord_name', argtype=ArgTypes.MERGED),
                doc='Adds a member to sheet',
                function=invite_member,
                elevated_level=Elevation.GUILD_OWNERS),
            SubCommand(
                Opt('attendance'),
                doc='Takes attendance in current channel',
                function=take_attendance,
                elevated_level=Elevation.GUILD_OWNERS)
        ],
        description='Updates from discord to google sheets because influence officers and '
                    'helpers are f*****g lazy and can\'t update a f*****g form.'
                    'Also Sean sucks Boba\'s hard throbbing chocolate fondue.',
        pre_check=check_whitelist, allow_direct=False))

    return new_commands
예제 #13
0
def get_commands(bot):
    return [
        Command(
            'verification',
            subcommands=[
                SubCommand(
                    Opt('check'),
                    Arg('user',
                        argtype=ArgTypes.MERGED_OPTIONAL,
                        quotes_recommended=False,
                        convert=utilities.MemberConverter()),
                    doc='Checks if the given user qualifies for verification.',
                    function=verification_check),
                SubCommand(Opt('karma'),
                           Arg('user',
                               argtype=ArgTypes.MERGED,
                               quotes_recommended=False),
                           doc='Checks for karma on the r/furry subreddit.',
                           elevated_level=1,
                           function=verification_karma),
                SubCommand(Opt('set'),
                           Arg('role',
                               argtype=ArgTypes.MERGED,
                               quotes_recommended=False,
                               convert=utilities.RoleConverter()),
                           doc='Sets the verification role.',
                           elevated_level=1,
                           function=verification_set)
            ],
            shortcuts=[
                Shortcut('vc', 'check {user}',
                         Arg('user', argtype=ArgTypes.MERGED_OPTIONAL)),
                Shortcut('vk', 'karma {user}',
                         Arg('user', argtype=ArgTypes.MERGED))
            ],
            description='A set of tools for the r/furry Discord server.',
            allow_direct=False,
            category='tools')
    ]
예제 #14
0
def get_commands(bot):
    return [Command('playtest', subcommands=[SubCommand(Arg('url'))])]
예제 #15
0
def get_commands(bot):
    return [Command('convertdata', hidden=True, elevated_level=3)]
예제 #16
0
def get_commands():
    """Sets up new commands and shortcuts in the proper syntax.

    See dummy.py for a complete sample reference.
    """
    new_commands = []

    new_commands.append(
        Command('ping',
                SubCommands(('&', '(<message>)',
                             'The bot will respond with "Pong!" and the '
                             'given message if it is included.')),
                description='Pings the bot for a response.',
                group='base'))

    new_commands.append(
        Command(
            'base',
            SubCommands(
                ('version', 'version', 'Gets the version of the bot.'),
                ('source', 'source', 'Gets the source of the bot.'),
                ('uptime', 'uptime', 'Gets the uptime of the bot.'),
                ('announcement', 'announcement',
                 'Gets the current announcement '
                 'set by the bot owners.'),
                ('invite ?details', 'invite (details)',
                 'Generates an invite for '
                 'the bot. If "details" is included, this will include a '
                 'breakown of what each permission is used for.'),
                ('join', 'join', 'Joins the voice channel you are in.'),
                ('leave', 'leave', 'Leaves the voice channel you are in.')),
            shortcuts=Shortcuts(
                ('announcement', 'announcement', '', 'announcement', ''),
                ('invite', 'invite {}', '&', 'invite (details)', '(details)'),
                ('join', 'join', '', 'join', ''),
                ('leave', 'leave', '', 'leave', ''),
                ('stfu', 'leave', '', 'leave', '')),
            description='Essential bot commands that anybody can use.',
            group='base',
            function=base_wrapper))

    new_commands.append(
        Command(
            'mod',
            SubCommands(
                ('info', 'info', 'Gets server information.'),
                ('toggle ^', 'toggle <command>',
                 'Enables or disables a command. '
                 'NOTE: bot moderators can still use disabled commands.'),
                ('block ^', 'block <user>', 'Blocks the user from interacting '
                 'with the bot.'),
                ('unblock ^', 'unblock <user>', 'Unblocks the user from '
                 'interacting with the bot.'),
                ('clear', 'clear', 'Pushes chat upwards.'),
                ('mute &', 'mute (<channel>)',
                 'Mutes the given channel. If no '
                 'channel is specified, this mutes the bot for the server.'),
                ('unmute &', 'unmute (<channel>)',
                 'Unmutes the given channel. If '
                 'no channel is specified, this unmutes the bot for the server.'
                 ),
                ('invoker &', 'invoker (<custom invoker>)', 'Sets the custom '
                 'invoker for the server. If no invoker is specified, this clears '
                 'the custom invoker.'),
                ('mention', 'mention', 'Toggles mention mode. If enabled, the '
                 'bot will only respond to its name or mention as an invoker.'
                 )),
            shortcuts=Shortcuts(('clear', 'clear', '', 'clear', '')),
            description='Commands for server bot moderators.',
            elevated_level=1,
            no_selfbot=True,
            group='base',
            function=mod_wrapper))

    new_commands.append(
        Command(
            'owner',
            SubCommands(
                ('addmod ^', 'addmod <user>', 'Adds the user to the bot '
                 'moderators list. Use responsibly.'),
                ('removemod ^', 'removemod <user>',
                 'Removes the user from the '
                 'bot moderators list.'),
                ('feedback ^', 'feedback <message>',
                 'Sends a message to the bot '
                 'owners. NOTE: Your user ID will be sent as well. Please use '
                 'reasonably.'),
                ('notifications', 'notifications',
                 'Toggles notifications from '
                 'the bot regarding moderation events (such as muting channels '
                 'and blocking users from bot interaction).')),
            description='Commands for server owners.',
            elevated_level=2,
            no_selfbot=True,
            group='base',
            function=owner_wrapper))

    new_commands.append(
        Command(
            'botowner',
            SubCommands(
                ('halt', 'halt', 'Shuts down the bot.'),
                ('restart', 'restart', 'Restarts the bot.'),
                ('reload', 'reload', 'Reloads all external plugins.'),
                ('ip', 'ip', 'Gets the local IP address of the bot.'),
                ('backup', 'backup', 'Gets the data folder as a zip file.'),
                ('blacklist &', 'blacklist (<user id>)', 'Blacklist or '
                 'unblacklist a user from sending feedback. If no user ID is '
                 'specified, this lists all blacklisted entries.'),
                ('togglefeedback', 'togglefeedback', 'Enables or disables the '
                 'feedback command. Useful if pepole are trolling.'),
                ('announcement &', 'announcement (<text>)',
                 'Sets or clears the '
                 'announcement text.')),
            shortcuts=Shortcuts(('reload', 'reload', '', 'reload', '')),
            description='Commands for the bot owner.',
            elevated_level=3,
            group='base',
            function=botowner_wrapper))

    new_commands.append(
        Command(
            'debug',
            SubCommands(
                ('plugin list', 'plugin list', 'Lists added plugins.'),
                ('plugin:', 'plugin <plugin name>',
                 'Gets some basic information '
                 'about the given plugin.'),
                ('latency', 'latency', 'Calculates the ping time.'),
                ('resetlocals', 'resetlocals', 'Resets the debug locals.'),
                ('^', '<python>', 'Evaluates or executes the given code.')),
            description='Commands to help the bot owner debug stuff.',
            other='Be careful with these commands! They can break the bot.',
            elevated_level=3,
            group='base',
            function=debug_wrapper))

    new_commands.append(
        Command(
            'help',
            SubCommands(
                ('manual ?here ^', 'manual (here) <entry number>', 'Gets the '
                 'given manual entry. It is recommended to read through some of '
                 'the first few pages if you do not understand how the bot '
                 'works.'),
                ('manual ?here', 'manual (here)', 'Lists the available manual '
                 'entries.'),
                ('all ?here', 'all (here)', 'Shows all of the commands and '
                 'related help.'),
                ('?here :&', '(here) <base> (<topic>)', 'Gets the '
                 'help of the given command. If a topic index is provided, it '
                 'will get specific help regarding that command.'),
                ('?here', '(here)', 'Gets the general help text. '
                 'This will list all available commands to you.')),
            shortcuts=Shortcuts(('manual', 'manual {}', '&',
                                 'manual (<arguments>)', '(<arguments>)')),
            description='Command help and usage manuals.',
            other=('For all of these commands, if the \'here\' option is '
                   'specified, a direct message will not be sent.'),
            group='base',
            function=help_wrapper))

    return new_commands
예제 #17
0
def get_commands(bot):

    return [
        Command(
            'pride',
            subcommands=[
                SubCommand(Opt('flags'),
                           doc='Shows which pride flags are available.',
                           function=pride_flags),
                SubCommand(
                    Opt('analyze'),
                    Arg('user or URL',
                        argtype=ArgTypes.MERGED_OPTIONAL,
                        group='user or image'),
                    Attachment('Image', optional=True, group='user or image'),
                    doc='Analyzes an image or profile picture of the given user '
                    'to show pride flag coverage.',
                    function=pride_analyze),
                SubCommand(
                    Opt('overlay'),
                    Opt('opacity',
                        attached='percentage',
                        optional=True,
                        default="50%",
                        convert=utilities.PercentageConverter(),
                        always_include=True,
                        group='style',
                        quotes_recommended=False,
                        check=lambda b, m, v, *a: 0.1 <= v <= 1.0,
                        check_error=
                        'Overlay opacity must be between 10% and 100% inclusive.'
                        ),
                    Opt('mask',
                        optional=True,
                        group='style',
                        doc=
                        'Composites the pride flag and the opaque pixels in the given image.'
                        ),
                    Opt('rotation',
                        attached='angle',
                        optional=True,
                        group='style',
                        always_include=True,
                        default=0,
                        quotes_recommended=False,
                        convert=int,
                        check=lambda b, m, v, *a: 0 <= v <= 360,
                        check_error=
                        'Rotation angle must be between 0 and 360 inclusive.'),
                    Arg('flag type', convert=FlagConverter()),
                    Arg('user or URL',
                        argtype=ArgTypes.MERGED_OPTIONAL,
                        group='user or image'),
                    Attachment('Image', optional=True, group='user or image'),
                    doc=
                    'Overlays a semi-transparent pride flag over the given image.',
                    function=pride_overlay),
                SubCommand(
                    Opt('circle'),
                    Opt('size',
                        attached='level',
                        optional=True,
                        default=1,
                        group='style',
                        quotes_recommended=False,
                        convert=int,
                        always_include=True,
                        check=lambda b, m, v, *a: 1 <= v <= 3,
                        check_error=
                        'Circle size level must be between 1 and 3 inclusive.',
                        doc=
                        'Thickness of the circle between 1 and 3 inclusive (defaults to 1).'
                        ),
                    Opt('resize',
                        optional=True,
                        group='style',
                        doc=
                        'Resizes the image so that the vertical and horizontal extremes '
                        'are not cut off by the drawn circle.'),
                    Opt('full',
                        optional=True,
                        group='style',
                        doc=
                        'Fills in any transparency of the given image with the pride flag.'
                        ),
                    Opt('rotation',
                        attached='angle',
                        optional=True,
                        group='style',
                        always_include=True,
                        default=0,
                        quotes_recommended=False,
                        convert=int,
                        check=lambda b, m, v, *a: 0 <= v <= 360,
                        check_error=
                        'Rotation angle must be between 0 and 360 inclusive.'),
                    Arg('flag type', convert=FlagConverter()),
                    Arg('user or URL',
                        argtype=ArgTypes.MERGED_OPTIONAL,
                        group='user or image'),
                    Attachment('Image', optional=True, group='user or image'),
                    doc='Draws a pride flag circle around the given image.',
                    function=pride_circle),
                SubCommand(
                    Opt('fill'),
                    Opt('rotation',
                        attached='angle',
                        optional=True,
                        always_include=True,
                        default=0,
                        quotes_recommended=False,
                        convert=int,
                        check=lambda b, m, v, *a: 0 <= v <= 360,
                        check_error=
                        'Rotation angle must be between 0 and 360 inclusive.'),
                    Arg('flag type', convert=FlagConverter()),
                    Arg('user or URL',
                        argtype=ArgTypes.MERGED_OPTIONAL,
                        group='user or image'),
                    Attachment('Image', optional=True, group='user or image'),
                    doc=
                    'Fills in the background of the given image with the pride flag',
                    function=pride_fill),
                SubCommand(Arg('user or URL',
                               argtype=ArgTypes.MERGED_OPTIONAL,
                               group='user or image'),
                           Attachment('Image',
                                      optional=True,
                                      group='user or image'),
                           doc='Interactive pride flag image generator.',
                           function=pride_interactive)
            ],
            description='Add pride flair to images.',
            allow_direct=True,
            category='tools')
    ]
예제 #18
0
def get_commands(bot):
    return [Command('ude', elevated_level=3, hidden=True)]
예제 #19
0
def get_commands(bot):
    new_commands = []

    new_commands.append(
        Command(
            'random',
            subcommands=[
                SubCommand(doc='Gets a random float value [0.0-1.0)',
                           function=get_random_float),
                SubCommand(
                    Opt('roll'),
                    Arg('specifier',
                        argtype=ArgTypes.MERGED_OPTIONAL,
                        default='d6',
                        convert=RollConverter()),
                    doc=
                    'Rolls a die based on the specifier following the D&D dice '
                    'rolling syntax (*x*d*y* + *z*). If no specifier is given, '
                    'this rolls a regular 6-sided die.',
                    function=get_roll),
                SubCommand(
                    Opt('pick'),
                    Arg('option',
                        additional='more options',
                        argtype=ArgTypes.SPLIT),
                    doc=
                    'Picks an option. Items must be wrapped in quotes if they '
                    'have spaces in them.',
                    function=get_pick),
                SubCommand(
                    Opt('number'),
                    Arg('bounds',
                        argtype=ArgTypes.MERGED_OPTIONAL,
                        default='1 100',
                        convert=BoundsConverter()),
                    doc=
                    'Gets a random number from 1 to 100, or from the given bounds.',
                    function=get_number),
                SubCommand(
                    Opt('flip'),
                    Arg('times',
                        argtype=ArgTypes.OPTIONAL,
                        quotes_recommended=False,
                        convert=int,
                        check=lambda b, m, v, *a: 1 <= v <= 100,
                        default='1',
                        check_error='Must be between 1 and 100 inclusive.'),
                    doc='Flips a virtual coin.',
                    function=get_flip)
            ],
            shortcuts=[
                Shortcut('roll', 'roll {specifier}',
                         Arg('specifier', argtype=ArgTypes.MERGED_OPTIONAL)),
                Shortcut('pick', 'pick {arguments}',
                         Arg('arguments', argtype=ArgTypes.MERGED)),
                Shortcut('flip', 'flip {times}',
                         Arg('times', argtype=ArgTypes.MERGED_OPTIONAL))
            ],
            description='Get random stuff.',
            category='tools'))

    return new_commands
예제 #20
0
def get_commands(bot):
    return [Command('convertdata')]
예제 #21
0
def get_commands(bot):
    """Returns a list of commands associated with this plugin."""
    new_commands = []

    return [
        Command(
            'txyz',
            subcommands=[
                SubCommand(Opt('cycle'),
                           Arg('type',
                               convert=TXYZTypeConverter(),
                               quotes_recommended=False),
                           function=cycle),
                SubCommand(
                    Opt('add'),
                    Arg('type',
                        convert=TXYZTypeConverter(),
                        quotes_recommended=False),
                    Arg('text',
                        argtype=ArgTypes.MERGED,
                        check=lambda b, m, v, *a: 1 <= len(v) <= 99,
                        check_error=
                        "Text must be between 2 and 100 characters long."),
                    function=add_text),
                SubCommand(Opt('remove'),
                           Arg('type',
                               convert=TXYZTypeConverter(),
                               quotes_recommended=False),
                           Arg('id', convert=int, quotes_recommended=False),
                           function=remove_text),
                SubCommand(Opt('list'), function=list_text),
                SubCommand(Opt('live'),
                           Opt('disable'),
                           doc='Disables the live page.',
                           function=live_disable),
                SubCommand(
                    Opt('live'),
                    Opt('invisible', optional=True),
                    Opt('fullscreen',
                        attached='value',
                        optional=True,
                        convert=int,
                        check=lambda b, m, v, *a: 0 <= v <= 2,
                        default=0,
                        always_include=True,
                        quotes_recommended=False,
                        doc=
                        '0: Default, 1: Hides nav bar, 2: Viewport fullscreen.'
                        ),
                    Opt('theme',
                        attached='value',
                        optional=True,
                        convert=int,
                        check=lambda b, m, v, *a: 0 <= v <= 4,
                        default=0,
                        always_include=True,
                        quotes_recommended=False,
                        doc=
                        '0: Default, 1: Auto, 2: Light, 3: Dark, 4: Migraine.'
                        ),
                    Opt('weather',
                        attached='value',
                        optional=True,
                        convert=int,
                        check=lambda b, m, v, *a: 0 <= v <= 4,
                        default=0,
                        always_include=True,
                        quotes_recommended=False,
                        doc='0: Default, 1: Clear, 2: Rain, 3: Storm, 4: Snow.'
                        ),
                    Opt('audio',
                        attached='value',
                        optional=True,
                        convert=int,
                        check=lambda b, m, v, *a: 0 <= v <= 2,
                        default=0,
                        always_include=True,
                        quotes_recommended=False,
                        doc='0: Default, 1: Silence, 2: Rain.'),
                    Attachment('HTML', doc='HTML file to show.'),
                    function=live_enable)
            ],
            elevated_level=3,
            hidden=True,
            category='tools')
    ]
예제 #22
0
def get_commands(bot):
    """Returns a list of commands associated with this plugin."""
    new_commands = []

    new_commands.append(
        Command(
            'mycommand',
            subcommands=[
                SubCommand(
                    Opt('myoption'),
                    doc=
                    'This is a simple command with a single required option.'),
                SubCommand(
                    Opt('custom', optional=True),
                    Opt('attached',
                        optional=True,
                        attached='attached argument'),
                    doc=
                    'This has two different optional options, one without an attached '
                    'parameter, and the other requiring an attached parameter.'
                ),
                SubCommand(
                    Opt('trailing'),
                    Arg('arg 1'),
                    Arg('arg 2'),
                    Arg('arg 3',
                        argtype=ArgTypes.SPLIT,
                        additional='more args'),
                    doc='This command requires a lot of trailing arguments.'),
                SubCommand(
                    Opt('grouped'),
                    Arg('grouped arguments', argtype=ArgTypes.MERGED),
                    doc=
                    'This will group all given arguments as a single string.'),
                SubCommand(
                    Opt('complex', attached='attached'),
                    Opt('other', optional=True, attached='also required'),
                    Arg('arg 1'),
                    Arg('arg 2',
                        argtype=ArgTypes.SPLIT_OPTIONAL,
                        additional='more args'),
                    doc=
                    'The complex option has a required attached parameter, and the '
                    '\'other\' option also has a required attached parameter if '
                    '\'other\' is included. Additionally, there will be a requirement '
                    'of at least 1 trailing argument.'),
                SubCommand(
                    Opt('marquee'),
                    Arg('text',
                        argtype=ArgTypes.MERGED,
                        check=lambda b, m, v, *a: len(v) <= 100,
                        check_error=
                        "Marquee message must be less than 100 characters long."
                        ),
                    doc='Creates a marquee that loops 3 times.')
            ],
            shortcuts=[
                Shortcut('complex',
                         'complex {attached} other {other} {arg 1} {arg 2}',
                         Arg('attached'), Arg('other'), Arg('arg 1'),
                         Arg('arg 2', argtype=ArgTypes.SPLIT_OPTIONAL)),
                Shortcut('marquee', 'marquee {text}',
                         Arg('text', argtype=ArgTypes.MERGED))
            ],
            description='Your command description here.',
            other='This text is optional - it just shows up after everything '
            'else. Quick note, all of the commands here can only be used by '
            'bot moderators or above, as indicated by elevated_level. A '
            'level of 2 would mean only server owners or above can use the '
            'command, and a level of 3 would restrict the command to only '
            'the bot owners.',
            elevated_level=1,
            category='demo'))

    new_commands.append(
        Command(
            'myothercommand',
            subcommands=[
                SubCommand(
                    Arg('text', argtype=ArgTypes.MERGED_OPTIONAL),
                    doc='This traps all further commands from being executed.'
                ),
                SubCommand(
                    Opt('order'),
                    Opt('matters'),
                    doc=
                    'It is impossible to access this command because the first '
                    'subcommand will always be satisfied first. Order of the '
                    'subcommand matters!'),
                SubCommand(
                    Opt('sample'),
                    Opt('foo'),
                    Opt('bar'),
                    doc=
                    'Also impossible to access. This subcommand just adds some '
                    'keywords to the command.')
            ],
            description='Only bot owners can see this text!',
            other=
            'Note that no shortcuts were defined. They, too, are optional. '
            'Also, this command is hidden, which means that only the bot '
            'owners can see this command listed from the help command. '
            'However, unless the command is configured with an elevated '
            'permissions level, any user can still execute the command. '
            'Users still will not be able to see the specific help for this '
            'command, though. Lastly, this command is disabled in DMs.',
            hidden=True,
            allow_direct=False,
            category='demo'))

    new_commands.append(
        Command(
            'notify',
            subcommands=[
                SubCommand(Arg('text', argtype=ArgTypes.MERGED),
                           doc='Notify the owners with some text!')
            ],
            other='This command uses a custom function. It is called with the '
            'same arguments as get_response. The command will show up to '
            'all users in the help command, but can only be used by server '
            'owners, as it is disallowed in direct messages.',
            elevated_level=2,
            allow_direct=False,
            function=custom_notify,
            category='demo'))

    new_commands.append(
        Command('wait',
                other='Use this command to demo the wait_for functionality',
                category='demo'))

    return new_commands