Extract hooks
This commit is contained in:
parent
c8d495d508
commit
002f2463a3
9 changed files with 104 additions and 76 deletions
|
|
@ -22,8 +22,9 @@ def load(context):
|
|||
"http://developer.mapquest.com/")
|
||||
return None
|
||||
|
||||
from nemubot.hooks.messagehook import MessageHook
|
||||
context.add_hook("cmd_hook", MessageHook(cmd_geocode, "geocode"))
|
||||
import nemubot.hooks
|
||||
context.add_hook("cmd_hook",
|
||||
nemubot.hooks.Message(cmd_geocode, "geocode"))
|
||||
|
||||
|
||||
def help_full():
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ def load(CONF, add_hook):
|
|||
else:
|
||||
URL_WHOIS = URL_WHOIS % (urllib.parse.quote(CONF.getNode("whoisxmlapi")["username"]), urllib.parse.quote(CONF.getNode("whoisxmlapi")["password"]))
|
||||
|
||||
from nemubot.hooks.messagehook import MessageHook
|
||||
add_hook("cmd_hook", MessageHook(cmd_whois, "netwhois"))
|
||||
import nemubot.hooks
|
||||
add_hook("cmd_hook", nemubot.hooks.Message(cmd_whois, "netwhois"))
|
||||
|
||||
|
||||
def extractdate(str):
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ def load(context):
|
|||
else:
|
||||
URL_TPBAPI = context.config.getNode("tpbapi")["url"]
|
||||
|
||||
from nemubot.hooks.messagehook import MessageHook
|
||||
context.add_hook("cmd_hook", MessageHook(cmd_tpb, "tpb"))
|
||||
from nemubot.hooks.message import Message
|
||||
context.add_hook("cmd_hook", Message(cmd_tpb, "tpb"))
|
||||
|
||||
|
||||
def cmd_tpb(msg):
|
||||
|
|
|
|||
|
|
@ -28,8 +28,9 @@ def load(context):
|
|||
else:
|
||||
URL = URL % context.config.getNode("wrapi")["key"]
|
||||
|
||||
from nemubot.hooks.messagehook import MessageHook
|
||||
context.add_hook("cmd_hook", MessageHook(cmd_translate, "translate"))
|
||||
import nemubot.hooks
|
||||
context.add_hook("cmd_hook",
|
||||
nemubot.hooks.Message(cmd_translate, "translate"))
|
||||
|
||||
|
||||
def help_full():
|
||||
|
|
|
|||
|
|
@ -29,10 +29,13 @@ def load(context):
|
|||
"http://developer.forecast.io/")
|
||||
return None
|
||||
|
||||
from nemubot.hooks.messagehook import MessageHook
|
||||
context.add_hook("cmd_hook", MessageHook(cmd_weather, "météo"))
|
||||
context.add_hook("cmd_hook", MessageHook(cmd_alert, "alert"))
|
||||
context.add_hook("cmd_hook", MessageHook(cmd_coordinates, "coordinates"))
|
||||
import nemubot.hooks
|
||||
context.add_hook("cmd_hook",
|
||||
nemubot.hooks.Message(cmd_weather, "météo"))
|
||||
context.add_hook("cmd_hook",
|
||||
nemubot.hooks.Message(cmd_alert, "alert"))
|
||||
context.add_hook("cmd_hook",
|
||||
nemubot.hooks.Message(cmd_coordinates, "coordinates"))
|
||||
|
||||
|
||||
def help_full ():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue