mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
Fixes the logic of MessagePredicate.greater and MessagePredicate.less (#3004)
* Fixes the logic of MessagePredicate.greater and MessagePredicate.less * Create 3004.bugfix.rst
This commit is contained in:
parent
4546ca9ba6
commit
7f22d27d51
1
changelog.d/3004.bugfix.rst
Normal file
1
changelog.d/3004.bugfix.rst
Normal file
@ -0,0 +1 @@
|
||||
Fixed MessagePredicate.greater and MessagePredicate.less allowing any valid int instead of only valid ints/floats that are greater/less than the given value.
|
||||
@ -574,7 +574,7 @@ class MessagePredicate(Callable[[discord.Message], bool]):
|
||||
"""
|
||||
valid_int = cls.valid_int(ctx, channel, user)
|
||||
valid_float = cls.valid_float(ctx, channel, user)
|
||||
return cls(lambda self, m: valid_int(m) or valid_float(m) and float(m.content) < value)
|
||||
return cls(lambda self, m: (valid_int(m) or valid_float(m)) and float(m.content) < value)
|
||||
|
||||
@classmethod
|
||||
def greater(
|
||||
@ -605,7 +605,7 @@ class MessagePredicate(Callable[[discord.Message], bool]):
|
||||
"""
|
||||
valid_int = cls.valid_int(ctx, channel, user)
|
||||
valid_float = cls.valid_float(ctx, channel, user)
|
||||
return cls(lambda self, m: valid_int(m) or valid_float(m) and float(m.content) > value)
|
||||
return cls(lambda self, m: (valid_int(m) or valid_float(m)) and float(m.content) > value)
|
||||
|
||||
@classmethod
|
||||
def length_less(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user