Add hastebin support

This commit is contained in:
Peter Ajamian 2019-08-14 15:32:19 +12:00
parent 9383139d03
commit c55998bfc1
2 changed files with 6 additions and 1 deletions

View File

@ -38,7 +38,7 @@ from supybot import world
# Use this for the version of this plugin. You may wish to put a CVS keyword
# in here if you're keeping the plugin in CVS or some similar system.
__version__ = "0.2"
__version__ = "0.3"
# XXX Replace this with an appropriate author or supybot.Author instance.
__author__ = supybot.Author('Peter Ajamian', 'pj', 'peter@pajamian.dhs.org')

View File

@ -56,9 +56,14 @@ class Pastebin2cpaste(callbacks.Plugin):
'paste.fedoraproject.org': {
'regex': re.compile(r'([0-9a-zA-Z~-]+)(?:/raw)?[.:?!,]*$'),
'url': 'https://paste.fedoraproject.org/paste/%s/raw'
},
'hastebin.com': {
'regex': re.compile(r'/([a-z]+)(?:\.[a-z]+)?[.:?!,]*$'),
'url': 'https://hastebin.com/raw/%s'
}
}
def doPrivmsg(self, irc, msg):
if ircmsgs.isCtcp(msg) and not ircmsgs.isAction(msg):
return