From 4fc02002f9740d57022a1c2a458c7930e351218e Mon Sep 17 00:00:00 2001 From: Gordon Shumway <39967334+oddluck@users.noreply.github.com> Date: Fri, 22 Mar 2019 18:33:46 -0400 Subject: [PATCH] allow scroll from pastebin raw links --- ASCII/plugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ASCII/plugin.py b/ASCII/plugin.py index b4477e9..4abe753 100644 --- a/ASCII/plugin.py +++ b/ASCII/plugin.py @@ -376,12 +376,14 @@ class ASCII(callbacks.Plugin): Play ASCII/ANSI art files from web links """ file = requests.get(url) - if "html" in file.text or not url.endswith(".txt"): + if "html" in file.text: irc.reply("Error: Scroll requires a text file as input.") - else: + elif url.endswith(".txt") or url.startswith("https://pastebin.com/raw/"): for line in file.text.splitlines(): if line.strip(): irc.reply(line, prefixNick = False) + else: + irc.reply("Unexpected file type or link format") scroll = wrap(scroll, ['text']) Class = ASCII