Commit Graph
413 Commits
Author SHA1 Message Date
Rapptz 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
Rapptz 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
Rapptz 3e15f46dcf [commands] Bot.get_all_emojis no longer exists. 2017-04-12 05:00:50 -04:00
Rapptz 7da0884bfb [commands] Export missing built-in converters. 2017-04-12 04:46:53 -04:00
Rapptz e1c32626ba [commands] Fix User converter not working with IDs. 2017-03-27 20:08:26 -04:00
Rapptz 5c5e7ae1d6 [commands] Add is_owner check and Bot.is_owner. 2017-03-27 06:55:21 -04:00
Rapptz 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
Rapptz 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
Rapptz 31a7093433 [commands] Fix minor spacing issue in Command.signature 2017-03-21 15:36:52 -04:00
Rapptz 3087600c8d [commands] Add Command.signature
This replaces HelpFormatter.get_command_signature for the most part.
2017-03-21 00:46:13 -04:00
Rapptz 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
Rapptz 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
Rapptz 98cfb53d3b [commands] Add Context.me property. 2017-03-01 18:58:56 -05:00
Rapptz 9cb89f019e [commands] Register cog listeners with the name of the attribute. 2017-02-22 20:11:01 -05:00
Rapptz c6d26216a6 [commands] Fix bad logic in command list filtering. 2017-02-18 02:39:03 -05:00
Rapptz 6166cbc2e7 [commands] Add commands.clean_content converter. 2017-02-13 22:15:39 -05:00
Rapptz 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
Rapptz b6bff5172a [commands] Remove Commands: if no commands can be run in help command. 2017-02-13 04:27:31 -05:00
Rapptz bf11bb4b4f [commands] Add cog local error handlers via __error. 2017-02-12 15:48:18 -05:00
Rapptz 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
Rapptz 47ef657fbd Implement async checks. Fixes #380. 2017-02-12 12:13:23 -05:00
Michael Van BurenandRapptz 84dfd7b3e3 [commands] Add Command.usage argument to override argument display. 2017-02-10 03:35:25 -05:00
Rapptz 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
Rapptz aac769eb56 [commands] Fix converters returning the wrong types when an ID is passed 2017-01-31 04:57:13 -05:00
Rapptz 1c49374210 [commands] Implement before and after invoke command hooks.
Fixes #464.
2017-01-27 18:53:21 -05:00
Rapptz 8fa50a8f3e [commands] Add Context.command_failed attribute. 2017-01-27 17:14:22 -05:00
Rapptz 12c1cd9b14 [commands] Add cog local checks via __local_check 2017-01-26 05:49:24 -05:00
Rapptz 0e1bd1647e [commands] Rename __check to __global_check for cogs. 2017-01-26 05:31:11 -05:00
Rapptz 4016154529 [commands] Allow customising the Context class in get_context. 2017-01-26 05:05:15 -05:00
Rapptz 234fd5180f Optimise attribute access when dispatching. 2017-01-25 05:31:53 -05:00
Rapptz ff9f5749e1 Update copyright year to 2017. 2017-01-20 23:19:19 -05:00
Rapptz ea72d5e63d [commands] Guarantee that local error handler is called before generic. 2017-01-15 21:55:50 -05:00
Rapptz 11b54d67c9 [commands] Change UserConverter to actually work with User, not Member. 2017-01-14 22:15:02 -05:00
Rapptz 92dd519b1a Remove _get_guild_id from Messageable ABC. 2017-01-14 19:22:26 -05:00
Rapptz ce9d5b4f4a [commands] Split process_commands into lower level bits. 2017-01-14 19:17:08 -05:00
Rapptz 695b62ccd3 [commands] Make Command a descriptor for #426. 2017-01-13 20:34:00 -05:00
Rapptz d22d8cc430 [commands] Add AutoShardedBot counterpart to AutoShardedClient. 2017-01-08 04:50:59 -05:00
Rapptz 3f06cf9e81 [commands] Don't use removed is_private attribute in core decorators. 2017-01-03 20:17:58 -05:00
Rapptz 496f5d0472 [commands] Fix help command from not working with recent changes. 2017-01-03 09:52:12 -05:00
Rapptz 7431a127cf Change Messageable channel getter to be a coroutine. 2017-01-03 09:52:11 -05:00
Rapptz d5b616fa11 Rename MessageChannel abc to Messageable. 2017-01-03 09:52:09 -05:00
Rapptz 20ddc9f14f [commands] Remove send_ utility functions. 2017-01-03 09:52:04 -05:00
Rapptz 406984af2e [commands] First pass in making commands ext work again. 2017-01-03 09:52:03 -05:00
Rapptz d1d54a468a Rename Server to Guild everywhere. 2017-01-03 09:51:54 -05:00
Rapptz 20251c54a7 [commands] Bot skip check now works with the new __eq__ changes. 2017-01-03 09:51:51 -05:00
Rapptz e4b16851bf Slots use tuples instead now. 2017-01-03 09:51:50 -05:00
Rapptz 45c729b167 Switch IDs to use int instead of str 2017-01-03 09:51:49 -05:00
PapyrusThePlantandRapptz 31cd9ad37a [commands] Bugfix on the teardown function call. 2017-01-01 01:49:10 -05:00
Rapptz bed2e90e82 Properly propagate loop. Fixes #420. 2016-12-21 00:06:19 -05:00
Rapptz 00e30f3106 [commands] Shield against dictionary resize in Bot.close 2016-12-17 21:18:48 -05:00