From 8b8c59ee213a4c006f90767fe379030d4a1e1524 Mon Sep 17 00:00:00 2001 From: dngfx <294904+dngfx@users.noreply.github.com> Date: Sun, 23 Sep 2018 10:23:12 +0100 Subject: [PATCH] Rename the functions to be more generic. --- modules/lastfm.py | 2 +- modules/youtube.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/lastfm.py b/modules/lastfm.py index 0d6873a2..68b6249b 100644 --- a/modules/lastfm.py +++ b/modules/lastfm.py @@ -50,7 +50,7 @@ class Module(object): ytquery = " - ".join([artist, track_name]) short_url = self.events.on( - "get.youtubefromlastfm").call_for_result( + "get.searchyoutube").call_for_result( query=ytquery) short_url = " -- " + short_url if short_url else "" diff --git a/modules/youtube.py b/modules/youtube.py index 20dc072b..c70e9ef8 100644 --- a/modules/youtube.py +++ b/modules/youtube.py @@ -24,7 +24,7 @@ class Module(object): help="Find a video on youtube", usage="[query]") events.on("received.message.channel").hook(self.channel_message) - events.on("get.youtubefromlastfm").hook(self.get_yt_from_lastfm) + events.on("get.searchyoutube").hook(self.search_video) exports.add("channelset", {"setting": "auto-youtube", "help": "Disable/Enable automatically getting info from " @@ -65,7 +65,7 @@ class Module(object): video_title, video_duration, video_uploader, "{:,}".format( int(video_views)), video_opinions, URL_YOUTUBESHORT % video_id) - def get_yt_from_lastfm(self, event): + def search_video(self, event): search = event["query"] video_id = ""