Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added message wrapper
  • Loading branch information
sandeshpatel committed Aug 13, 2017
commit 2e3ebbda79bc030155433e26145f2c0654713e14
12 changes: 5 additions & 7 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from_zone = tz.gettz('UTC')
to_zone = tz.gettz('Asia/Kolkata')

def msg_wrapper():
return "PRIVMSG " + channel + " "

def ping(): # responds to server pings
ircsock.send("PONG :pingis\n")
Expand All @@ -22,18 +24,15 @@ def joinchan(chan):


def welcome():
print("inside welcome function")
ircsock.send("PRIVMSG " + channel + ":Hello! " + user+ " Welcome to jec-dev! Happy Hacking! :D\n")
ircsock.send("PRIVMSG " + channel + user + " plese introduce yourself with name, branch, sem, and area of interest ")

ircsock.send(msg_wrapper() + ":Hello! " + user+ " Welcome to jec-dev! Please introduce yourself with name, branch, sem, and area of interest \n ")
def hello():
ircsock.send("PRIVMSG " + channel + ":Hello! Welcome to jec-dev! Happy Hacking! :D\n")
ircsock.send(msg_wrapper() + ":Hello! Welcome to jec-dev! Happy Hacking! :D\n")


if __name__ == '__main__':
server = "irc.freenode.net"
channel = "#jec-dev"
botnick = "jec-dev-botwain"
botnick = "jec-dev-bot"

ircsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Here we connect to the server using the port 6667
Expand Down Expand Up @@ -76,7 +75,6 @@ def hello():
log.write(ircmsg+'\n')
if user not in user_list:
welcome()
print("welcome called")
user_list.append(user)
with open("user_list_file" , 'a') as usernames:
usernames.write(user+'\n')
Expand Down
40 changes: 38 additions & 2 deletions user_list_file
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
:wolfe.freenode.net
twain
t
:jec-dev-botwain
:pikapi
:knrai_
:knrai__
:Gaurav_
Expand All @@ -12,3 +10,41 @@ ec-dev-botwain
:jec-dev-bot
:knrai
:barjavel.freenode.net
:tolkien.freenode.net
998.
:tolkien.freenode.net
:zeekhuge
:orwell.freenode.net
well.freenode.net
998.
:tolkien.freenode.net
:krishna
:cherryh.freenode.net
:leguin.freenode.net
iversity
keep
:san-D
:Mutter
:jec-dev-botwain
:krishna__
Bearstech
:karatkievich.freenode.net
.net.
@ChanServ
:karatkievich.freenode.net
:Mutter_
:u043
:rajaniemi.freenode.net
net
thank
:BongBrahm_durwas
:durwasa
:vipul20
:krishna2
:knrai1
:botwayne
:pikapi
c-dev-botwain
372
:Guest75630
:san-d_