Hornwitser
c8b49d37be
[lint] Fix incorrect and inconsistent whitespace
Adjust whitespace to be consistent with the rest of the library.
7 years ago
Hornwitser
3679819c53
[lint] Remove unnecessary lambdas
Lambdas of the form `lambda x: func(x)` are redundant.
7 years ago
Hornwitser
119c5a0618
[lint] Remove unused variables
Left over from various refactoring and rewrites.
7 years ago
Hornwitser
d58fc0ccee
[lint] Remove unused imports
Left over from various refactoring and rewrites.
7 years ago
Michael H
39cb5f30b4
[commands] Handle nick mentions in HelpFormatter
Modifies the help formatter to handle nicknamed bot users for
mentions in clean_prefix
7 years ago
Rapptz
aa7c5c3ec1
[commands] Ignore bots from Bot.process_commands by default.
7 years ago
Clement
00a14a46f3
[commands] Added BucketType.members for cooldowns
7 years ago
Rapptz
8d3b2d0b70
[commands] Fix broken handling of keyword only parameters.
Had a missing `param` argument in the new `do_conversion` code.
7 years ago
Rapptz
69ca675ca0
[commands] Fix typing.Union converters for 3.7
Guido please don't break this
7 years ago
Rapptz
da5776a358
[commands] Make ConversionError have the original error as an attribute
7 years ago
Rapptz
92dde9aef9
[commands] Add support for typing.Union as a converter
7 years ago
khazhyk
2321ae8d97
[commands] raise ConversionError on Converter error
This assumes that a Converter class raising non-CommandError
is a programmer error. Makes this type of error easier to
disambiguate from a generic BadArgument.
7 years ago
Hornwitser
a93c3d931c
[commands] Change command_prefix behaviour
Change the behaviour of handling iterable command_prefix types to not
silently ignore falsy prefixes and unify behaviour for all iterable
types. Add special handling of a possible TypeError in both get_prefix
and get_context for when the prefix is a different type from what is
expected.
7 years ago
Harmon
bf9ca405e3
Fix case insensitive command removal
7 years ago
Rapptz
607771c4f4
Fix Bot.get_prefix second parameter breaking.
7 years ago
Rapptz
f25091efe1
Drop support for Python 3.4 and make minimum version 3.5.2.
7 years ago
Rapptz
f176309179
[commands] Don't handle single quotes.
7 years ago
Rapptz
d8a85f4898
[commands] Minor optimisations to unicode quote handling.
7 years ago
b-hodges
ea061ef9b2
[commands] Added handling for unicode quotes
7 years ago
Rapptz
871a262ee3
[commands] Add ability to have case insensitive commands.
This is powered by a dict-like class for the people who want to opt-in
to the performance downgrade for usability for majority English
speaking users.
Since it is slower than the regular dict due to the excessive calls to
str.lower along with the possibilities of gotchas for other languages
outside of English, this is kept as False for the default case.
7 years ago
Eli
ad7506050c
[commands] Allow builtin unbound method converters
7 years ago
Gorialis
04d9dd9c0d
Change PartialReactionEmoji to PartialEmoji, add a PartialEmojiConverter
7 years ago
Tobotimus
3112e1c17e
Add intersphinx
7 years ago
khazhyk
0ef866a704
[commands] Fix MissingRequiredArgument param handling
Documentation was incorrect, and we were throwing
away the param we were passing.
7 years ago
Rapptz
3a8b97ffb0
[commands] Document that can_run can raise.
7 years ago
Rapptz
e61ac8e60f
[commands] Forbid passing a string to aliases in Command.
Fixes #974
7 years ago
Joshua Butt
f5a443fa8f
Add support for animated emoji to commands ext EmojiConverter
7 years ago
S Stewart
89f9009a28
[commands] Fix minor spelling mistake
7 years ago
Rapptz
9b4a2dc7cb
[commands] Minor speed-up for the BucketType.guild case.
None case:
344ns ± 24.4ns -> 49.9ns ± 1.39ns
Valid case:
128ns ± 2.76ns -> 42.7ns ± 0.459ns
8 years ago
Rapptz
1bb7b6ff2d
[commands] Make CooldownMapping.get_bucket take Message instead.
Requiring a full blown Context might be a bit overkill considering
we only use a single attribute from it.
8 years ago
MysterialPy
bae6f80327
[commands] Split Cooldown state processing to two different functions.
This allows us to check if we are rate limited without
creating a new cool-down window for the command.
8 years ago
Rapptz
e614f6b4cd
[commands] Add CategoryChannelConverter
8 years ago
Rapptz
e24914be0b
[commands] Fix NameError when given an invalid prefix.
Closes #775
8 years ago
ReinaSakuraba
10696a275b
[commands] Have (bot_)has_permissions provide better failure responses
8 years ago
ReinaSakuraba
8646bddc90
[commands] Add MissingPermissions and BotMissingPermissions
8 years ago
Rapptz
63fcfa6d02
[commands] Add CooldownMapping.from_cooldown factory classmethod.
8 years ago
Rapptz
1c967e9a7c
[commands] Export cooldown classes as well.
8 years ago
Rapptz
fce2ef5534
[commands] Raise when an invalid prefix is given.
Fixes #712
8 years ago
Rapptz
eb673ec2af
[commands] Ensure no mentions escape clean_content
Some clever nicknames or role names would lead themselves to
resolving to pings.
8 years ago
Rapptz
cb709cc9da
[commands] Fix clean_content converter not properly escaping mentions.
In some cases, the Discord provided role_mentions and mentions array
would be empty, such as wrapping a mention with a backtick or
other frivolous characters. Since we want to completely nullify
mentions, we should not rely on the Discord provided arrays and instead
use and resolve the IDs from the content itself.
8 years ago
Rapptz
a7f846b37f
[commands] Fix Command.root_parent not properly working.
8 years ago
Rapptz
bd4505fec5
[commands] Restart the StringView properly in Context.reinvoke.
The old code for some reason assumed that the length of the command
would be 1. This is because when I tested this I would use single
letter command names and it would "just work" when in reality it was
completely incorrect.
A reminder to thoroughly test instead of just fitting something to work
8 years ago
Rapptz
bcaee518a1
[commands] Remove support for pass_context=False in Command.
8 years ago
Rapptz
2f97678a79
First pass at commands narrative documentation.
8 years ago
khazhyk
fc22d288be
[commands] unload cog submodules
When unloading cogs, currently we do not remove submodules from
sys.modules, meaning they will not be reloaded. Removing here
makes new imports reload from file. Of course, any already imported
modules will still hold a reference to the old module, since they
will not re-import it, and will not be forcably unloaded.
8 years ago
khazhyk
6c01250c39
[commands] fix unloading incorrect cogs
unload_extension would incorrectly unload cogs/listeners
of other extensions if the name of one was a prefix of
another.
8 years ago
khazhyk
bca72e64d6
[commands] clean up remove_cog documentation
remove_cog always returns None, even if the cog is found.
8 years ago
Rapptz
0b9d402272
[commands] Improve commands.when_mentioned_or documentation.
8 years ago
Rapptz
ce34713c45
[commands] Do not take up 'command' keyword-argument in Context.invoke.
It was annoying when commands would have a keyword-only argument
named 'command', such as a help command or a disable command.
8 years ago
Rapptz
ad20e3066e
[commands] Add parameter that failed in fall-back BadArgument error.
8 years ago