Added a line that would read a password txt file so that it identifies with the server
This commit is contained in:
parent
8f4a11e835
commit
15cd6a6c0c
5
bot.py
5
bot.py
@ -69,6 +69,9 @@ 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()
|
||||||
|
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
|
||||||
@ -217,7 +220,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. ###
|
||||||
##########################
|
##########################
|
||||||
|
Loading…
Reference in New Issue
Block a user