Commit Graph

171 Commits

Author SHA1 Message Date
b44bba6ee6 First pass at documentation reform. 2017-05-12 20:14:34 -04:00
d7478425ca [commands] Converter.convert is always a coroutine.
Along with this change comes with the removal of Converter.prepare and
adding two arguments to Converter.convert, the context and the argument.

I suppose an added benefit is that you don't have to do attribute
access since it's a local variable.
2017-05-10 21:30:41 -04:00
8ef984746a [commands] Fix default error handler to work with the switch. 2017-05-10 19:36:46 -04:00
a2c9cefac9 [commands] Re-order error handler arguments.
They now have Context as the first argument to be consistent with other
context-passing functions.
2017-05-10 17:49:42 -04:00
c20ba51e28 [commands] Export is_nsfw check. 2017-05-05 20:21:28 -04:00
c8937ed2aa [commands] Add is_nsfw check. 2017-05-01 22:36:22 -04:00
37681dd0ea [commands] Fix lack of space in when_mentioned 2017-04-24 00:23:23 -04:00
6188397fc9 [commands] Add Context.voice_client shortcut. 2017-04-24 00:17:04 -04:00
c005ef5d44 [commands] Make when_mentioned always have both mention formats.
This will allow it to work in mobile clients which don't respect the
<@!id> format in case of nicknames.
2017-04-24 00:13:27 -04:00
b6ac856868 [commands] Allow loading cogs from folders.
Internally, instead of using module objects just use the `__module__`
attribute which is the same thing. From preliminary testing this seems
to work fine with both regular one-file-per-cog approaches and the
folder cog approach.

Fixes #126.
2017-04-21 18:57:28 -04:00
3e15f46dcf [commands] Bot.get_all_emojis no longer exists. 2017-04-12 05:00:50 -04:00
7da0884bfb [commands] Export missing built-in converters. 2017-04-12 04:46:53 -04:00
e1c32626ba [commands] Fix User converter not working with IDs. 2017-03-27 20:08:26 -04:00
5c5e7ae1d6 [commands] Add is_owner check and Bot.is_owner. 2017-03-27 06:55:21 -04:00
afb64fb5e3 [commands] Remove Command.no_pm for commands.guild_only check.
This is a breaking change. The original purpose of no_pm has been
mainly a legacy aspect. They came from a time before checks were a
generalised concept and were never removed. A check is the proper way
to do its behaviour.
2017-03-26 21:41:34 -04:00
9885a946e1 More robust cleanup for Client.run.
This should prevent asyncio.CancelledError from being propagated more
and suppressed "Task was destroyed but was pending!" warnings when
doing graceful closes outside of using a KeyboardInterrupt.

To make clean up a bit more robust, also add signal handlers
for POSIX systems.
2017-03-24 20:27:30 -04:00
31a7093433 [commands] Fix minor spacing issue in Command.signature 2017-03-21 15:36:52 -04:00
3087600c8d [commands] Add Command.signature
This replaces HelpFormatter.get_command_signature for the most part.
2017-03-21 00:46:13 -04:00
54fdafb792 [commands] Add BotBase.get_cog_commands to get all a cog's commands.
Self-explanatory. This should help create help commands for a cog
more easily.
2017-03-21 00:46:12 -04:00
fe588a4d52 [commands] Change GroupMixin.commands to all_commands
This is a breaking change as GroupMixin.commands now returns a set
of unique Command objects.
2017-03-21 00:46:12 -04:00
98cfb53d3b [commands] Add Context.me property. 2017-03-01 18:58:56 -05:00
9cb89f019e [commands] Register cog listeners with the name of the attribute. 2017-02-22 20:11:01 -05:00
c6d26216a6 [commands] Fix bad logic in command list filtering. 2017-02-18 02:39:03 -05:00
6166cbc2e7 [commands] Add commands.clean_content converter. 2017-02-13 22:15:39 -05:00
e10cae5dbc [commands] Allow converters to be instantiated.
This allows for you to create converters that can have varying
behaviour using the converter's __init__ instead of having to do a
meta-class based approach to get around the fact that __init__ is part
of the interface.

To make up for the lack of __init__, a new method Converter.prepare was
added to do the work that __init__ used to do.
2017-02-13 21:05:25 -05:00
b6bff5172a [commands] Remove Commands: if no commands can be run in help command. 2017-02-13 04:27:31 -05:00
bf11bb4b4f [commands] Add cog local error handlers via __error. 2017-02-12 15:48:18 -05:00
7bc3750c27 [commands] Add param attribute to MissingRequiredArgument
This should allow easier querying on what argument is missing.

Fixes #470.
2017-02-12 13:53:49 -05:00
47ef657fbd Implement async checks. Fixes #380. 2017-02-12 12:13:23 -05:00
84dfd7b3e3 [commands] Add Command.usage argument to override argument display. 2017-02-10 03:35:25 -05:00
f8d19ae7ba [commands] Better support for retrieving children commands.
* GroupMixin.get_command now supports fully qualified names
* Add GroupMixin.walk_commands to get an iterator of all commands.
2017-02-06 21:04:33 -05:00
aac769eb56 [commands] Fix converters returning the wrong types when an ID is passed 2017-01-31 04:57:13 -05:00
1c49374210 [commands] Implement before and after invoke command hooks.
Fixes #464.
2017-01-27 18:53:21 -05:00
8fa50a8f3e [commands] Add Context.command_failed attribute. 2017-01-27 17:14:22 -05:00
12c1cd9b14 [commands] Add cog local checks via __local_check 2017-01-26 05:49:24 -05:00
0e1bd1647e [commands] Rename __check to __global_check for cogs. 2017-01-26 05:31:11 -05:00
4016154529 [commands] Allow customising the Context class in get_context. 2017-01-26 05:05:15 -05:00
234fd5180f Optimise attribute access when dispatching. 2017-01-25 05:31:53 -05:00
ff9f5749e1 Update copyright year to 2017. 2017-01-20 23:19:19 -05:00
ea72d5e63d [commands] Guarantee that local error handler is called before generic. 2017-01-15 21:55:50 -05:00
11b54d67c9 [commands] Change UserConverter to actually work with User, not Member. 2017-01-14 22:15:02 -05:00
92dd519b1a Remove _get_guild_id from Messageable ABC. 2017-01-14 19:22:26 -05:00
ce9d5b4f4a [commands] Split process_commands into lower level bits. 2017-01-14 19:17:08 -05:00
695b62ccd3 [commands] Make Command a descriptor for #426. 2017-01-13 20:34:00 -05:00
d22d8cc430 [commands] Add AutoShardedBot counterpart to AutoShardedClient. 2017-01-08 04:50:59 -05:00
3f06cf9e81 [commands] Don't use removed is_private attribute in core decorators. 2017-01-03 20:17:58 -05:00
496f5d0472 [commands] Fix help command from not working with recent changes. 2017-01-03 09:52:12 -05:00
7431a127cf Change Messageable channel getter to be a coroutine. 2017-01-03 09:52:11 -05:00
d5b616fa11 Rename MessageChannel abc to Messageable. 2017-01-03 09:52:09 -05:00
20ddc9f14f [commands] Remove send_ utility functions. 2017-01-03 09:52:04 -05:00