Eat youtube URLs on LOW priority, switch auto-title to MONITOR priority

This commit is contained in:
jesopo 2019-02-09 10:56:06 +00:00
parent 9f6aa93082
commit 31367b2b5d
2 changed files with 5 additions and 2 deletions

View file

@ -19,7 +19,8 @@ class Module(ModuleManager.BaseModule):
else:
return None
@utils.hook("received.message.channel")
@utils.hook("received.message.channel",
priority=EventManager.PRIORITY_MONITOR)
def channel_message(self, event):
match = re.search(REGEX_URL, event["message"])
if match and event["channel"].get_setting("auto-title", False):

View file

@ -124,7 +124,8 @@ class Module(ModuleManager.BaseModule):
else:
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):
match = re.search(REGEX_YOUTUBE, event["message"])
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"],
message=video_details, module_name="Youtube",
server=event["server"])
event.eat()