From 8224d1120706fe29fcca506f536eb043224bbdd2 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Wed, 26 Sep 2018 05:50:44 +0200 Subject: [PATCH] smmry: use URLStack from urlreducer module --- modules/smmry.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/smmry.py b/modules/smmry.py index 711f672..ee3332d 100644 --- a/modules/smmry.py +++ b/modules/smmry.py @@ -10,6 +10,7 @@ from nemubot.hooks import hook from nemubot.tools import web from nemubot.module.more import Response +from nemubot.module.urlreducer import LAST_URLS # GLOBALS ############################################################# @@ -38,7 +39,11 @@ def load(context): }) def cmd_smmry(msg): if not len(msg.args): - raise IMException("indicate a text to sum up") + global LAST_URLS + if msg.channel in LAST_URLS and len(LAST_URLS[msg.channel]) > 0: + msg.args.append(LAST_URLS[msg.channel].pop()) + else: + raise IMException("I have no more URL to sum up.") res = Response(channel=msg.channel)