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 --- 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 +-- 12 files changed, 528 insertions(+), 367 deletions(-) create mode 100644 output/botcore.async_stats.html delete mode 100644 output/botcore.utils.extensions.html (limited to 'output') 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 @@