Use logger
This commit is contained in:
parent
aabe1fa683
commit
d8bbacc258
@ -232,12 +232,12 @@ class Bot(ClientXMPP):
|
|||||||
def reply(self, body, to=None, room=None):
|
def reply(self, body, to=None, room=None):
|
||||||
"""Send back a reply."""
|
"""Send back a reply."""
|
||||||
if to is None and room is None:
|
if to is None and room is None:
|
||||||
message = "`to` or `room` arguments required for `reply`"
|
self.log("`to` or `room` arguments required for `reply`")
|
||||||
raise RuntimeError(message)
|
exit(1)
|
||||||
|
|
||||||
if to is not None and room is not None:
|
if to is not None and room is not None:
|
||||||
message = "Cannot send to both `to` and `room` for `reply`"
|
self.log.error("Cannot send to both `to` and `room` for `reply`")
|
||||||
raise RuntimeError(message)
|
exit(1)
|
||||||
|
|
||||||
kwargs = {"mbody": body}
|
kwargs = {"mbody": body}
|
||||||
if to is not None:
|
if to is not None:
|
||||||
|
Reference in New Issue
Block a user