From f0d30f1489d73ad2909ca2c85ed8174eeba7f1d3 Mon Sep 17 00:00:00 2001 From: Gordon Shumway <39967334+oddluck@users.noreply.github.com> Date: Thu, 2 May 2019 22:07:34 -0400 Subject: [PATCH] lift a2m extension restrictions --- ASCII/plugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ASCII/plugin.py b/ASCII/plugin.py index 813d870..3cefe15 100644 --- a/ASCII/plugin.py +++ b/ASCII/plugin.py @@ -622,7 +622,7 @@ class ASCII(callbacks.Plugin): delay = optlist.get('delay') else: delay = self.registryValue('delay', msg.args[0]) - if url.lower().endswith(".ans") or url.lower().endswith(".asc"): + try: file = requests.get(url) if "" in file.text: irc.reply("Error: ansi2irc requires a text file as input.", private=False, notice=False) @@ -659,8 +659,9 @@ class ASCII(callbacks.Plugin): except: return #irc.reply("Error. Did you set a valid Paste.ee API Key? https://paste.ee/account/api") - else: + except: irc.reply("Unexpected file type or link format", private=False, notice=False) + return a2m = wrap(a2m, [getopts({'l':'int', 'r':'int', 't':'int', 'w':'int', 'delay':'float'}), ('text')]) def p2u(self, irc, msg, args, optlist, url):