From 74000083846f1a887b4bbb877277975f05c82cdf Mon Sep 17 00:00:00 2001 From: Flame442 <34169552+Flame442@users.noreply.github.com> Date: Tue, 14 May 2019 01:05:52 -0400 Subject: [PATCH] Adds `[p]datapath` to print the bot's data path (#2652) * Add `[p]datapath` to print the bot's datapath * Adds 2652 --- docs/changelog_3_1_0.rst | 2 ++ redbot/core/core_commands.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/docs/changelog_3_1_0.rst b/docs/changelog_3_1_0.rst index 14a9e7ce3..0f706260b 100644 --- a/docs/changelog_3_1_0.rst +++ b/docs/changelog_3_1_0.rst @@ -38,6 +38,7 @@ Core * ``[p]listlocales`` now displays ``en-US`` (`#2553`_) * ``redbot --version`` will now give you current version of Red (`#2567`_) * Default locale changed from ``en`` to ``en-US`` (`#2642`_) + * New command ``[p]datapath`` that prints the bot's datapath (`#2652`_) ------ Config @@ -150,3 +151,4 @@ Utility Functions .. _#2620: https://github.com/Cog-Creators/Red-DiscordBot/pull/2620 .. _#2639: https://github.com/Cog-Creators/Red-DiscordBot/pull/2639 .. _#2642: https://github.com/Cog-Creators/Red-DiscordBot/pull/2642 +.. _#2652: https://github.com/Cog-Creators/Red-DiscordBot/pull/2652 diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 661ff7c8d..97f1bbcc3 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1380,6 +1380,16 @@ class Core(commands.Cog, CoreLogic): else: await ctx.send(_("Message delivered to {}").format(destination)) + @commands.command(hidden=True) + @checks.is_owner() + async def datapath(self, ctx: commands.Context): + """Prints the bot's data path.""" + from redbot.core.data_manager import basic_config + + data_dir = Path(basic_config["DATA_PATH"]) + msg = _("Data path: {path}").format(path=data_dir) + await ctx.send(box(msg)) + @commands.group() @checks.is_owner() async def whitelist(self, ctx: commands.Context):