forked from swee/MeowNex
Update sweebot.py
This commit is contained in:
parent
0b61251601
commit
8f567cca09
1 changed files with 18 additions and 15 deletions
33
sweebot.py
33
sweebot.py
|
@ -568,21 +568,24 @@ while True:
|
|||
multiline(choice(threes), channel)
|
||||
# try to parse and find a link
|
||||
if sbconfig.cflagexist(channel, "+links"):
|
||||
for i in command:
|
||||
if i[:8] == "https://":
|
||||
e = get(i)
|
||||
if e.ok:
|
||||
soup = BeautifulSoup(e.text, 'html.parser')
|
||||
multiline("(" + nick + ") " + soup.title.string if soup.title.string != None else "[No title provided]", channel)
|
||||
else:
|
||||
multiline("(" + nick + ") HTTP " + str(e.status_code), channel)
|
||||
elif i[:7] == "http://":
|
||||
e = get(i)
|
||||
if e.ok:
|
||||
soup = BeautifulSoup(e.text, 'html.parser')
|
||||
multiline("(" + nick + ") " + soup.title.string if soup.title.string != None else "[No title provided]", channel)
|
||||
else:
|
||||
multiline("(" + nick + ") HTTP " + str(e.status_code), channel)
|
||||
try:
|
||||
for i in command:
|
||||
if i[:8] == "https://":
|
||||
e = get(i)
|
||||
if e.ok:
|
||||
soup = BeautifulSoup(e.text, 'html.parser')
|
||||
multiline("(" + nick + ") " + soup.title.string if soup.title.string != None else "[No title provided]", channel)
|
||||
else:
|
||||
multiline("(" + nick + ") HTTP " + str(e.status_code), channel)
|
||||
elif i[:7] == "http://":
|
||||
e = get(i)
|
||||
if e.ok:
|
||||
soup = BeautifulSoup(e.text, 'html.parser')
|
||||
multiline("(" + nick + ") " + soup.title.string if soup.title.string != None else "[No title provided]", channel)
|
||||
else:
|
||||
multiline("(" + nick + ") HTTP " + str(e.status_code), channel)
|
||||
except:
|
||||
print(traceback.format_exc())
|
||||
elif "JOIN" in text and "#nixsanctuary" in text:
|
||||
nick = text.split(":")[1].split("!")[0]
|
||||
if not "swee" in nick:
|
||||
|
|
Loading…
Reference in a new issue