I am building a very basic Python BOT in Python 3; Mostly feeding off several manuals and tutorials since I am just learning the language. My issue right now is connecting into the server, all I receive is the following:
:ircserver NOTICE * :*** Looking up your hostname...
:ircserver NOTICE * :*** Couldn't resolve your hostname; using your IP address instead
PING :CFC3BEE0
:ircserver 451 JOIN :You have not registered
ERROR :Closing Link: Botski[serverIPaddress] (Registration Timeout)
whereas ircserver is the address of the server; and serverIPaddress is the IP, ommited because it's irrelevant
I have read somewhere that "Registration Timeout" is caused due to failure to respond to PING. I can see right there it says PING :CFC3BEE0
I respond to that this way
if ircmsg.find("PING :") != -1:
pongvalor = ircmsg[6:13]
ping(pongvalor)
So, what I believe this should do is, if it receives a message where it says PING : ; it should take the characters 6 to 13 (in this case CFC3BEE0), put them in variable pongvalor and send them into ping() ; whereas ping() is:
def ping(pong):
ircsock.send(bytes("PONG :" + pong + "\r\n", "UTF-8"))
So, it should respond PONG :CFC3BEE0 ; Am I doing something wrong?
Code, in case it's necesary: https://pastebin.com/2HdgBF58
Thanks for your time.