From 6534be809997f0b31ec7db0306ba0570c79c816c Mon Sep 17 00:00:00 2001 From: ChrisLovering Date: Sat, 2 Apr 2022 19:13:10 +0000 Subject: Deploying to docs from @ python-discord/bot-core@765284a5e436f7786619a5ba4c312d75df5e9dee 🚀 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .doctrees/environment.pickle | Bin 2335235 -> 2346392 bytes .doctrees/output/botcore.async_stats.doctree | Bin 0 -> 19339 bytes .doctrees/output/botcore.doctree | Bin 4075 -> 57463 bytes .doctrees/output/botcore.site_api.doctree | Bin 66675 -> 66675 bytes .doctrees/output/botcore.utils.caching.doctree | Bin 16693 -> 16693 bytes .doctrees/output/botcore.utils.channel.doctree | Bin 18252 -> 18252 bytes .doctrees/output/botcore.utils.doctree | Bin 10416 -> 10374 bytes .doctrees/output/botcore.utils.extensions.doctree | Bin 12371 -> 0 bytes .doctrees/output/botcore.utils.logging.doctree | Bin 18516 -> 18516 bytes .doctrees/output/botcore.utils.members.doctree | Bin 17177 -> 17177 bytes .doctrees/output/botcore.utils.regex.doctree | Bin 7664 -> 7664 bytes .doctrees/output/botcore.utils.scheduling.doctree | Bin 56366 -> 56366 bytes _sources/output/botcore.async_stats.rst.txt | 7 + _sources/output/botcore.rst.txt | 1 + _sources/output/botcore.utils.extensions.rst.txt | 7 - _sources/output/botcore.utils.rst.txt | 1 - _static/statsd_additional_objects.inv | Bin 0 -> 308 bytes genindex.html | 102 ++++++-- index.html | 3 +- objects.inv | Bin 931 -> 1088 bytes output/botcore.async_stats.html | 306 ++++++++++++++++++++++ output/botcore.exts.html | 2 +- output/botcore.html | 166 +++++++++++- output/botcore.site_api.html | 34 +-- output/botcore.utils.caching.html | 10 +- output/botcore.utils.channel.html | 12 +- output/botcore.utils.extensions.html | 306 ---------------------- output/botcore.utils.html | 5 +- output/botcore.utils.logging.html | 14 +- output/botcore.utils.members.html | 6 +- output/botcore.utils.regex.html | 8 +- output/botcore.utils.scheduling.html | 26 +- py-modindex.html | 14 +- search.html | 2 +- searchindex.js | 2 +- 35 files changed, 623 insertions(+), 411 deletions(-) create mode 100644 .doctrees/output/botcore.async_stats.doctree delete mode 100644 .doctrees/output/botcore.utils.extensions.doctree create mode 100644 _sources/output/botcore.async_stats.rst.txt delete mode 100644 _sources/output/botcore.utils.extensions.rst.txt create mode 100644 _static/statsd_additional_objects.inv create mode 100644 output/botcore.async_stats.html delete mode 100644 output/botcore.utils.extensions.html diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index 1c5e09f7..3fe56e9f 100644 Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ diff --git a/.doctrees/output/botcore.async_stats.doctree b/.doctrees/output/botcore.async_stats.doctree new file mode 100644 index 00000000..1364d5d5 Binary files /dev/null and b/.doctrees/output/botcore.async_stats.doctree differ diff --git a/.doctrees/output/botcore.doctree b/.doctrees/output/botcore.doctree index 47712525..a8020c42 100644 Binary files a/.doctrees/output/botcore.doctree and b/.doctrees/output/botcore.doctree differ diff --git a/.doctrees/output/botcore.site_api.doctree b/.doctrees/output/botcore.site_api.doctree index ebddffcb..6794a846 100644 Binary files a/.doctrees/output/botcore.site_api.doctree and b/.doctrees/output/botcore.site_api.doctree differ diff --git a/.doctrees/output/botcore.utils.caching.doctree b/.doctrees/output/botcore.utils.caching.doctree index 0f918c18..15f2f866 100644 Binary files a/.doctrees/output/botcore.utils.caching.doctree and b/.doctrees/output/botcore.utils.caching.doctree differ diff --git a/.doctrees/output/botcore.utils.channel.doctree b/.doctrees/output/botcore.utils.channel.doctree index 052b9710..4dfde4ab 100644 Binary files a/.doctrees/output/botcore.utils.channel.doctree and b/.doctrees/output/botcore.utils.channel.doctree differ diff --git a/.doctrees/output/botcore.utils.doctree b/.doctrees/output/botcore.utils.doctree index a51c841e..e20b5231 100644 Binary files a/.doctrees/output/botcore.utils.doctree and b/.doctrees/output/botcore.utils.doctree differ diff --git a/.doctrees/output/botcore.utils.extensions.doctree b/.doctrees/output/botcore.utils.extensions.doctree deleted file mode 100644 index aeeb664b..00000000 Binary files a/.doctrees/output/botcore.utils.extensions.doctree and /dev/null differ diff --git a/.doctrees/output/botcore.utils.logging.doctree b/.doctrees/output/botcore.utils.logging.doctree index 02bbf350..fa2cc095 100644 Binary files a/.doctrees/output/botcore.utils.logging.doctree and b/.doctrees/output/botcore.utils.logging.doctree differ diff --git a/.doctrees/output/botcore.utils.members.doctree b/.doctrees/output/botcore.utils.members.doctree index d636ea53..5ef3cab5 100644 Binary files a/.doctrees/output/botcore.utils.members.doctree and b/.doctrees/output/botcore.utils.members.doctree differ diff --git a/.doctrees/output/botcore.utils.regex.doctree b/.doctrees/output/botcore.utils.regex.doctree index 6608e6ef..351cea20 100644 Binary files a/.doctrees/output/botcore.utils.regex.doctree and b/.doctrees/output/botcore.utils.regex.doctree differ diff --git a/.doctrees/output/botcore.utils.scheduling.doctree b/.doctrees/output/botcore.utils.scheduling.doctree index 726bbb88..6110e1b0 100644 Binary files a/.doctrees/output/botcore.utils.scheduling.doctree and b/.doctrees/output/botcore.utils.scheduling.doctree differ diff --git a/_sources/output/botcore.async_stats.rst.txt b/_sources/output/botcore.async_stats.rst.txt new file mode 100644 index 00000000..7fdbbbe2 --- /dev/null +++ b/_sources/output/botcore.async_stats.rst.txt @@ -0,0 +1,7 @@ +async\_stats +=========================== + +.. automodule:: botcore.async_stats + :members: + :special-members: + :show-inheritance: diff --git a/_sources/output/botcore.rst.txt b/_sources/output/botcore.rst.txt index f537106b..0a719da2 100644 --- a/_sources/output/botcore.rst.txt +++ b/_sources/output/botcore.rst.txt @@ -21,4 +21,5 @@ Submodules .. toctree:: :maxdepth: 4 + botcore.async_stats botcore.site_api diff --git a/_sources/output/botcore.utils.extensions.rst.txt b/_sources/output/botcore.utils.extensions.rst.txt deleted file mode 100644 index 65c40bbf..00000000 --- a/_sources/output/botcore.utils.extensions.rst.txt +++ /dev/null @@ -1,7 +0,0 @@ -extensions -=============================== - -.. automodule:: botcore.utils.extensions - :members: - :special-members: - :show-inheritance: diff --git a/_sources/output/botcore.utils.rst.txt b/_sources/output/botcore.utils.rst.txt index 6c59b47f..286b55f1 100644 --- a/_sources/output/botcore.utils.rst.txt +++ b/_sources/output/botcore.utils.rst.txt @@ -14,7 +14,6 @@ Submodules botcore.utils.caching botcore.utils.channel - botcore.utils.extensions botcore.utils.logging botcore.utils.members botcore.utils.regex diff --git a/_static/statsd_additional_objects.inv b/_static/statsd_additional_objects.inv new file mode 100644 index 00000000..f84ab9f1 Binary files /dev/null and b/_static/statsd_additional_objects.inv differ diff --git a/genindex.html b/genindex.html index 6bf50724..8d823a06 100644 --- a/genindex.html +++ b/genindex.html @@ -161,13 +161,13 @@
  • Utils
  • +
  • async_stats
  • site_api
  • @@ -210,7 +210,7 @@

    Index

    -
    _ | A | B | C | D | F | G | H | I | M | P | R | S | T | U | W
    +
    _ | A | B | C | D | F | G | H | I | L | M | O | P | R | S | T | W

    _

    @@ -224,10 +224,16 @@ @@ -242,6 +248,10 @@

    A

    @@ -249,6 +259,8 @@
  • apply_monkey_patches() (in module botcore.utils)
  • AsyncCache (class in botcore.utils.caching) +
  • +
  • AsyncStatsClient (class in botcore.async_stats)
  • @@ -258,11 +270,20 @@

    B

    + -
    +
    • botcore.utils.caching @@ -298,15 +321,6 @@
    • -
    +
    +

    L

    + + + +
    +
    +

    M

    @@ -436,6 +474,8 @@
    +
    +

    O

    + + + +
    +
    +

    P

    -
    -

    U

    - - -
    -
    -

    W

    diff --git a/index.html b/index.html index 4919700a..44dc03c3 100644 --- a/index.html +++ b/index.html @@ -163,13 +163,13 @@
  • Utils
  • +
  • async_stats
  • site_api
  • @@ -227,6 +227,7 @@
  • Submodules
  • diff --git a/objects.inv b/objects.inv index de998950..a3d8b2f3 100644 Binary files a/objects.inv and b/objects.inv differ diff --git a/output/botcore.async_stats.html b/output/botcore.async_stats.html new file mode 100644 index 00000000..99c54337 --- /dev/null +++ b/output/botcore.async_stats.html @@ -0,0 +1,306 @@ + + + + + + + + + async_stats - Bot Core v4.0.0 + + + + + + + + + + + + + + + + Contents + + + + + + Menu + + + + + + + + Expand + + + + + + Light mode + + + + + + + + + + + + + + Dark mode + + + + + + + Auto light/dark mode + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +
    +
    + +
    + +
    +
    + +
    +
    +
    + + + + + Back to top + +
    + +
    + +
    +
    +
    +

    async_stats#

    +

    An async transport method for statsd communication.

    +
    +
    +class AsyncStatsClient(loop, host='localhost', port=8125, prefix=None)[source]#
    +

    Bases: statsd.client.base.StatsClientBase

    +

    An async implementation of statsd.client.base.StatsClientBase that supports async stat communication.

    +
    +
    +__init__(loop, host='localhost', port=8125, prefix=None)[source]#
    +

    Create a new AsyncStatsClient.

    +
    +
    Parameters
    +
    +
    +
    +
    +
    +
    +async create_socket()[source]#
    +

    Use asyncio.loop.create_datagram_endpoint from the loop given on init to create a socket.

    +
    +
    Return type
    +

    None

    +
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    + + + + + + \ No newline at end of file diff --git a/output/botcore.exts.html b/output/botcore.exts.html index cdb504a7..04c9917c 100644 --- a/output/botcore.exts.html +++ b/output/botcore.exts.html @@ -163,13 +163,13 @@
  • Utils
  • +
  • async_stats
  • site_api
  • diff --git a/output/botcore.html b/output/botcore.html index bab52adf..5b50ce0d 100644 --- a/output/botcore.html +++ b/output/botcore.html @@ -163,13 +163,13 @@
  • Utils
  • +
  • async_stats
  • site_api
  • @@ -212,6 +212,168 @@

    Botcore#

    Useful utilities and tools for Discord bot development.

    +
    +
    +class BotBase(*args, guild_id, allowed_roles, http_session, redis_session=None, **kwargs)[source]#
    +

    Bases: discord.ext.commands.bot.Bot

    +

    A sub-class that implements many common features that Python Discord bots use.

    +
    +
    +__init__(*args, guild_id, allowed_roles, http_session, redis_session=None, **kwargs)[source]#
    +

    Initialise the base bot instance.

    +
    +
    Parameters
    +
      +
    • guild_id (int) – The ID of the guild use for wait_until_guild_available().

    • +
    • allowed_roles (list) – A list of role IDs that the bot is allowed to mention.

    • +
    • http_session (aiohttp.ClientSession) – The session to use for the bot.

    • +
    • redis_session (Optional[RedisSession]) – The +[async_rediscache.RedisSession](https://github.com/SebastiaanZ/async-rediscache#creating-a-redissession) +to use for the bot.

    • +
    +
    +
    +
    +
    +
    +async add_cog(cog)[source]#
    +

    Add the given cog to the bot and log the operation.

    +
    +
    Return type
    +

    None

    +
    +
    +
    +
    +
    +add_command(command)[source]#
    +

    Add command as normal and then add its root aliases to the bot.

    +
    +
    Return type
    +

    None

    +
    +
    +
    +
    +
    +clear()[source]#
    +

    Not implemented! Re-instantiate the bot instead of attempting to re-use a closed one.

    +
    +
    Return type
    +

    None

    +
    +
    +
    +
    +
    +async close()[source]#
    +

    Close the Discord connection, and the aiohttp session, connector, statsd client, and resolver.

    +
    +
    Return type
    +

    None

    +
    +
    +
    +
    +
    +async load_extensions(module)[source]#
    +

    Load all the extensions within the given module and save them to self.all_extensions.

    +
    +
    Return type
    +

    None

    +
    +
    +
    +
    +
    +async log_to_dev_log(message)[source]#
    +

    Log the given message to #dev-log.

    +
    +
    Return type
    +

    None

    +
    +
    +
    +
    +
    +async on_guild_available(guild)[source]#
    +

    Set the internal guild available event when self.guild_id becomes available.

    +

    If the cache appears to still be empty (no members, no channels, or no roles), the event +will not be set and guild_available_but_cache_empty event will be emitted.

    +
    +
    Return type
    +

    None

    +
    +
    +
    +
    +
    +async on_guild_unavailable(guild)[source]#
    +

    Clear the internal guild available event when self.guild_id becomes unavailable.

    +
    +
    Return type
    +

    None

    +
    +
    +
    +
    +
    +async ping_services()[source]#
    +

    Ping all required services on setup to ensure they are up before starting.

    +
    +
    Return type
    +

    None

    +
    +
    +
    +
    +
    +remove_command(name)[source]#
    +

    Remove a command/alias as normal and then remove its root aliases from the bot.

    +

    Individual root aliases cannot be removed by this function. +To remove them, either remove the entire command or manually edit bot.all_commands.

    +
    +
    Return type
    +

    Optional[Command]

    +
    +
    +
    +
    +
    +async setup_hook()[source]#
    +

    An async init to startup generic services.

    +

    Connects to statsd, and calls +AsyncStatsClient.create_socket +and ping_services().

    +
    +
    Return type
    +

    None

    +
    +
    +
    +
    +
    +async wait_until_guild_available()[source]#
    +

    Wait until the guild that matches the guild_id given at init is available (and the cache is ready).

    +

    The on_ready event is inadequate because it only waits 2 seconds for a GUILD_CREATE +gateway event before giving up and thus not populating the cache for unavailable guilds.

    +
    +
    Return type
    +

    None

    +
    +
    +
    +
    +
    +
    +exception StartupError(base)[source]#
    +

    Bases: Exception

    +

    Exception class for startup errors.

    +
    +
    +__init__(base)[source]#
    +
    +

    Subpackages#

    @@ -221,7 +383,6 @@
  • Submodules
  • @@ -214,12 +214,12 @@

    An API wrapper around the Site API.

    -class APIClient(site_api_url, site_api_token, **session_kwargs)[source]#
    +class APIClient(site_api_url, site_api_token, **session_kwargs)[source]#

    Bases: object

    A wrapper for the Django Site API.

    -__init__(site_api_url, site_api_token, **session_kwargs)[source]#
    +__init__(site_api_url, site_api_token, **session_kwargs)[source]#

    Initialize a new APIClient instance.

    Parameters
    @@ -233,7 +233,7 @@
    -async close()[source]#
    +async close()[source]#

    Close the aiohttp session.

    Return type
    @@ -243,7 +243,7 @@
    -async delete(endpoint, *, raise_for_status=True, **kwargs)[source]#
    +async delete(endpoint, *, raise_for_status=True, **kwargs)[source]#

    Send a DELETE request to the site API and return the JSON response.

    Parameters
    @@ -263,7 +263,7 @@
    -async get(endpoint, *, raise_for_status=True, **kwargs)[source]#
    +async get(endpoint, *, raise_for_status=True, **kwargs)[source]#

    Equivalent to APIClient.request() with GET passed as the method.

    Return type
    @@ -273,7 +273,7 @@
    -async maybe_raise_for_status(response, should_raise)[source]#
    +async maybe_raise_for_status(response, should_raise)[source]#

    Raise ResponseCodeError for non-OK response if an exception should be raised.

    Parameters
    @@ -292,7 +292,7 @@
    -async patch(endpoint, *, raise_for_status=True, **kwargs)[source]#
    +async patch(endpoint, *, raise_for_status=True, **kwargs)[source]#

    Equivalent to APIClient.request() with PATCH passed as the method.

    Return type
    @@ -302,7 +302,7 @@
    -async post(endpoint, *, raise_for_status=True, **kwargs)[source]#
    +async post(endpoint, *, raise_for_status=True, **kwargs)[source]#

    Equivalent to APIClient.request() with POST passed as the method.

    Return type
    @@ -312,7 +312,7 @@
    -async put(endpoint, *, raise_for_status=True, **kwargs)[source]#
    +async put(endpoint, *, raise_for_status=True, **kwargs)[source]#

    Equivalent to APIClient.request() with PUT passed as the method.

    Return type
    @@ -322,7 +322,7 @@
    -async request(method, endpoint, *, raise_for_status=True, **kwargs)[source]#
    +async request(method, endpoint, *, raise_for_status=True, **kwargs)[source]#

    Send an HTTP request to the site API and return the JSON response.

    Parameters
    @@ -347,12 +347,12 @@
    -exception ResponseCodeError(response, response_json=None, response_text=None)[source]#
    +exception ResponseCodeError(response, response_json=None, response_text=None)[source]#

    Bases: ValueError

    Raised in APIClient.request() when a non-OK HTTP response is received.

    -__init__(response, response_json=None, response_text=None)[source]#
    +__init__(response, response_json=None, response_text=None)[source]#

    Initialize a new ResponseCodeError instance.

    Parameters
    @@ -366,7 +366,7 @@
    -__str__()[source]#
    +__str__()[source]#

    Return a string representation of the error.

    @@ -378,14 +378,14 @@