1
mirror of git://git.acid.vegas/scroll.git synced 2024-11-21 23:56:39 +00:00

Check line legnth on .ascii img to prevent large image conversions outside of #scroll

This commit is contained in:
Dionysus 2023-06-26 03:45:25 -04:00
parent f3221bce35
commit 357dc5db4d
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE

View File

@ -249,9 +249,12 @@ class Bot():
await self.irc_error(chan, 'failed to convert image', ex)
else:
if ascii:
for line in ascii:
await self.sendmsg(chan, line)
await asyncio.sleep(self.settings['msg'])
if len(ascii) <= self.settings['lines']:
for line in ascii:
await self.sendmsg(chan, line)
await asyncio.sleep(self.settings['msg'])
else:
await self.irc_error('image is too big', 'take it to #scroll')
elif msg == '.ascii list':
await self.sendmsg(chan, underline + color('https://raw.githubusercontent.com/ircart/ircart/master/ircart/.list', light_blue))
elif msg == '.ascii random':