bot: add most_specific_msg for convenience
returns original_msg or addressed_msg, depending on the context related to bss/dr.botzo#32
This commit is contained in:
parent
a79d0cdd9f
commit
1e428b77db
@ -79,3 +79,14 @@ def reply_destination_for_event(event):
|
|||||||
return event.target
|
return event.target
|
||||||
else:
|
else:
|
||||||
return irc.client.NickMask(event.source).nick
|
return irc.client.NickMask(event.source).nick
|
||||||
|
|
||||||
|
|
||||||
|
def most_specific_message(event):
|
||||||
|
"""Provides the "most specific" message for a pubmsg/privmsg.
|
||||||
|
|
||||||
|
Specificity is defined as the raw message, or the message after a "bot: blah" address.
|
||||||
|
"""
|
||||||
|
if event.addressed:
|
||||||
|
return event.addressed_msg
|
||||||
|
else:
|
||||||
|
return event.original_msg
|
||||||
|
Loading…
Reference in New Issue
Block a user