From 4e2b83c0523637b2d7d9116031ba0283b6442b6d Mon Sep 17 00:00:00 2001 From: palmtree5 <3577255+palmtree5@users.noreply.github.com> Date: Sat, 24 Mar 2018 13:27:04 -0800 Subject: [PATCH] [V3 Docs] Add and update existing features (#1451) * [V3 Docs] bump version * Remove removed functions from __all__ * Update docstring format * Update copyright year * Add embed utils docs * Document bot class * Document RPC * Update toctree --- docs/conf.py | 6 +++--- docs/framework_bot.rst | 19 +++++++++++++++++++ docs/framework_rpc.rst | 8 ++++++++ docs/framework_utils.rst | 6 ++++++ docs/index.rst | 7 +++++-- redbot/core/bank.py | 7 +++---- redbot/core/rpc.py | 17 +++++++++++------ 7 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 docs/framework_bot.rst create mode 100644 docs/framework_rpc.rst diff --git a/docs/conf.py b/docs/conf.py index 5198f1ade..bd9f71a6a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,7 +55,7 @@ master_doc = 'index' # General information about the project. project = 'Red - Discord Bot' -copyright = '2017, Cog Creators' +copyright = '2018, Cog Creators' author = 'Cog Creators' # The version info for the project you're documenting, acts as replacement for @@ -63,9 +63,9 @@ author = 'Cog Creators' # built documents. # # The short X.Y version. -version = '3.0.0a1' +version = '3.0.0b10' # The full version, including alpha/beta/rc tags. -release = '3.0.0a1' +release = '3.0.0b10' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/framework_bot.rst b/docs/framework_bot.rst new file mode 100644 index 000000000..37fa819cd --- /dev/null +++ b/docs/framework_bot.rst @@ -0,0 +1,19 @@ +.. bot module docs + +=== +Bot +=== + +.. automodule:: redbot.core.bot + +RedBase +^^^^^^^ + +.. autoclass:: RedBase + :members: + +Red +^^^ + +.. autoclass:: Red + :members: diff --git a/docs/framework_rpc.rst b/docs/framework_rpc.rst new file mode 100644 index 000000000..e27f9d02a --- /dev/null +++ b/docs/framework_rpc.rst @@ -0,0 +1,8 @@ +.. rpc docs + +=== +RPC +=== + +.. automodule:: redbot.core.rpc + :members: diff --git a/docs/framework_utils.rst b/docs/framework_utils.rst index 2b93531b9..55c13e55c 100644 --- a/docs/framework_utils.rst +++ b/docs/framework_utils.rst @@ -10,6 +10,12 @@ Chat Formatting .. automodule:: redbot.core.utils.chat_formatting :members: +Embed Helpers +============= + +.. automodule:: redbot.core.utils.embed + :members: + Mod Helpers =========== diff --git a/docs/index.rst b/docs/index.rst index 80a6bacb7..65d4f835b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -30,13 +30,16 @@ Welcome to Red - Discord Bot's documentation! guide_migration guide_cog_creation framework_bank + framework_bot framework_cogmanager - framework_datamanager framework_config + framework_context + framework_datamanager framework_downloader + framework_events framework_i18n framework_modlog - framework_context + framework_rpc framework_utils diff --git a/redbot/core/bank.py b/redbot/core/bank.py index 1130850f0..4b080348d 100644 --- a/redbot/core/bank.py +++ b/redbot/core/bank.py @@ -7,10 +7,9 @@ import discord from redbot.core import Config __all__ = ["Account", "get_balance", "set_balance", "withdraw_credits", "deposit_credits", - "can_spend", "transfer_credits", "wipe_bank", "get_guild_accounts", - "get_global_accounts", "get_account", "is_global", "set_global", - "get_bank_name", "set_bank_name", "get_currency_name", "set_currency_name", - "get_default_balance", "set_default_balance"] + "can_spend", "transfer_credits", "wipe_bank", "get_account", "is_global", + "set_global", "get_bank_name", "set_bank_name", "get_currency_name", + "set_currency_name", "get_default_balance", "set_default_balance"] _DEFAULT_GLOBAL = { "is_global": False, diff --git a/redbot/core/rpc.py b/redbot/core/rpc.py index 2aeb7bc7f..323477406 100644 --- a/redbot/core/rpc.py +++ b/redbot/core/rpc.py @@ -35,7 +35,9 @@ def add_topic(topic_name: str): """ Adds a topic for clients to listen to. - :param topic_name: + Parameters + ---------- + topic_name """ _rpc.add_topics(topic_name) @@ -50,8 +52,10 @@ def notify(topic_name: str, data: JsonSerializable): This method will fail silently. - :param topic_name: - :param data: + Parameters + ---------- + topic_name + data """ _rpc.notify(topic_name, data) @@ -67,10 +71,11 @@ def add_method(prefix, method): This method will fail silently. - :param prefix: - :param method: + Parameters + ---------- + prefix + method MUST BE A COROUTINE OR OBJECT. - :return: """ _rpc.add_methods( ('', method),