From 98bc3d858915c7dcb81b01f9e98a551151c98b43 Mon Sep 17 00:00:00 2001 From: acidvegas Date: Wed, 28 Jun 2023 14:27:41 -0400 Subject: [PATCH] img2irc not awaited for now while in beta. default palette changed to RBG99 --- img2irc.py | 2 +- scroll.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/img2irc.py b/img2irc.py index 757b929..9753c4f 100644 --- a/img2irc.py +++ b/img2irc.py @@ -45,7 +45,7 @@ palettes = { 0xbcbcbc, 0xe2e2e2, 0xffffff] } -def convert(data, max_line_len, img_width=80, palette='RBG88'): +def convert(data, max_line_len, img_width=80, palette='RBG99'): if palette not in palettes: raise Exception('invalid palette option') palette = palettes[palette] diff --git a/scroll.py b/scroll.py index c4e787f..b6c7ba2 100644 --- a/scroll.py +++ b/scroll.py @@ -84,7 +84,7 @@ class Bot(): self.loops = dict() self.host = '' self.playing = False - self.settings = {'flood':1, 'ignore':'big,birds,doc,gorf,hang,nazi,pokemon', 'lines':500, 'msg':0.03, 'palette':'RBG88', 'paste':True, 'png_width':80, 'results':25} + self.settings = {'flood':1, 'ignore':'big,birds,doc,gorf,hang,nazi,pokemon', 'lines':500, 'msg':0.03, 'palette':'RBG99', 'paste':True, 'png_width':80, 'results':25} self.slow = False self.reader = None self.writer = None @@ -256,7 +256,7 @@ class Bot(): if url.startswith('https://') or url.startswith('http://'): try: content = get_url(url).read() - ascii = await img2irc.convert(content, 512 - len(f":{identity.nickname}!{identity.username}@{self.host} PRIVMSG {chan} :\r\n"), int(self.settings['png_width']), self.settings['palette']) + ascii = img2irc.convert(content, 512 - len(f":{identity.nickname}!{identity.username}@{self.host} PRIVMSG {chan} :\r\n"), int(self.settings['png_width']), self.settings['palette']) except Exception as ex: await self.irc_error(chan, 'failed to convert image', ex) else: