Table of contents
- Data Manager
- redbot.core.data_manager.bundled_data_path(cog_instance)
- redbot.core.data_manager.cog_data_path(cog_instance=None, raw_name=None)
- redbot.core.data_manager.data_path()
- redbot.core.data_manager.instance_name()
- redbot.core.data_manager.metadata_file()
- redbot.core.data_manager.storage_details()
- redbot.core.data_manager.storage_type()
This page is generated from
docs/framework_datamanager.rst- please edit the source file instead of this page.
Data Manager
Data manager is a module that handles all the information necessary to bootstrap the bot into a state where more abstract data management systems can take over.
redbot.core.data_manager.bundled_data_path(cog_instance)
Get the path to the "data" directory bundled with this cog.
The bundled data folder must be located alongside the .py file
which contains the cog class.
IMPORTANT
You should NEVER write to this directory.
- Parameters:
cog_instance -- An instance of your cog. If calling from a command or method of
your cog, this should be
self. - Returns: Path object to the bundled data folder.
- Return type: pathlib.Path
- Raises: FileNotFoundError -- If no bundled data folder exists.
redbot.core.data_manager.cog_data_path(cog_instance=None, raw_name=None)
Gets the base cog data path. If you want to get the folder with which to store your own cog's data please pass in an instance of your cog class.
Either cog_instance or raw_name will be used, not both.
- Parameters:
- cog_instance -- The instance of the cog you wish to get a data path for.
If calling from a command or method of your cog, this should be
self. - raw_name (str) -- The name of the cog to get a data path for.
- cog_instance -- The instance of the cog you wish to get a data path for.
If calling from a command or method of your cog, this should be
- Returns:
If
cog_instanceis provided it will return a path to a folder dedicated to a given cog. Otherwise it will return a path to the folder that contains data for all cogs. - Return type: pathlib.Path
redbot.core.data_manager.data_path()
Gets the base data path.
- Returns: Storage type.
- Return type: str
redbot.core.data_manager.instance_name()
Gets instance's name.
These are set on setup.
- Returns: Instance name.
- Return type: str
redbot.core.data_manager.metadata_file()
Gets the path of metadata file.
- Returns: Storage type.
- Return type: str
redbot.core.data_manager.storage_details()
Gets any details necessary for config drivers to load.
These are set on setup.
redbot.core.data_manager.storage_type()
Gets the storage type as a string.
- Returns: Storage type.
- Return type: str
Installation Guides
- Installing Red
- Creating a bot account
- Updating Red
- Backing Up and Restoring Red
- About Virtual Environments
- Setting up auto-restart using batch on Windows
- Setting up auto-restart on Mac
- Setting up auto-restart using systemd on Linux
Cog Reference
User guides
- Getting started
- Running Red on Fluxer
- About Privileged Intents
- About public (big) bots
- Admin
- Alias
- Audio
- Cleanup
- Cog Manager UI
- Core
- CustomCommands
- Dev
- Downloader
- Economy
- Filter
- General
- Image
- Permissions
- Mod
- ModLog
- Mutes
- Reports
- Streams
- Trivia
- Warnings
- Red and End User Data
Cog Creation Guides
- Creating cogs for Red
- Slash Commands and Interactions
- Publishing cogs for Red
- Becoming an Approved Cog Creator
- Versioning
- End-user Guarantees
- Developer Guarantees
- Breaking Change Notices
Cog Development Framework Reference
- Shared API Keys
- Bank
- Bot
- Command Check Decorators
- App Command Check Decorators
- Commands Package
- App Commands Package
- Config
- Data Manager
- Custom Events
- Internationalization Framework
- Mod log
- RPC
- Tree
- Utility Functions
Others
Legacy (Red V2)