Use logger

This commit is contained in:
Luke Murphy 2021-01-14 22:44:48 +01:00
parent aabe1fa683
commit d8bbacc258
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -232,12 +232,12 @@ class Bot(ClientXMPP):
def reply(self, body, to=None, room=None):
"""Send back a reply."""
if to is None and room is None:
message = "`to` or `room` arguments required for `reply`"
raise RuntimeError(message)
self.log("`to` or `room` arguments required for `reply`")
exit(1)
if to is not None and room is not None:
message = "Cannot send to both `to` and `room` for `reply`"
raise RuntimeError(message)
self.log.error("Cannot send to both `to` and `room` for `reply`")
exit(1)
kwargs = {"mbody": body}
if to is not None: