From a06a4bbe30f041dc0184e9cb5f223dbeac39b434 Mon Sep 17 00:00:00 2001 From: dgw Date: Tue, 20 Jul 2021 14:26:21 -0500 Subject: [PATCH] Use `BooleanAttribute` setting type (requires Sopel 7.1+) The person responsible for implementing this new setting type (also me) probably should have set it up to accept the old `ValidatedAttribute` style silently in 7.x, and start warning in 8.0, but oh well. Even if that's changed for an upcoming patch release of Sopel, this patch still needs to be written at some point. --- requirements.txt | 2 +- sopel_modules/youtube/youtube.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index da20ba5..0559158 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -sopel>=7.0,<8 +sopel>=7.1,<8 google-api-python-client>=1.5.5,<1.8 diff --git a/sopel_modules/youtube/youtube.py b/sopel_modules/youtube/youtube.py index 874b5d1..a35caae 100644 --- a/sopel_modules/youtube/youtube.py +++ b/sopel_modules/youtube/youtube.py @@ -12,6 +12,7 @@ import googleapiclient.errors from sopel.config.types import ( + BooleanAttribute, ListAttribute, StaticSection, ValidatedAttribute, @@ -93,7 +94,7 @@ class YoutubeSection(StaticSection): Available: uploader, date, length, views, comments, and votes_color or votes """ - playlist_watch = ValidatedAttribute('playlist_watch', bool, default=True) + playlist_watch = BooleanAttribute('playlist_watch', default=True) """ Whether to show playlist info if the list ID is embedded in a video watch link. """