addressing bugs

This commit is contained in:
konrad 2023-04-28 09:10:46 +01:00
parent fb2430724c
commit 9ffe6d7ff4
1 changed files with 98 additions and 96 deletions

View File

@ -62,6 +62,7 @@ while True:
except UnicodeDecodeError:
continue
chunk = data.split()
if len(chunk) > 0:
if data.startswith(":"):
command = chunk[1]
else:
@ -147,8 +148,7 @@ while True:
n=1,
size="1024x1024"
)
answers = response.data[0].url
long_url = answers
long_url = response.data[0].url
type_tiny = pyshorteners.Shortener()
short_url = type_tiny.tinyurl.short(long_url)
irc.send(bytes("PRIVMSG " + channel + " :" + short_url + "\n", "UTF-8"))
@ -159,4 +159,6 @@ while True:
print("Invalid model.")
irc.send(bytes("PRIVMSG " + channel + " :Invalid model.\n", "UTF-8"))
continue
else:
continue
time.sleep(1)