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
1 changed files with 6 additions and 3 deletions

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':