scroll

- irc bot to play ascii art
git clone git://git.acid.vegas/scroll.git
Log | Files | Refs | Archive | README | LICENSE

commit 357dc5db4d1761a3a4cd89236d1ecc744bc9b403
parent f3221bce35c0a54bfe834e58a809bd213a81f589
Author: acidvegas <acid.vegas@acid.vegas>
Date: Mon, 26 Jun 2023 03:45:25 -0400

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

Diffstat:
Mscroll.py | 9++++++---

1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/scroll.py b/scroll.py
@@ -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':