Created
March 25, 2015 13:42
-
-
Save jsenin/3e2b00f1312582d6d454 to your computer and use it in GitHub Desktop.
xchat script to greeting on channel joining
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__module_name__ = 'Saluda cuando entras' | |
__module_version__ = '0.1' | |
__module_description__ = 'Saluda en un canal cuando entras' | |
__module_author__ = 'nterprais@gmail.com' | |
import xchat | |
c = '\x0312' | |
def on_join(word, word_eol, userdata): | |
#Add the channels you want to greet people in here, inbetween the ' marks. Example: channels = ['#Jake','#Example'] | |
#You can add as many channels that you'd like by adding a comma then another set of quotes | |
channels = ['','',''] | |
nick, channel = word[0], word[1] | |
destination = xchat.get_context() | |
if channel in channels: | |
destination.command('say Hello %s, welcome to %s!' % (nick, channel)) | |
else: | |
return | |
def on_access(word, word_eol, userdata): | |
triggernick, triggercommand, triggerchannel = word | |
me = xchat.get_info('nick') | |
nick = triggernick.partition('!')[0][1:] | |
greet = 'Hello everybody' | |
if xchat.nickcmp(nick, me ) == 0: | |
destination = xchat.get_context() | |
destination.command('say %s ' %( greet )) | |
# Don't eat this event, let other plugins and xchat see it too | |
return xchat.EAT_NONE | |
def onUnload(userdata): | |
xchat.prnt('%s%s, version: %s, has been unloaded.' % (c, __module_name__, __module_version__)) | |
# bind hooks | |
xchat.hook_server('JOIN',on_access) | |
xchat.hook_unload(onUnload) | |
# load finished | |
print('%s%s, version: %s, has been loaded.' % (c, __module_name__, __module_version__)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment