mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-08 12:18:54 -05:00
[Downloader] Reworded disclaimer, show only once every session
This commit is contained in:
parent
f2fc5330fa
commit
146d9df460
@ -20,6 +20,13 @@ REPO_CLONE = 0x2
|
||||
REPO_SAME = 0x4
|
||||
REPOS_LIST = "https://twentysix26.github.io/Red-Docs/red_cog_approved_repos/"
|
||||
|
||||
DISCLAIMER = ("You're about to add a 3rd party repository. The creator of Red"
|
||||
" and its community have no responsibility for any potential "
|
||||
"damage that the content of 3rd party repositories might cause."
|
||||
"\nBy typing 'I agree' you declare to have read and understand "
|
||||
"the above message. This message won't be shown again until the"
|
||||
" next reboot.")
|
||||
|
||||
|
||||
class UpdateError(Exception):
|
||||
pass
|
||||
@ -38,6 +45,7 @@ class Downloader:
|
||||
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self.disclaimer_accepted = False
|
||||
self.path = "data/downloader/"
|
||||
self.file_path = "data/downloader/repos.json"
|
||||
# {name:{url,cog1:{installed},cog1:{installed}}}
|
||||
@ -69,24 +77,18 @@ class Downloader:
|
||||
|
||||
Warning: Adding 3RD Party Repositories is at your own
|
||||
Risk."""
|
||||
await self.bot.say("Type 'I agree' to confirm "
|
||||
"adding a 3rd party repo. This has the possibility"
|
||||
" of being harmful. You will not receive help "
|
||||
"in Red - Discord Bot #support for any cogs "
|
||||
"installed from this repo. If you do require "
|
||||
"support you should contact the owner of this "
|
||||
"repo.\n\nAgain, ANY repo you add is at YOUR"
|
||||
" discretion and the creator of Red has "
|
||||
"ABSOLUTELY ZERO responsibility to help if "
|
||||
"something goes wrong.")
|
||||
answer = await self.bot.wait_for_message(timeout=15,
|
||||
author=ctx.message.author)
|
||||
if answer is None:
|
||||
await self.bot.say('Not adding repo.')
|
||||
return
|
||||
elif "i agree" not in answer.content.lower():
|
||||
await self.bot.say('Not adding repo.')
|
||||
return
|
||||
if not self.disclaimer_accepted:
|
||||
await self.bot.say(DISCLAIMER)
|
||||
answer = await self.bot.wait_for_message(timeout=30,
|
||||
author=ctx.message.author)
|
||||
if answer is None:
|
||||
await self.bot.say('Not adding repo.')
|
||||
return
|
||||
elif "i agree" not in answer.content.lower():
|
||||
await self.bot.say('Not adding repo.')
|
||||
return
|
||||
else:
|
||||
self.disclaimer_accepted = True
|
||||
self.repos[repo_name] = {}
|
||||
self.repos[repo_name]['url'] = repo_url
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user