scroll

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

commit 36fce2ff816e9cd4d544440605fe595573bfbd83
parent a57316332fe25462c6cef952eadd345d77b7277a
Author: acidvegas <acid.vegas@acid.vegas>
Date: Sun, 25 Jun 2023 02:50:29 -0400

Fixed line stripping

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

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

diff --git a/scroll.py b/scroll.py
@@ -156,12 +156,11 @@ class Bot():
 				else:
 					await self.action(chan, 'the ascii gods have chosen... ' + color(name, cyan))
 					for line in ascii:
-						line = line.replace('\n','').replace('\r','')
 						try:
 							line = line.decode()
 						except:
-							line = line.encode(chardet.detect(line)['encoding']).decode() # Get fucked UTF-16
-						await self.sendmsg(chan, line + reset)
+							line = line.encode(chardet.detect(line)['encoding']).decode()  # Get fucked UTF-16
+						await self.sendmsg(chan, line.replace('\n','').replace('\r','') + reset)
 						await asyncio.sleep(self.settings['msg'])
 			else:
 				await self.irc_error(chan, 'invalid name', name)