11 Commits

Author SHA1 Message Date
Predeactor
edbbd76b3c
Document that discord.DMChannel can be used in MessagePredicate (#4718)
* Allow "discord.DMChannel" for MessagePredicate

This closes #4707.

* Optional only takes a single type, use Union

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2021-01-21 11:42:10 +01:00
Predeactor
0a040ad8e3
Fix wrong words in docstrings of reaction and message predicates (#4593)
* Fix a wrong usage of word in docs

* Let's fix this while we're at it

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2020-11-11 17:34:33 +01:00
Stonedestroyer
08bd0567ad
Grammar fixes (#4500)
* Grammar fixes

* More changes

* Grammar

* Error grammar

* Spelling

* Grammar

* REsolves grammar

* grammar

* grammar

* grammar

* grammar

* grammar

* grammar

* grammar

* grammar

* "commited" > "committed"

* apostrophe

* more grammar

* grammar

* `funtion` to `function`

* grammar in alias cog

* grammar in cleanup cog

* grammar in customcom cog

* grammar in mod cog

* grammar in reports cog

* fix grammar in streams cog

* missing apostrophe

* grammar fix in trivia cog

Co-authored-by: Jyu Viole Grace <24418520+thisisjvgrace@users.noreply.github.com>
Co-authored-by: Jyu Viole Grace <thisisjvgrace@users.noreply.github.com>
2020-10-18 08:52:56 +01:00
Michael H
d869410d36
Add .gitattributes to ensure project consistent line endings (#4037)
- Renormalized as well
2020-07-06 18:53:10 +02:00
aikaterna
7d30e3de14
[Utils] Fix regex for role mentions in MessagePredicate (#4030) 2020-07-01 03:29:16 +02:00
Michael H
a8450580e8
[Commands Module] Improve usability of type hints (#3410)
* [Commands Module] Better Typehint Support

  We now do a lot more with type hints

  - No more rexporting d.py commands submodules
  - New type aliases for GuildContext & DMContext
  - More things are typehinted

  Note: Some things are still not typed, others are still incorrectly
  typed, This is progress.

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2020-01-26 17:54:39 -05:00
Flame442
7f22d27d51 Fixes the logic of MessagePredicate.greater and MessagePredicate.less (#3004)
* Fixes the logic of MessagePredicate.greater and MessagePredicate.less

* Create 3004.bugfix.rst
2019-09-18 17:15:24 -04:00
Flame442
dfb4212d43 [Docs] Fix user parameter to predicates being typed as discord.TextChannel (#2914) 2019-08-18 09:05:22 +10:00
Redjumpman
fa223e22ed [Utils] Fix for MessagePredicate.lower_contained_in (#2399)
Added a missing str.lower() method when checking to see if the content is in the list.
2019-02-04 10:22:01 +11:00
Toby Harradine
dea9dde637
[Utils] Finish and Refactor Predicate Utility (#2169)
* Uses classmethods to create predicates
* Classmethods allow using a combination of different parameters to describe context
* Some predicates assign a captured `result` to the predicate object on success
* Added `ReactionPredicate` equivalent to `MessagePredicate`
* Added `utils.menus.start_adding_reactions`, a non-blocking method for adding reactions asynchronously
* Added documentation
* Uses these new utils throughout the core bot
Happened to also find some bugs in places, and places where we were waiting for events without catching `asyncio.TimeoutError`

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-10-06 08:07:09 +10:00
Redjumpman
5d44bfabed [Utils] Initial Work on Predicate Utility (#1985)
* Add files via upload

* Update predicates.py

Changed sender from a discord.Member object to ctx.
Added a channel check.
Combined the same method and channel method into a validator and applied through-out.
valid_role and has_role methods now check for either an id or a name.
contained now uses string.lower() when testing for membership in a collection.

Signed-off-by: Redjumpman <redjumpman@users.noreply.github.com>
2018-10-02 16:19:40 +10:00