mirror of https://github.com/coddrago/Heroku
Automatically add `text` and `raw_text` attributes to an `Event` object to avoid weird logspam from dochub modules
parent
3cf750a586
commit
b71f51e8ea
|
@ -424,6 +424,12 @@ class CommandDispatcher:
|
|||
logging.debug(f"Ignored watcher of module {modname}")
|
||||
continue
|
||||
|
||||
# Avoid weird AttributeErrors in weird dochub modules by settings placeholder
|
||||
# of attributes
|
||||
for placeholder in {"text", "raw_text"}:
|
||||
if not hasattr(event, placeholder):
|
||||
setattr(event, placeholder, "")
|
||||
|
||||
# Run watcher via ensure_future so in case user has a lot
|
||||
# of watchers with long actions, they can run simultaneously
|
||||
asyncio.ensure_future(
|
||||
|
|
Loading…
Reference in New Issue