[Core] Co-owners cli flag only, implemented owner cli flag

After giving it further thought, I don't believe co-owners really need to be a command, as it is unlikely that co-owners will need to be changed often enough.
Furthermore, this gives a further layer of protection to people who like to gloss over warnings.
This commit is contained in:
Twentysix
2017-07-25 01:46:55 +02:00
parent 2fa5792f69
commit be5c7f4592
3 changed files with 20 additions and 44 deletions

View File

@@ -11,10 +11,10 @@ import asyncio
log = logging.getLogger("red")
OWNER_DISCLAIMER = ("Setting as owner people who do not have access to "
"the system that is hosting Red is **extremely "
"dangerous**.\n**Owners and co owners are able to access "
"any data that is present on the host system.**")
OWNER_DISCLAIMER = ("⚠ **Only** the person who is hosting Red should be "
"owner. **This has SERIOUS security implications. The "
"owner can access any data that is present on the host "
"system.**")
class Core:
@@ -281,38 +281,3 @@ class Core:
await ctx.send("You have been set as owner.")
else:
await ctx.send("Invalid token.")
@_set.command(aliases=["coowners"])
@checks.is_owner()
@commands.guild_only()
async def coowner(self, ctx, *coowners: discord.Member):
"""Sets Red's coowner(s)
Leave empty to reset"""
def check(m):
return m.author == ctx.author and m.channel == ctx.channel
coowners = [m.id for m in coowners]
if not coowners:
await ctx.bot.db.set("coowners", [])
await ctx.send("Coowners list cleared.")
return
await ctx.send("Remember:\n" + OWNER_DISCLAIMER)
await asyncio.sleep(5)
await ctx.send("Type `I understand` if you have read and understand "
"the above message.")
try:
message = await ctx.bot.wait_for("message", check=check,
timeout=60)
except asyncio.TimeoutError:
await ctx.send("The set owner request has timed out.")
else:
if message.content.lower().strip() == "i understand":
await ctx.bot.db.set("coowners", coowners)
await ctx.send("{} coowner(s) set.".format(len(coowners)))
else:
await ctx.send("Set coowner request aborted.")