callbacks: Don't raise AssertionError when addressd() is called with a NOTICE

Some plugins (like LinkRelay) share code between NOTICE and PRIVMSG
and they might call it unconditionally.
This commit is contained in:
Valentin Lorentz 2021-09-22 21:48:59 +02:00
parent de277edb42
commit ebaa346619
1 changed files with 2 additions and 0 deletions

View File

@ -80,6 +80,8 @@ def _addressed(irc, msg, prefixChars=None, nicks=None,
payload = payload[len(prefixString):].lstrip()
return payload
if msg.command == 'NOTICE':
return ''
assert msg.command in ('PRIVMSG', 'TAGMSG'), msg.command
target = msg.channel or msg.args[0]
if not payload: