All pastes #141067 Raw Edit

Mine

public python v1 · immutable
#141067 ·published 2006-08-20 20:27 UTC
rendered paste body
import socket,re# --------------------------------------------# --- Terlik v0.1, Python IRC Bot ------------# --- Author: Yns_ || http://yns.zaxaz.com ---# --------------------------------------------# configuration filesnetwork  = 'irc.freenode.net'port     = 6667nick     = 'Terlik2'channel  = '#hekir'log_file = 'log.txt'owner    = 'Yns_'irc = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )irc.connect ( ( network, port ) )print irc.recv ( 4096 )irc.send ( "NICK " + nick + "\r\n" )irc.send ( "USER " + nick + " " + nick + " " + nick + " :yns.zaxaz.com/terlik/ \r\n" )irc.send ( "JOIN " + channel +" \r\n" )irc.send ( "PRIVMSG " + channel + " :selam.\r\n" )while True:   data = irc.recv ( 4096 )   # -- Logging In progress -- #   filehandle = open(log_file, "a+")   filehandle.write(data)   filehandle.close()      # -- pin(g) - pon(g) -- #   if data.find ( 'PING' ) != -1:       irc.send ( 'PONG ' + data.split() [ 1 ] + '\r\n' )   # explode the data   if data.find ( 'PRIVMSG ' + channel ) != -1:       nick    = data.split ( '!' ) [ 0 ].replace ( ':', '' )       message = ':'.join ( data.split ( ':' ) [ 2: ] ).split ( ' ' ) [ 1 ]       if(message == '!quit' and nick == 'owner'):            irc.send ( "PRIVMSG " + channel + " :Hemen cikiyorum efendim.. Iyi gunler dilerim.\r\n" )           irc.send ( 'QUIT\r\n' )           irc.close()       print message.group(1)       print message.group(1)             print data