Update sweebot.py
Some checks are pending
Check syntax / check (push) Waiting to run

This commit is contained in:
Nova Cat 2025-01-12 20:24:03 -08:00
parent aa649efb68
commit e39f9c3f94

View file

@ -855,7 +855,7 @@ while True:
gsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) gsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
gemsocket = ssl.wrap_socket(gsocket) gemsocket = ssl.wrap_socket(gsocket)
gemsocket.connect((parse.hostname, 1965)) gemsocket.connect((parse.hostname, 1965))
gemsocket.send(i + "\r\n") gemsocket.send(bytes(i + "\r\n", "UTF-8"))
received = "" received = ""
while True: while True:
gemresponse = gemsocket.recv(2048) gemresponse = gemsocket.recv(2048)
@ -869,10 +869,16 @@ while True:
for i in received.split("\n"): for i in received.split("\n"):
if firstline: if firstline:
if i.split(" ")[0][0] != "2": if i.split(" ")[0][0] != "2":
title = True
multiline("(" + nick + f") [{i}]", channel) multiline("(" + nick + f") [{i}]", channel)
break break
else: else:
firstline = False firstline = False
if i.split(" ")[1] != "text/gemini":
typee = i.split(" ")[1]
multiline("(" + nick + f") [Non-Gemtext file: {typee}]", channel)
title = True
break
else: else:
if i.split(" ")[0][0] == "#": if i.split(" ")[0][0] == "#":
title = True title = True