I am following a tutorial using sublime text that uses python and the tutorial had me define 2 functions into strings but they want be printed out together can anyone help me please? Im sorry for asking such a basic question but im very new to this and this is one of my bigger projects im doing first.
def joinchat():
Loading = True
while Loading:
readbuffer_join = irc.recv(1024)
readbuffer_join = readbuffer_join.decode()
for line in readbuffer_join.split("n")[0:-1]:
print(line)
Loading = loadingComplete(line)
def loadingComplete(line):
if ("End of /NAMES list" in line):
print("Bot has joined " + CHANNEL + " Channel")
sendMessage(irc, "yo")
return False
else:
return True
def sendMessage(irc, message):
messageTemp = "PRIVMSG #" + CHANNEL + " " + message
irc.send((messageTemp + "n").encode())
def getUser(line):
separate = line.split(":", 2)
user = separate[1].split("!" , 1)[0]
return user
def getMessage(line):
try:
message = (line.split(":",2))[2]
except:
message = ""
return message
def console(line):
if "PRIVMSG" in line:
return False
else:
return True
joinchat()
while True:
try:
readbuffer = irc.recv(1024).decode()
except:
readbuffer = ""
for line in readbuffer.split("rn"):
if line == "":
continue
else:
print(line)
user = getUser(line)
message = getMessage(line)
print(getUser(line) + getMessage(line))
if "PING" in line and Console(line):
msgg = "PONG tmi.twitch.tvrn".encode()
irc.send(msgg)
print(msgg)
continue
I thought this was something simple but I can’t figure out why this won’t work I remember doing this before but I can’t figure out why they can’t be used in the same line also I was following a tutorial that did the code like this and it worked without issues. any help is appreciated!