Merge pull request #44 from clarissavazquez/master

Nickname authentication
This commit is contained in:
shaunagm 2014-12-09 21:54:49 -05:00
commit 971c13cc25

9
bot.py
View File

@ -11,7 +11,8 @@ botnick = "WelcomeBot"
channel_greeters = ['shauna', 'paulproteus', 'marktraceur'] channel_greeters = ['shauna', 'paulproteus', 'marktraceur']
wait_time = 60 wait_time = 60
hello_list = [r'hello', r'hi', r'hey', r'yo', r'sup'] hello_list = [r'hello', r'hi', r'hey', r'yo', r'sup']
help_list = [r'help', r'info', r'faq', r'explain yourself'] help_list = [r'help', r'info', r'faq', r'explain yourself']
registered = true # If users don't want to identify, change the value to false.
######################### #########################
@ -71,6 +72,10 @@ def join_irc(ircsock):
ircsock.send("USER {0} {0} {0} :This is http://openhatch.org/'s greeter bot" ircsock.send("USER {0} {0} {0} :This is http://openhatch.org/'s greeter bot"
".\n".format(botnick)) # bot authentication ".\n".format(botnick)) # bot authentication
ircsock.send("NICK {}\n".format(botnick)) # Assign the nick to the bot. ircsock.send("NICK {}\n".format(botnick)) # Assign the nick to the bot.
with open("password.txt", 'r') as f:
password = f.read()
if registered == true:
ircsock.send("PRIVMSG {} {} {} {}".format("NickServ","IDENTIFY", botnick, password))
ircsock.send("JOIN {} \n".format(channel)) # Joins channel ircsock.send("JOIN {} \n".format(channel)) # Joins channel
# Reads the messages from the server and adds them to the Queue and prints # Reads the messages from the server and adds them to the Queue and prints
@ -220,7 +225,7 @@ def wait_time_change(actor, ircmsg, ircsock):
def pong(ircsock): def pong(ircsock):
ircsock.send("PONG :pingis\n") ircsock.send("PONG :pingis\n")
########################## ##########################
### The main function. ### ### The main function. ###
########################## ##########################