aboutsummaryrefslogtreecommitdiff
path: root/discord/ext
Commit message (Collapse)AuthorAgeFilesLines
* [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
|
* commands.clean_content: escape || spoilers ||Benjamin Mintz2019-02-061-1/+1
|
* Bumped copyright years to 2019.Dante Dam2019-01-289-9/+9
|
* Do None instead of falsy checks on Command attributesDevon R2019-01-281-3/+3
|
* Change Greedy behaviour slightly during conversion errors.MusicOnline2019-01-281-7/+3
| | | | | Make Greedy swallow conversion errors and return the default if there are no convertible args
* [commands] Remove message being required from Role/Member converters.Dice2018-12-141-3/+2
| | | | | | This allows for easier "mock" context objects, for those who use converters as utility functions outside of commands, and it's more straightforward with the rest of the file.
* [commands] Add support for IDs in the role related checks.Xua2018-11-241-17/+25
| | | | | | | | | This affects: * commands.has_role * commands.has_any_role * commands.bot_has_role * commands.bot_has_any_role
* Add channel category cooldown bucket typeDice2018-11-242-5/+9
|
* bot.unload_extension: also allow events with no modulebmintz2018-11-241-6/+4
| | | | | | | | | | It turns out that events created in an eval command also cause the issue described in #1506. Ensure that events we remove are part of a module as well. Also performs minor comment maintenance ("x", "first y", "then z") -> ("x", "y", "z")
* [lint] Fix import orderHornwitser2018-11-243-4/+7
| | | | | Reorder imports to be consistenly grouped by standard library, third party library, and local modules in that order thoughout the library.
* [commands] Remove duplicated quote entriesHornwitser2018-11-241-2/+0
| | | | | Remove two duplicated entries from the quote mapping in commands.view. These were introduced at the creation of this mapping in ea061ef.
* [lint] Remove redundant paranthesisHornwitser2018-11-243-9/+9
| | | | | Remove redundant parenthisis around await expressions. Left over from f25091ef.
* [lint] Rename exception variables to excHornwitser2018-11-243-14/+14
| | | | | Use the more explicit (and common) exc instead of e as the variable holding the exception in except handlers.
* [lint] Remove redundant exception variablesHornwitser2018-11-241-5/+5
| | | | | | Use bare raise statement when reraising the exception that occured, and remove unused exception variables. Also remove a pointless exception handler in discord.opus.
* [lint] Limit unneccessarily broad except clausesHornwitser2018-11-242-4/+4
| | | | Add exception qualifier(s) to bare except clauses swallowing exceptions.
* Revert "Rework documentation to not duplicate inherited members."Rapptz2018-10-111-3/+1
| | | | This reverts commit 96981210b3415e15446db0b702b07fef25c8b680.
* [commands] Add call_once keyword-only parameter for Bot.remove_checkRapptz2018-10-111-7/+8
| | | | | Technically a breaking change. This is to be a parallel with the Bot.add_check interface.
* Rework documentation to not duplicate inherited members.Rapptz2018-10-031-1/+3
| | | | This will probably be reverted in 1 week.
* [commands] Fix NameError in clean_content converterRapptz2018-09-251-1/+1
|
* Change internal role storage in Guild to a dict instead of a list.Rapptz2018-09-241-4/+7
| | | | | | | | | | | | | | | | This adds the following APIs: * Guild.get_role This removes the following APIs: * Guild.role_hierarchy To compensate for the removed APIs, Guild.roles is now a sorted list based on hierarchy. The first element will always be the @everyone role. This speeds up access at the cost of some memory, theoretically.
* [commands] Fix up Greedy documentation a bit.Rapptz2018-09-241-2/+2
|
* [commands] Add commands.Greedy converter and documentation.Rapptz2018-09-242-2/+79
| | | | | This allows for greedy "consume until you can't" behaviour similar to typing.Optional but for lists.
* [commands] Allow for backtracking parsing with typing.OptionalRapptz2018-09-231-0/+10
| | | | | | | | | | Original code by zephyrkul. This new parsing mode allows for backtracking in case of failure when a typing.Union[..., NoneType] or a typing.Optional[...] is used. This means that if a type would fail to parse, the view is undo'd to a previous state, passing the default parameter to the callback, and then continuing on the next parameter as if nothing had happened.
* [commands] Properly parse bool when inside a typing.Unionzephyrkul2018-09-201-3/+3
|