Red-DiscordBot/docs/framework_downloader.rst
jack1142 24ac111782 [V3 Downloader] Allow to specify minimum and maximum bot version in info.json (#2605)
* feat(downloader): add `min_bot_version` and `max_bot_version`

Adds actually working way of specifying minimum and maximum bot version and removes not working
`bot_version`

BREAKING CHANGE: - removal of `bot_version` attribute in `Installable`

* test(downloader): `Installable` tests fix for new bot version attributes

* docs(changelog): added changelog entries for this PR
2019-04-29 12:33:49 -04:00

91 lines
2.6 KiB
ReStructuredText

.. downloader framework reference
Downloader Framework
====================
Info.json
*********
The optional info.json file may exist inside every package folder in the repo,
as well as in the root of the repo. The following sections describe the valid
keys within an info file (and maybe how the Downloader cog uses them).
Keys common to both repo and cog info.json (case sensitive)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- ``author`` (list of strings) - list of names of authors of the cog or repo.
- ``description`` (string) - A long description of the cog or repo. For cogs, this
is displayed when a user executes ``!cog info``.
- ``install_msg`` (string) - The message that gets displayed when a cog
is installed or a repo is added
.. tip:: You can use the ``[p]`` key in your string to use the prefix
used for installing.
- ``short`` (string) - A short description of the cog or repo. For cogs, this info
is displayed when a user executes ``!cog list``
Keys specific to the cog info.json (case sensitive)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- ``min_bot_version`` (string) - Min version number of Red in the format ``MAJOR.MINOR.MICRO``
- ``max_bot_version`` (string) - Max version number of Red in the format ``MAJOR.MINOR.MICRO``,
if ``min_bot_version`` is newer than ``max_bot_version``, ``max_bot_version`` will be ignored
- ``hidden`` (bool) - Determines if a cog is visible in the cog list for a repo.
- ``disabled`` (bool) - Determines if a cog is available for install.
- ``required_cogs`` (map of cogname to repo URL) - A map of required cogs that this cog depends on.
Downloader will not deal with this functionality but it may be useful for other cogs.
- ``requirements`` (list of strings) - list of required libraries that are
passed to pip on cog install. ``SHARED_LIBRARIES`` do NOT go in this
list.
- ``tags`` (list of strings) - A list of strings that are related to the
functionality of the cog. Used to aid in searching.
- ``type`` (string) - Optional, defaults to ``COG``. Must be either ``COG`` or
``SHARED_LIBRARY``. If ``SHARED_LIBRARY`` then ``hidden`` will be ``True``.
API Reference
*************
.. automodule:: redbot.cogs.downloader.json_mixins
.. autoclass RepoJSONMixin
:members
.. automodule:: redbot.cogs.downloader.installable
Installable
^^^^^^^^^^^
.. autoclass:: Installable
:members:
.. automodule:: redbot.cogs.downloader.repo_manager
Repo
^^^^
.. autoclass:: Repo
:members:
Repo Manager
^^^^^^^^^^^^
.. autoclass:: RepoManager
:members:
Exceptions
^^^^^^^^^^
.. automodule:: redbot.cogs.downloader.errors
:members: