diff --git a/changelog.d/2928.removal.rst b/changelog.d/2928.removal.rst new file mode 100644 index 000000000..1a4bbee23 --- /dev/null +++ b/changelog.d/2928.removal.rst @@ -0,0 +1 @@ +The ``set owner`` and ``set token`` commands have been removed in favor of managing server side. \ No newline at end of file diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index df07caad9..77ba280d3 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1078,81 +1078,6 @@ class Core(commands.Cog, CoreLogic): await ctx.bot.db.guild(ctx.guild).prefix.set(prefixes) await ctx.send(_("Prefix set.")) - @_set.command() - @commands.cooldown(1, 60 * 10, commands.BucketType.default) - async def owner(self, ctx: commands.Context): - """Sets Red's main owner""" - # According to the Python docs this is suitable for cryptographic use - random = SystemRandom() - length = random.randint(25, 35) - chars = ascii_letters + digits - token = "" - - for i in range(length): - token += random.choice(chars) - log.info(_("{0} ({0.id}) requested to be set as owner.").format(ctx.author)) - print(_("\nVerification token:")) - print(token) - - 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.** ⚠" - ) - await ctx.send(_("Remember:\n") + owner_disclaimer) - await asyncio.sleep(5) - - await ctx.send( - _( - "I have printed a one-time token in the console. " - "Copy and paste it here to confirm you are the owner." - ) - ) - - try: - message = await ctx.bot.wait_for( - "message", check=MessagePredicate.same_context(ctx), timeout=60 - ) - except asyncio.TimeoutError: - ctx.command.reset_cooldown(ctx) - await ctx.send( - _("The `{prefix}set owner` request has timed out.").format(prefix=ctx.prefix) - ) - else: - if message.content.strip() == token: - ctx.command.reset_cooldown(ctx) - await ctx.bot.db.owner.set(ctx.author.id) - ctx.bot.owner_id = ctx.author.id - await ctx.send(_("You have been set as owner.")) - else: - await ctx.send(_("Invalid token.")) - - @_set.command() - @checks.is_owner() - async def token(self, ctx: commands.Context, token: str): - """Change bot token.""" - - if not isinstance(ctx.channel, discord.DMChannel): - - try: - await ctx.message.delete() - except discord.Forbidden: - pass - - await ctx.send( - _( - "Please use that command in DM. Since users probably saw your token," - " it is recommended to reset it right now. Go to the following link and" - " select `Reveal Token` and `Generate a new token?`." - "\n\nhttps://discordapp.com/developers/applications/me/{}" - ).format(self.bot.user.id) - ) - return - - await ctx.bot.db.token.set(token) - await ctx.send(_("Token set. Restart me.")) - @_set.command() @checks.is_owner() async def locale(self, ctx: commands.Context, locale_name: str):