Update sweebot.py

This commit is contained in:
Swee 2024-10-12 15:30:25 -07:00
parent 6f8a5c3e05
commit 657b76f1b5

View file

@ -578,14 +578,14 @@ while True:
soup = BeautifulSoup(e.text, 'html.parser') soup = BeautifulSoup(e.text, 'html.parser')
multiline("(" + nick + ") " + soup.title.string if soup.title.string != None else "[No title provided]", channel) multiline("(" + nick + ") " + soup.title.string if soup.title.string != None else "[No title provided]", channel)
else: else:
multiline("(" + nick + ") HTTP " + str(e.status_code), channel) multiline("(" + nick + ") [HTTP " + str(e.status_code) + "]", channel)
elif i[:7] == "http://": elif i[:7] == "http://":
e = get(i) e = get(i)
if e.ok: if e.ok:
soup = BeautifulSoup(e.text, 'html.parser') soup = BeautifulSoup(e.text, 'html.parser')
multiline("(" + nick + ") " + soup.title.string if soup.title.string != None else "[No title provided]", channel) multiline("(" + nick + ") " + soup.title.string if soup.title.string != None else "[No title provided]", channel)
else: else:
multiline("(" + nick + ") HTTP " + str(e.status_code), channel) multiline("(" + nick + ") [HTTP " + str(e.status_code) + "]", channel)
except: except:
print(traceback.format_exc()) print(traceback.format_exc())
elif "JOIN" in text and "#nixsanctuary" in text: elif "JOIN" in text and "#nixsanctuary" in text: