aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/tags.py16
-rw-r--r--bot/resources/tags/ytdl.md8
2 files changed, 15 insertions, 9 deletions
diff --git a/bot/cogs/tags.py b/bot/cogs/tags.py
index ff3be7f4a..4895bd807 100644
--- a/bot/cogs/tags.py
+++ b/bot/cogs/tags.py
@@ -7,19 +7,20 @@ from typing import Callable, Dict, Iterable, List, Optional
from discord import Colour, Embed
from discord.ext.commands import Cog, Context, group
+from bot import constants
from bot.bot import Bot
-from bot.constants import Channels, Cooldowns
from bot.converters import TagNameConverter
from bot.pagination import LinePaginator
log = logging.getLogger(__name__)
TEST_CHANNELS = (
- Channels.bot_commands,
- Channels.helpers
+ constants.Channels.bot_commands,
+ constants.Channels.helpers
)
REGEX_NON_ALPHABET = re.compile(r"[^a-z]", re.MULTILINE & re.IGNORECASE)
+FOOTER_TEXT = f"To show a tag, type {constants.Bot.prefix}tags <tagname>."
class Tags(Cog):
@@ -133,7 +134,7 @@ class Tags(Cog):
sorted(f"**»** {tag['title']}" for tag in matching_tags),
ctx,
embed,
- footer_text="To show a tag, type !tags <tagname>.",
+ footer_text=FOOTER_TEXT,
empty=False,
max_lines=15
)
@@ -177,7 +178,7 @@ class Tags(Cog):
cooldown_conditions = (
tag_name
and tag_name in self.tag_cooldowns
- and (now - self.tag_cooldowns[tag_name]["time"]) < Cooldowns.tags
+ and (now - self.tag_cooldowns[tag_name]["time"]) < constants.Cooldowns.tags
and self.tag_cooldowns[tag_name]["channel"] == ctx.channel.id
)
@@ -186,7 +187,8 @@ class Tags(Cog):
return False
if _command_on_cooldown(tag_name):
- time_left = Cooldowns.tags - (time.time() - self.tag_cooldowns[tag_name]["time"])
+ time_elapsed = time.time() - self.tag_cooldowns[tag_name]["time"]
+ time_left = constants.Cooldowns.tags - time_elapsed
log.info(
f"{ctx.author} tried to get the '{tag_name}' tag, but the tag is on cooldown. "
f"Cooldown ends in {time_left:.1f} seconds."
@@ -223,7 +225,7 @@ class Tags(Cog):
sorted(f"**»** {tag['title']}" for tag in tags),
ctx,
embed,
- footer_text="To show a tag, type !tags <tagname>.",
+ footer_text=FOOTER_TEXT,
empty=False,
max_lines=15
)
diff --git a/bot/resources/tags/ytdl.md b/bot/resources/tags/ytdl.md
index 4c47b0595..e34ecff44 100644
--- a/bot/resources/tags/ytdl.md
+++ b/bot/resources/tags/ytdl.md
@@ -2,7 +2,11 @@ Per [PyDis' Rule 5](https://pythondiscord.com/pages/rules), we are unable to ass
For reference, this usage is covered by the following clauses in [YouTube's TOS](https://www.youtube.com/static?template=terms), as of 2019-07-22:
```
-The following restrictions apply to your use of the Service. You are not allowed to:
+The following restrictions apply to your use of the Service. You are not allowed to:
-3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
+1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
+
+3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
+
+9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
```