Don't explode when function doesn't get implemented
Closes https://git.autonomic.zone/decentral1se/xbotlib/issues/18.
This commit is contained in:
parent
87ada3e79d
commit
fbd72b55fe
@ -1,5 +1,9 @@
|
||||
# xbotlib x.x.x (UNRELEASED)
|
||||
|
||||
# xbotlib 0.8.0 (2021-01-14)
|
||||
|
||||
- Support not providing response implementation ([#18](https://git.autonomic.zone/decentral1se/xbotlib/issues/18))
|
||||
|
||||
# xbotlib 0.7.1 (2021-01-13)
|
||||
|
||||
- Support logging ([#2](https://git.autonomic.zone/decentral1se/xbotlib/issues/2))
|
||||
|
@ -138,7 +138,10 @@ class Bot(ClientXMPP):
|
||||
def direct_message(self, message):
|
||||
"""Handle message event."""
|
||||
if message["type"] in ("chat", "normal"):
|
||||
try:
|
||||
self.direct(SimpleMessage(message))
|
||||
except AttributeError:
|
||||
self.log.info("Bot.direct not implemented")
|
||||
|
||||
def session_start(self, message):
|
||||
"""Handle session_start event."""
|
||||
@ -155,7 +158,10 @@ class Bot(ClientXMPP):
|
||||
"""Handle groupchat_message event."""
|
||||
if message["type"] in ("groupchat", "normal"):
|
||||
if message["mucnick"] != self.config["bot"]["nick"]:
|
||||
try:
|
||||
self.group(SimpleMessage(message))
|
||||
except AttributeError:
|
||||
self.log.info("Bot.group not implemented")
|
||||
|
||||
def register_xmpp_plugins(self):
|
||||
"""Register XMPP plugins that the bot supports."""
|
||||
|
Reference in New Issue
Block a user