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