aboutsummaryrefslogtreecommitdiff
path: root/discord/ext
Commit message (Collapse)AuthorAgeFilesLines
* Try to consistently use "inherit" vs "derive" in documentation.Rapptz2019-03-194-14/+14
|
* [commands] Redesign extension exception flow.Rapptz2019-03-192-21/+115
| | | | | | | | | | | | | | | | Instead of raising a whole variety of exceptions, they are now wrapped into ExtensionError derived classes. * ExtensionAlreadyLoaded * Raised when an extension is already loaded in Bot.load_extension * ExtensionNotLoaded * Raised when an extension is not loaded, e.g. Bot.unload_extension * NoEntryPointError * Raised when an extension does not have a `setup` function. * ExtensionFailed * Raised when an extension's `setup` function fails. * ExtensionNotFound * Raised when an extension's module import fails.
* [commands] Add Bot.reload_extension for atomic loading.Rapptz2019-03-191-43/+106
| | | | Also do atomic loading in Bot.load_extension
* [commands] ColourConverter raises if value is out of rangeJoshua B2019-03-191-0/+2
| | | | | changes make the `ext.commands.ColourConverter` Converter fail when user input is outside the acceptable value range 0x000000 - 0xFFFFFF
* Expose MetadataNCPlayz2019-03-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added access to: * `/users/@me/guilds` * `/guilds/{guild_id}` * `/guilds/{guild_id}/members/{member_id}` BREAKING CHANGE: * `get_user_info` -> `fetch_user_info` to match naming scheme. Remove useless note Remove `reverse` and corresponding documentation Update documentation to reflect #1988 Rename `get_` HTTP functions to `fetch_` Breaking Changes: * `get_message` -> `fetch_message` * `get_invite` -> `fetch_invite` * `get_user_profile` -> `fetch_user_profile` * `get_webhook_info` -> `fetch_webhook` * `get_ban` -> `fetch_ban` Fix InviteConverter, update migrating.rst Rename get_message to fetch_message
* Organise documentationNCPlayz2019-03-196-43/+38
|
* [commands] Walk through MRO for Cog derived classes.Rapptz2019-03-171-23/+37
| | | | | | | This should support cog subclasses in a relatively consistent way in terms of expectations. Hopefully nothing is broken. Fixes #1950
* [commands] Make Bot.cogs and Bot.extensions read-only mappings.Rapptz2019-03-171-12/+23
| | | | | This also has the side effect of effectively documenting them for public use.
* Fix pagination of huge command help messages (> ~2,000 chars)slice2019-03-161-2/+12
| | | | | | | | | | Previously, calls to add_line in add_command_formatting of default help commands would fail if the command's help message would overflow the current page. This would also result in silent failure as the RuntimeError raised from add_line is never caught. This patch adds behavior that adds lines individually should it raise, which guarantees safe pagination as long as every line is smaller than the maximum page size, which is highly unlikely.
* Fix documentation linking issue in Messageables and ContextRapptz2019-03-161-5/+5
|
* [commands] Rename it to Context.send_help for consistency.Rapptz2019-03-161-2/+2
|
* [commands] Add Context.show_help helper to use the HelpCommand set.Rapptz2019-03-161-0/+67
| | | | Fixes #1983
* [commands] Optimise GroupMixin.get_command for the no space case.Rapptz2019-03-161-0/+4
| | | | Comes at a 30ns slowdown for the space case, however.
* [commands] Assign context inside HelpCommand.prepare_help_commandRapptz2019-03-161-3/+9
|
* [commands] Add HelpCommand.get_bot_mapping helper.Rapptz2019-03-161-5/+11
|
* [commands] Return result of send_group_help and send_command_helpRapptz2019-03-161-2/+2
|
* Change superclass to subclass in some documentationKaeptm Blaubaer2019-03-162-5/+5
|
* [commands] Add back dm_help tribool for the provided HelpCommandsRapptz2019-03-161-0/+42
| | | | Also add a dm_help_threshold integer to control the length.
* [commands] Add commands.Paginator.__len__Rapptz2019-03-161-0/+10
|
* [commands] Redesign HelpFormatter into HelpCommandRapptz2019-03-155-476/+1189
| | | | Part of #1938
* [commands] Add Cog.description to get the clean docstring.Rapptz2019-03-141-0/+9
|
* [commands] Add Cog.qualified_name to query the specified cog name.Rapptz2019-03-131-0/+5
|
* [commands] Properly handle typing.Optional as last positional parameterHarmon2019-03-131-0/+2
|
* [commands] Support staticmethod listeners and disallow them in commandsRapptz2019-03-121-5/+18
|
* [commands] Refactor quoted_word free function to a StringView method.Rapptz2019-03-122-88/+85
| | | | | Technically a breaking change, however this interface was not documented or guaranteed to exist.
* [commands] Separate view parsing errors from BadArgument.Rapptz2019-03-122-6/+60
| | | | | | | | This causes them to be raised from a new exception named ArgumentParsingError with 3 children for ease with i18n. This is technically a breaking change since it no longer derives from BadArgument, though catching UserInputError will prevent this change from affecting the user.
* Small inconsistency in documentationSkyweb2019-03-081-1/+1
| | | :)
* [commands] Allow passing of typing.Union into Greedy. Fix #1951Rapptz2019-03-031-1/+1
|
* Fix Signature for Greedy/Optional convertersMyst(MysterialPy)2019-03-021-1/+22
| | | | Change Greedy to `[a]...` | `[a=1]...`
* [commands] Fix name clash overwriting T.__class__.__name__Rapptz2019-02-281-2/+2
| | | | Fixes #1944
* [commands] Allow Converter instances in Greedy. Fix #1939.Rapptz2019-02-271-2/+2
|
* [commands] Error out when someone passes plain Cog.listener decorator.Rapptz2019-02-271-1/+5
| | | | Should make this error easier to catch rather than silent failure.
* [commands] Add support for stacking Cog.listener decorator.Rapptz2019-02-271-2/+7
| | | | Fix #1926
* [commands] Fix special method detection for regular function objects.Rapptz2019-02-241-3/+12
| | | | Fixes #1920
* [commands] Remove Bot.get_cog_commandsRapptz2019-02-231-25/+0
|
* [commands] Fix bug in behaviour in the cog inspection methods.Rapptz2019-02-231-5/+10
|
* Update copyright years.Rapptz2019-02-232-2/+2
|
* [commands] Update stale parent references in subcommands.Rapptz2019-02-231-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug was kind of a long one to figure out, as per #1918 documents the issue had to do with subcommands but the actual adventure in finding this one was a long one. The first problem was that Command.cog was for some reason None, which indicated that a copy was happening somewhere along the way. After some fiddling I discovered that due to the copies of `Cog.__cog_commands__` the groups pointed to out-dated versions that got overriden by the new copies. The first attempt at fixing this was straightforward -- just remove the subcommand from the parent and replace it with the newer reference that we just received. However, this ended up not working due to a strange mystery where the subcommand being invoked was neither the original copy nor the new copy residing in `Cog.__cog_commands__`. Some more investigation later pointed out to me that a copy occurs during the `Group.copy` stage which calls `Command.copy` for all its subcommands. After spotting this out I had realised where the discrepancy comes from. As it turns out, the subcommand copy that was being invoked was actually a stale one created from `Group.copy`. The question remained, how come that one was being called? The problem stemmed from the fact that when the subcommand was copied, the parent reference pointed to the old parent. Since the old parent was the one that was getting the new reference, it went practically untouched. This is because the calling code fetches the child from the parent and the old parent is nowhere in the call chain. To fix this issue we needed to update the parent reference, and in order to do that a temporary lookup table is required pointing to the latest copies that we have made. Thus ends a 3.5 hour bug hunting adventure.
* [commands] Fix issue with decorator order with checks and cooldownsRapptz2019-02-232-0/+9
| | | | Now they're just explicitly copied.
* [commands] Fix bug with cog bot check once not being unloaded properly.Rapptz2019-02-231-1/+1
|
* [commands] Fix attribute access in cogs to commands.Rapptz2019-02-231-0/+4
| | | | | Previously they were outdated copies, this updates the copies to the ones that are actually injected.
* [commands] Fix bug with local checks and cooldowns not applying.Rapptz2019-02-231-2/+0
|
* [commands] Copy on_error handlers in Command.copyRapptz2019-02-231-0/+4
| | | | This fixes the issue of error handlers not applying.
* [commands] Pass over kwargs to `type.__new__`Rapptz2019-02-231-1/+1
|
* Rework entire cog system and partially document it and extensions.Rapptz2019-02-237-158/+500
|
* [commands] Fix up wording on HelpFormatter.get_ending_noteRapptz2019-02-181-1/+1
|
* [commands] add document comment to HelpFormatter.get_ending_notecod2019-02-191-0/+1
|
* [commands] Add more i18n properties for HelpFormattercod2019-02-141-3/+12
| | | | | | removed fixed strings "Commands:" and help page ending note. and added properties modify these strings. default behavior is not changed. fix #1886
* [commands] Fix ext.commands help page full-width indentationcod2019-02-061-3/+4
| | | | | add _string_width function to util. Changed string width calculate function from len() to util function _string_width().
* Clarified add_listener documentationSkyweb2019-02-061-2/+2
|