Eat youtube URLs on LOW priority, switch auto-title to MONITOR priority
This commit is contained in:
parent
9f6aa93082
commit
31367b2b5d
2 changed files with 5 additions and 2 deletions
|
@ -19,7 +19,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@utils.hook("received.message.channel")
|
@utils.hook("received.message.channel",
|
||||||
|
priority=EventManager.PRIORITY_MONITOR)
|
||||||
def channel_message(self, event):
|
def channel_message(self, event):
|
||||||
match = re.search(REGEX_URL, event["message"])
|
match = re.search(REGEX_URL, event["message"])
|
||||||
if match and event["channel"].get_setting("auto-title", False):
|
if match and event["channel"].get_setting("auto-title", False):
|
||||||
|
|
|
@ -124,7 +124,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
else:
|
else:
|
||||||
event["stderr"].write("No search phrase provided")
|
event["stderr"].write("No search phrase provided")
|
||||||
|
|
||||||
@utils.hook("received.message.channel")
|
@utils.hook("received.message.channel",
|
||||||
|
priority=EventManager.PRIORITY_LOW)
|
||||||
def channel_message(self, event):
|
def channel_message(self, event):
|
||||||
match = re.search(REGEX_YOUTUBE, event["message"])
|
match = re.search(REGEX_YOUTUBE, event["message"])
|
||||||
if match and event["channel"].get_setting("auto-youtube", False):
|
if match and event["channel"].get_setting("auto-youtube", False):
|
||||||
|
@ -134,3 +135,4 @@ class Module(ModuleManager.BaseModule):
|
||||||
self.events.on("send.stdout").call(target=event["channel"],
|
self.events.on("send.stdout").call(target=event["channel"],
|
||||||
message=video_details, module_name="Youtube",
|
message=video_details, module_name="Youtube",
|
||||||
server=event["server"])
|
server=event["server"])
|
||||||
|
event.eat()
|
||||||
|
|
Loading…
Reference in a new issue