Python IRC Help

With NOTICE specifically

Page 1 of 1

2 Replies - 910 Views - Last Post: 13 March 2010 - 08:28 AM Rate Topic: -----

#1 AngryJesus  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 29-November 09

Python IRC Help

Posted 12 March 2010 - 06:47 AM

Hey everyone

I'm in the middle of writing an IRC bot in python. One of my requirements is that it uses the IRC Notice command to send a message to another bot. This is what is in my code where I'm having trouble.


            s.send("PONG %s\r\n" % line[1]) 
	    #Reply with Pong to Ping
            #Set essential features
            s.send("PRIVMSG %s\r\n" % "NickServ, IDENTIFY mypassword")
            s.send("PRIVMSG %s\r\n" % "NickServ, set autoop on")
             
	    s.send("NOTICE %s\r\n" % "bot,!hi")



Everything is indented because it is part of a while loop that checks for a Ping request, replies with pong, and then continues doing what it needs to. Everything works up the notice part. Is my syntax wrong? Should I be doing this another way? Any suggestions? I want to do this without any IRC modules, so please don't suggest that.

Is This A Good Question/Topic? 0
  • +

Replies To: Python IRC Help

#2 programble  Icon User is offline

  • (cons :dic :head)

Reputation: 49
  • View blog
  • Posts: 1,315
  • Joined: 21-February 09

Re: Python IRC Help

Posted 12 March 2010 - 02:38 PM

The syntax for a NOTICE is
NOTICE user :message\r\n


Was This Post Helpful? 0
  • +
  • -

#3 AngryJesus  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 29-November 09

Re: Python IRC Help

Posted 13 March 2010 - 08:28 AM

Actually, my code worked fine, I just messed up when I was supposed to send the Notice, so my bad.

Regardless, thank you for the reply.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1