Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@nickname_commands ('s', 'status')
@example ('s c251f09e-3c26-481f-96e0-4b5f58bd1170')
@require_chanmsg ()
def status (bot, trigger):
"""
Retrieve status for a job
"""
i = trigger.group(2)
q = bot.memory['crocoite']['q']
q.put_nowait (('status', trigger, i))
@nickname_commands ('r', 'revoke')
@example ('r c251f09e-3c26-481f-96e0-4b5f58bd1170')
@require_privilege (VOICE)
@require_chanmsg ()
def revoke (bot, trigger):
"""
Cancel (revoke) a job
"""
i = trigger.group(2)
q = bot.memory['crocoite']['q']
q.put_nowait (('revoke', trigger, i))
@nickname_commands ('a', 'archive')
@require_chanmsg ()
@require_privilege (VOICE)
@example ('a http://example.com')
def archive (bot, trigger):
"""
Archive a URL to WARC
"""
try:
args = archiveparser.parse_args (trigger.group (2).split ())
except Exception as e:
bot.reply ('{} -- {}'.format (e.args[0], archiveparser.format_usage ()))
return
if not args:
bot.reply ('Sorry, I don’t understand {}'.format (trigger.group (2)))
return