disable !np youtube urls by default
This commit is contained in:
parent
73371b5571
commit
8d932ccc34
1 changed files with 11 additions and 4 deletions
|
@ -7,8 +7,13 @@ from src import ModuleManager, utils
|
|||
|
||||
URL_SCROBBLER = "http://ws.audioscrobbler.com/2.0/"
|
||||
|
||||
SETTING_YT = utils.BoolSetting("lastfm-youtube",
|
||||
"Whether or not to search last.fm now-playing results on youtube")
|
||||
|
||||
@utils.export("set", utils.Setting("lastfm", "Set last.fm username",
|
||||
example="jesopo"))
|
||||
@utils.export("botset", SETTING_YT)
|
||||
@utils.export("serverset", SETTING_YT)
|
||||
class Module(ModuleManager.BaseModule):
|
||||
_name = "last.fm"
|
||||
|
||||
|
@ -59,9 +64,11 @@ class Module(ModuleManager.BaseModule):
|
|||
|
||||
time_language = "is listening to" if np else "last listened to"
|
||||
|
||||
yt_url_str = ""
|
||||
if event["server"].get_setting("lastfm-youtube",
|
||||
self.bot.get_setting("lastfm-youtube", False)):
|
||||
yt_url = self.exports.get("search-youtube")(
|
||||
"%s - %s" % (artist, track_name))
|
||||
yt_url_str = ""
|
||||
if yt_url:
|
||||
yt_url_str = " - %s" % yt_url
|
||||
|
||||
|
|
Loading…
Reference in a new issue