Rapptz
3527203e07
[commands] Redesign HelpFormatter into HelpCommand
Part of #1938
6 years ago
Rapptz
3a8214a115
[commands] Remove Bot.get_cog_commands
6 years ago
Rapptz
caf3d17d4a
Rework entire cog system and partially document it and extensions.
6 years ago
Skyweb
e53c85110f
Clarified add_listener documentation
6 years ago
Dante Dam
9656a21ebe
Bumped copyright years to 2019.
6 years ago
bmintz
24c0946a93
bot.unload_extension: also allow events with no module
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")
7 years ago
Hornwitser
efb4ff850e
[lint] Fix import order
Reorder imports to be consistenly grouped by standard library, third
party library, and local modules in that order thoughout the library.
7 years ago
Hornwitser
51d626eabe
[lint] Remove redundant paranthesis
Remove redundant parenthisis around await expressions. Left over from
f25091ef
.
7 years ago
Hornwitser
fa46b07db1
[lint] Rename exception variables to exc
Use the more explicit (and common) exc instead of e as the variable
holding the exception in except handlers.
7 years ago
Hornwitser
a71b3b5fa0
[lint] Limit unneccessarily broad except clauses
Add exception qualifier(s) to bare except clauses swallowing exceptions.
7 years ago
Rapptz
e12db3a25d
[commands] Add call_once keyword-only parameter for Bot.remove_check
Technically a breaking change. This is to be a parallel with the
Bot.add_check interface.
7 years ago
MusicOnline
9af0e54cd3
Correct ClientException message raised in invocation hooks.
For when the hooks are not coroutines.
7 years ago
BeatButton
a4d1599ce9
Change docstrings to raw-strings
7 years ago
zephyrkul
b9ef80b0d0
[commands] Prepend mention prefixes in commands.when_mentioned_or
7 years ago
Ben Mintz
be7ea2678b
Bot.unload_extension: don't remove commands from no module
Fixes unload_extension in the case of a command added via eval
7 years ago
Hornwitser
3679819c53
[lint] Remove unnecessary lambdas
Lambdas of the form `lambda x: func(x)` are redundant.
7 years ago
Hornwitser
d58fc0ccee
[lint] Remove unused imports
Left over from various refactoring and rewrites.
7 years ago
Rapptz
aa7c5c3ec1
[commands] Ignore bots from Bot.process_commands by default.
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
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
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
Tobotimus
3112e1c17e
Add intersphinx
7 years ago
S Stewart
89f9009a28
[commands] Fix minor spelling mistake
8 years ago
Rapptz
e24914be0b
[commands] Fix NameError when given an invalid prefix.
Closes #775
8 years ago
Rapptz
fce2ef5534
[commands] Raise when an invalid prefix is given.
Fixes #712
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
717f11d635
[commands] Add Bot.check_once for a global check that is called once.
There is a counterpart for this in cogs, called __global_check_once.
This allows for predicates that would filter a command globally that
do not necessarily require rechecking in the case of e.g. the help
command such as blocking users or blocking channels.
8 years ago
Rapptz
e62e2c7cc6
[commands] Fix cog error detection in the default global error handler.
8 years ago
Rapptz
7d6435fa9c
[commands] Don't display default error handler if a cog local exists.
8 years ago
Rapptz
83dc93559c
[commands] Add docstrings for extension loading.
8 years ago
Rapptz
f588876587
Use Python3Lexer instead of PythonLexer for pygments.
8 years ago
Rapptz
c3e39cd722
[commands] Fix Context.command_failed from being incorrect.
When used, it would be set to False after the invoke was done. Ideally
it should report to False during invoke but True during any error
case.
8 years ago
Rapptz
b44bba6ee6
First pass at documentation reform.
8 years ago
Rapptz
8ef984746a
[commands] Fix default error handler to work with the switch.
8 years ago
Rapptz
a2c9cefac9
[commands] Re-order error handler arguments.
They now have Context as the first argument to be consistent with other
context-passing functions.
8 years ago
Rapptz
37681dd0ea
[commands] Fix lack of space in when_mentioned
8 years ago
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.
8 years ago
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 .
8 years ago
Rapptz
5c5e7ae1d6
[commands] Add is_owner check and Bot.is_owner.
8 years ago
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.
8 years ago
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.
8 years ago
Rapptz
9cb89f019e
[commands] Register cog listeners with the name of the attribute.
8 years ago
Rapptz
47ef657fbd
Implement async checks. Fixes #380 .
8 years ago
Rapptz
1c49374210
[commands] Implement before and after invoke command hooks.
Fixes #464 .
8 years ago