__module_name__ = "Channelevent"
__module_description__ = "Channelevent"
__module_version__ = "1.0"
import xchat
def channel_message_hook(word, word_eol, userdata):
speaker = word[0]
clean_speaker = xchat.strip(speaker)
host, prefix = None, ''
for user in xchat.get_list('users'):
if xchat.nickcmp(clean_speaker, user.nick) == 0:
host = user.host
prefix = user.prefix
break
if host:
xchat.emit_print('Channel Message',
"%s!%s" % (speaker, host), word[1], prefix, '')
return xchat.EAT_XCHAT
else:
return xchat.EAT_NONE
xchat.hook_print('Channel Message', channel_message_hook)