Add __str__ and __repr__ to MergedFilter.

This commit is contained in:
Jacob Bom 2016-09-25 16:31:06 +02:00
parent 3244417f61
commit 79e065a730

View file

@ -69,6 +69,13 @@ class MergedFilter(BaseFilter):
elif self.or_filter:
return self.base_filter(message) or self.or_filter(message)
def __str__(self):
return ("<telegram.ext.filters.MergedFilter consisting of"
" {} {} {}>").format(self.base_filter, "and" if self.and_filter else "or",
self.and_filter or self.or_filter)
__repr__ = __str__
class Filters(object):
"""