Skip to content

Commit

Permalink
Adds [p]datapath to print the bot's data path (#2652)
Browse files Browse the repository at this point in the history
* Add `[p]datapath` to print the bot's datapath

* Adds 2652
  • Loading branch information
Flame442 authored and Michael H committed May 14, 2019
1 parent 4e564e8 commit 7400008
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/changelog_3_1_0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
10 changes: 10 additions & 0 deletions redbot/core/core_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,16 @@ async def dm(self, ctx: commands.Context, user_id: int, *, message: str):
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):
Expand Down

0 comments on commit 7400008

Please sign in to comment.