Fixed line stripping

This commit is contained in:
Dionysus 2023-06-25 02:50:29 -04:00
parent a57316332f
commit 36fce2ff81
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
1 changed files with 2 additions and 3 deletions

View File

@ -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)