smmry: use URLStack from urlreducer module
This commit is contained in:
parent
15064204d8
commit
8224d11207
@ -10,6 +10,7 @@ from nemubot.hooks import hook
|
|||||||
from nemubot.tools import web
|
from nemubot.tools import web
|
||||||
|
|
||||||
from nemubot.module.more import Response
|
from nemubot.module.more import Response
|
||||||
|
from nemubot.module.urlreducer import LAST_URLS
|
||||||
|
|
||||||
|
|
||||||
# GLOBALS #############################################################
|
# GLOBALS #############################################################
|
||||||
@ -38,7 +39,11 @@ def load(context):
|
|||||||
})
|
})
|
||||||
def cmd_smmry(msg):
|
def cmd_smmry(msg):
|
||||||
if not len(msg.args):
|
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)
|
res = Response(channel=msg.channel)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user