From 63d0cff1159d6d40ed867263abee409568f73d29 Mon Sep 17 00:00:00 2001 From: ChrisLovering Date: Thu, 26 Oct 2023 13:31:58 +0000 Subject: Deploying to docs from @ python-discord/bot-core@ee2501e36aa4cb6e809de9873e3d607bdf3309db 🚀 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v8.0.0/output/botcore.async_stats.html | 52 +++++++------ v8.0.0/output/botcore.exts.html | 32 ++++---- v8.0.0/output/botcore.html | 104 +++++++++++++------------- v8.0.0/output/botcore.site_api.html | 98 ++++++++++++------------ v8.0.0/output/botcore.utils.caching.html | 50 +++++++------ v8.0.0/output/botcore.utils.channel.html | 42 ++++++----- v8.0.0/output/botcore.utils.commands.html | 38 +++++----- v8.0.0/output/botcore.utils.html | 44 ++++++----- v8.0.0/output/botcore.utils.interactions.html | 62 ++++++++------- v8.0.0/output/botcore.utils.logging.html | 48 ++++++------ v8.0.0/output/botcore.utils.members.html | 44 ++++++----- v8.0.0/output/botcore.utils.regex.html | 40 +++++----- v8.0.0/output/botcore.utils.scheduling.html | 102 +++++++++++++------------ 13 files changed, 404 insertions(+), 352 deletions(-) (limited to 'v8.0.0/output') diff --git a/v8.0.0/output/botcore.async_stats.html b/v8.0.0/output/botcore.async_stats.html index eeacef4e..3a698711 100644 --- a/v8.0.0/output/botcore.async_stats.html +++ b/v8.0.0/output/botcore.async_stats.html @@ -1,18 +1,18 @@ - + - + async_stats - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,25 +423,25 @@
    -

    async_stats#

    +

    async_stats#

    An async transport method for statsd communication.

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

    Bases: StatsClientBase

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

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

    Create a new AsyncStatsClient.

    Parameters:
    @@ -445,11 +449,11 @@
    -async create_socket()[source]#
    -

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

    +async create_socket()[source]# +

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

    Return type:
    -

    None

    +

    None

    @@ -530,10 +534,10 @@ - - - - - + + + + + \ No newline at end of file diff --git a/v8.0.0/output/botcore.exts.html b/v8.0.0/output/botcore.exts.html index 6b8f87e4..3c936274 100644 --- a/v8.0.0/output/botcore.exts.html +++ b/v8.0.0/output/botcore.exts.html @@ -1,18 +1,18 @@ - + - + Exts - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,7 +423,7 @@
    -

    Exts#

    +

    Exts#

    Reusable Discord cogs.

    @@ -472,10 +476,10 @@ - - - - - + + + + + \ No newline at end of file diff --git a/v8.0.0/output/botcore.html b/v8.0.0/output/botcore.html index ae1adbff..6c89a36e 100644 --- a/v8.0.0/output/botcore.html +++ b/v8.0.0/output/botcore.html @@ -1,18 +1,18 @@ - + - + Botcore - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,26 +423,26 @@
    -

    Botcore#

    +

    Botcore#

    Useful utilities and tools for Discord bot development.

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

    Bases: 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, api_client=None, statsd_url=None, **kwargs)[source]#
    +__init__(*args, guild_id, allowed_roles, http_session, redis_session=None, api_client=None, statsd_url=None, **kwargs)[source]#

    Initialise the base bot instance.

    Parameters:
    @@ -447,142 +451,142 @@ a dummy statsd client will be created.

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

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

    Return type:
    -

    None

    +

    None

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

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

    Return type:
    -

    None

    +

    None

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

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

    Return type:
    -

    None

    +

    None

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

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

    Return type:
    -

    None

    +

    None

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

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

    This should be ran in a task on the event loop to avoid deadlocks caused by wait_for calls.

    Return type:
    -

    None

    +

    None

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

    Log the given message to #dev-log.

    Return type:
    -

    None

    +

    None

    -async on_guild_available(guild)[source]#
    +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

    +

    None

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

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

    Return type:
    -

    None

    +

    None

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

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

    Return type:
    -

    None

    +

    None

    -remove_command(name)[source]#
    +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]

    +

    Optional[Command]

    -async setup_hook()[source]#
    +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

    +

    None

    -async wait_until_guild_available()[source]#
    +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

    +

    None

    @@ -591,18 +595,18 @@ gateway event before giving up and thus not populating the cache for unavailable
    -exception StartupError(base)[source]#
    -

    Bases: Exception

    +exception StartupError(base)[source]# +

    Bases: Exception

    Exception class for startup errors.

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

    Subpackages#

    +

    Subpackages#

    • Exts
    • @@ -657,7 +661,7 @@ gateway event before giving up and thus not populating the cache for unavailable
    -

    Submodules#

    +

    Submodules#

    • async_stats
        @@ -782,10 +786,10 @@ gateway event before giving up and thus not populating the cache for unavailable
    - - - - - + + + + + \ No newline at end of file diff --git a/v8.0.0/output/botcore.site_api.html b/v8.0.0/output/botcore.site_api.html index 431ef3c8..1e876069 100644 --- a/v8.0.0/output/botcore.site_api.html +++ b/v8.0.0/output/botcore.site_api.html @@ -1,18 +1,18 @@ - + - + site_api - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,22 +423,22 @@
    -

    site_api#

    +

    site_api#

    An API wrapper around the Site API.

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

    Bases: object

    +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:
      -
    • site_api_url (str) – The URL of the site API.

    • -
    • site_api_token (str) – The token to use for authentication.

    • +
    • site_api_url (str) – The URL of the site API.

    • +
    • site_api_token (str) – The token to use for authentication.

    • session_kwargs – Keyword arguments to pass to the aiohttp.ClientSession constructor.

    @@ -443,29 +447,29 @@
    -async close()[source]#
    +async close()[source]#

    Close the aiohttp session.

    Return type:
    -

    None

    +

    None

    -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:
      -
    • endpoint (str) – The endpoint to send the request to.

    • -
    • raise_for_status (bool) – Whether or not to raise an exception if the response is not OK.

    • +
    • endpoint (str) – The endpoint to send the request to.

    • +
    • raise_for_status (bool) – Whether or not to raise an exception if the response is not OK.

    • **kwargs – Any extra keyword arguments to pass to aiohttp.request().

    Return type:
    -

    Optional[dict]

    +

    Optional[dict]

    Returns:

    The JSON response the API returns, or None if the response is 204 No Content.

    @@ -475,83 +479,83 @@
    -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:
    -

    dict

    +

    dict

    -async static maybe_raise_for_status(response, should_raise)[source]#
    +async static maybe_raise_for_status(response, should_raise)[source]#

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

    Parameters:
    • response (aiohttp.ClientResponse) – The response to check.

    • -
    • should_raise (bool) – Whether or not to raise an exception.

    • +
    • should_raise (bool) – Whether or not to raise an exception.

    Raises:

    ResponseCodeError – If the response is not OK and should_raise is True.

    Return type:
    -

    None

    +

    None

    -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:
    -

    dict

    +

    dict

    -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:
    -

    dict

    +

    dict

    -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:
    -

    dict

    +

    dict

    -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:
      -
    • method (str) – The HTTP method to use.

    • -
    • endpoint (str) – The endpoint to send the request to.

    • -
    • raise_for_status (bool) – Whether or not to raise an exception if the response is not OK.

    • +
    • method (str) – The HTTP method to use.

    • +
    • endpoint (str) – The endpoint to send the request to.

    • +
    • raise_for_status (bool) – Whether or not to raise an exception if the response is not OK.

    • **kwargs – Any extra keyword arguments to pass to aiohttp.request().

    Return type:
    -

    dict

    +

    dict

    Returns:

    The JSON response the API returns.

    @@ -566,19 +570,19 @@
    -exception ResponseCodeError(response, response_json=None, response_text=None)[source]#
    -

    Bases: ValueError

    +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:
    • response (aiohttp.ClientResponse) – The response object from the request.

    • -
    • response_json (Optional[dict]) – The JSON response returned from the request, if any.

    • -
    • response_text (Optional[str]) – The text of the request, if any.

    • +
    • response_json (Optional[dict]) – The JSON response returned from the request, if any.

    • +
    • response_text (Optional[str]) – The text of the request, if any.

    @@ -586,7 +590,7 @@
    -__str__()[source]#
    +__str__()[source]#

    Return a string representation of the error.

    @@ -678,10 +682,10 @@ - - - - - + + + + + \ No newline at end of file diff --git a/v8.0.0/output/botcore.utils.caching.html b/v8.0.0/output/botcore.utils.caching.html index 5e03d793..51574b59 100644 --- a/v8.0.0/output/botcore.utils.caching.html +++ b/v8.0.0/output/botcore.utils.caching.html @@ -1,18 +1,18 @@ - + - + caching - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,25 +423,25 @@
    -

    caching#

    +

    caching#

    Utilities related to custom caches.

    -class AsyncCache(max_size=128)[source]#
    -

    Bases: object

    +class AsyncCache(max_size=128)[source]# +

    Bases: object

    LRU cache implementation for coroutines.

    Once the cache exceeds the maximum size, keys are deleted in FIFO order.

    An offset may be optionally provided to be applied to the coroutine’s arguments when creating the cache key.

    -__call__(arg_offset=0)[source]#
    +__call__(arg_offset=0)[source]#

    Decorator for async cache.

    Parameters:
    -

    arg_offset (int) – The offset for the position of the key argument.

    +

    arg_offset (int) – The offset for the position of the key argument.

    Return type:
    -

    Callable

    +

    Callable

    Returns:

    A decorator to wrap the target function.

    @@ -447,22 +451,22 @@
    -__init__(max_size=128)[source]#
    +__init__(max_size=128)[source]#

    Initialise a new AsyncCache instance.

    Parameters:
    -

    max_size (int) – How many items to store in the cache.

    +

    max_size (int) – How many items to store in the cache.

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

    Clear cache instance.

    Return type:
    -

    None

    +

    None

    @@ -544,10 +548,10 @@ - - - - - + + + + + \ No newline at end of file diff --git a/v8.0.0/output/botcore.utils.channel.html b/v8.0.0/output/botcore.utils.channel.html index 383a452d..276a2eab 100644 --- a/v8.0.0/output/botcore.utils.channel.html +++ b/v8.0.0/output/botcore.utils.channel.html @@ -1,18 +1,18 @@ - + - + channel - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,17 +423,17 @@
    -

    channel#

    +

    channel#

    Useful helper functions for interacting with various discord channel objects.

    -async get_or_fetch_channel(bot, channel_id)[source]#
    +async get_or_fetch_channel(bot, channel_id)[source]#

    Attempt to get or fetch the given channel_id from the bots cache, and return it.

    Parameters:
    • bot (Bot) – The discord.ext.commands.Bot instance to use for getting/fetching.

    • -
    • channel_id (int) – The channel to get/fetch.

    • +
    • channel_id (int) – The channel to get/fetch.

    Raises:
    @@ -451,17 +455,17 @@
    -is_in_category(channel, category_id)[source]#
    +is_in_category(channel, category_id)[source]#

    Return whether the given channel in the the category with the id category_id.

    Parameters:
    • channel (TextChannel) – The channel to check.

    • -
    • category_id (int) – The category to check for.

    • +
    • category_id (int) – The category to check for.

    Return type:
    -

    bool

    +

    bool

    Returns:

    A bool depending on whether the channel is in the category.

    @@ -540,10 +544,10 @@ - - - - - + + + + + \ No newline at end of file diff --git a/v8.0.0/output/botcore.utils.commands.html b/v8.0.0/output/botcore.utils.commands.html index 9de0ead7..dd60a04c 100644 --- a/v8.0.0/output/botcore.utils.commands.html +++ b/v8.0.0/output/botcore.utils.commands.html @@ -1,18 +1,18 @@ - + - + commands - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,23 +423,23 @@
    -

    commands#

    +

    commands#

    -async clean_text_or_reply(ctx, text=None)[source]#
    +async clean_text_or_reply(ctx, text=None)[source]#

    Cleans a text argument or replied message’s content.

    Parameters:
    • ctx (Context) – The command’s context

    • -
    • text (Optional[str]) – The provided text argument of the command (if given)

    • +
    • text (Optional[str]) – The provided text argument of the command (if given)

    Raises:

    discord.ext.commands.BadArgumenttext wasn’t provided and there’s no reply message / reply message content.

    Return type:
    -

    str

    +

    str

    Returns:

    The cleaned version of text, if given, else replied message.

    @@ -513,10 +517,10 @@ - - - - - + + + + + \ No newline at end of file diff --git a/v8.0.0/output/botcore.utils.html b/v8.0.0/output/botcore.utils.html index 45e8021e..55f8ba09 100644 --- a/v8.0.0/output/botcore.utils.html +++ b/v8.0.0/output/botcore.utils.html @@ -1,18 +1,18 @@ - + - + Utils - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,15 +423,15 @@
    -

    Utils#

    +

    Utils#

    Useful utilities and tools for Discord bot development.

    -apply_monkey_patches()[source]#
    +apply_monkey_patches()[source]#

    Applies all common monkey patches for our bots.

    Return type:
    -

    None

    +

    None

    @@ -442,14 +446,14 @@ that will act as top-level groups rather than being aliases of the command’s g
    -unqualify(name)[source]#
    +unqualify(name)[source]#

    Return an unqualified name given a qualified module/package name.

    Parameters:
    -

    name (str) – The module name to unqualify.

    +

    name (str) – The module name to unqualify.

    Return type:
    -

    str

    +

    str

    Returns:

    The unqualified module name.

    @@ -458,7 +462,7 @@ that will act as top-level groups rather than being aliases of the command’s g
    -

    Submodules#

    +

    Submodules#

    • caching
        @@ -601,10 +605,10 @@ that will act as top-level groups rather than being aliases of the command’s g
    - - - - - + + + + + \ No newline at end of file diff --git a/v8.0.0/output/botcore.utils.interactions.html b/v8.0.0/output/botcore.utils.interactions.html index 35b49a93..7559b2eb 100644 --- a/v8.0.0/output/botcore.utils.interactions.html +++ b/v8.0.0/output/botcore.utils.interactions.html @@ -1,18 +1,18 @@ - + - + interactions - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,10 +423,10 @@
    -

    interactions#

    +

    interactions#

    -class DeleteMessageButton(*, style=<ButtonStyle.secondary: 2>, label='Delete', **kwargs)[source]#
    +class DeleteMessageButton(*, style=('secondary', 2), label='Delete', **kwargs)[source]#

    Bases: Button

    A button that can be added to a view to delete the message containing the view on click.

    This button itself carries out no interaction checks, these should be done by the parent view.

    @@ -431,22 +435,22 @@
    Parameters:
    • style (ButtonStyle) – The style of the button, set to ButtonStyle.secondary if not specified.

    • -
    • label (str) – The label of the button, set to “Delete” if not specified.

    • +
    • label (str) – The label of the button, set to “Delete” if not specified.

    -__init__(*, style=<ButtonStyle.secondary: 2>, label='Delete', **kwargs)[source]#
    +__init__(*, style=('secondary', 2), label='Delete', **kwargs)[source]#
    -async callback(interaction)[source]#
    +async callback(interaction)[source]#

    Delete the original message on button click.

    Return type:
    -

    None

    +

    None

    @@ -455,47 +459,47 @@
    -class ViewWithUserAndRoleCheck(*, allowed_users, allowed_roles, timeout=180.0, message=None)[source]#
    +class ViewWithUserAndRoleCheck(*, allowed_users, allowed_roles, timeout=180.0, message=None)[source]#

    Bases: View

    A view that allows the original invoker and moderators to interact with it.

    Parameters:
      -
    • allowed_users (Sequence[int]) – A sequence of user’s ids who are allowed to interact with the view.

    • -
    • allowed_roles (Sequence[int]) – A sequence of role ids that are allowed to interact with the view.

    • -
    • timeout (Optional[float]) – Timeout in seconds from last interaction with the UI before no longer accepting input. +

    • allowed_users (Sequence[int]) – A sequence of user’s ids who are allowed to interact with the view.

    • +
    • allowed_roles (Sequence[int]) – A sequence of role ids that are allowed to interact with the view.

    • +
    • timeout (Optional[float]) – Timeout in seconds from last interaction with the UI before no longer accepting input. If None then there is no timeout.

    • -
    • message (Optional[Message]) – The message to remove the view from on timeout. This can also be set with +

    • message (Optional[Message]) – The message to remove the view from on timeout. This can also be set with view.message = await ctx.send( ... )` , or similar, after the view is instantiated.

    -__init__(*, allowed_users, allowed_roles, timeout=180.0, message=None)[source]#
    +__init__(*, allowed_users, allowed_roles, timeout=180.0, message=None)[source]#
    -async interaction_check(interaction)[source]#
    +async interaction_check(interaction)[source]#

    Ensure the user clicking the button is the view invoker, or a moderator.

    Parameters:

    interaction (Interaction) – The interaction that occurred.

    Return type:
    -

    bool

    +

    bool

    -async on_timeout()[source]#
    +async on_timeout()[source]#

    Remove the view from self.message if set.

    Return type:
    -

    None

    +

    None

    @@ -582,10 +586,10 @@ If None - - - - - + + + + + \ No newline at end of file diff --git a/v8.0.0/output/botcore.utils.logging.html b/v8.0.0/output/botcore.utils.logging.html index 6ea7b207..5eb1d25e 100644 --- a/v8.0.0/output/botcore.utils.logging.html +++ b/v8.0.0/output/botcore.utils.logging.html @@ -1,18 +1,18 @@ - + - + logging - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,16 +423,16 @@
    -

    logging#

    +

    logging#

    Common logging related functions.

    -class CustomLogger(name, level=0)[source]#
    -

    Bases: Logger

    -

    Custom implementation of the logging.Logger class with an added trace method.

    +class CustomLogger(name, level=0)[source]# +

    Bases: Logger

    +

    Custom implementation of the logging.Logger class with an added trace method.

    -trace(msg, *args, **kwargs)[source]#
    +trace(msg, *args, **kwargs)[source]#

    Log the given message with the severity "TRACE".

    To pass exception information, use the keyword argument exc_info with a true value:

    logger.trace("Houston, we have an %s", "interesting problem", exc_info=1)
    @@ -437,13 +441,13 @@
     
    Parameters:
      -
    • msg (str) – The message to be logged.

    • +
    • msg (str) – The message to be logged.

    • args – Passed to the base log function as is.

    • kwargs – Passed to the base log function as is.

    Return type:
    -

    None

    +

    None

    @@ -452,11 +456,11 @@
    -get_logger(name=None)[source]#
    +get_logger(name=None)[source]#

    Utility to make mypy recognise that logger is of type CustomLogger.

    Parameters:
    -

    name (Optional[str]) – The name given to the logger.

    +

    name (Optional[str]) – The name given to the logger.

    Return type:

    CustomLogger

    @@ -541,10 +545,10 @@ - - - - - + + + + + \ No newline at end of file diff --git a/v8.0.0/output/botcore.utils.members.html b/v8.0.0/output/botcore.utils.members.html index 92964973..b4dde9a8 100644 --- a/v8.0.0/output/botcore.utils.members.html +++ b/v8.0.0/output/botcore.utils.members.html @@ -1,18 +1,18 @@ - + - + members - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,25 +423,25 @@
    -

    members#

    +

    members#

    Useful helper functions for interactin with discord.Member objects.

    -async get_or_fetch_member(guild, member_id)[source]#
    +async get_or_fetch_member(guild, member_id)[source]#

    Attempt to get a member from cache; on failure fetch from the API.

    Return type:
    -

    Optional[Member]

    +

    Optional[Member]

    Returns:
    -

    The discord.Member or None to indicate the member could not be found.

    +

    The discord.Member or None to indicate the member could not be found.

    -async handle_role_change(member, coro, role)[source]#
    +async handle_role_change(member, coro, role)[source]#

    Await the given coro with role as the sole argument.

    Handle errors that we expect to be raised from discord.Member.add_roles and discord.Member.remove_roles.

    @@ -445,12 +449,12 @@
    Parameters:
    Return type:
    -

    None

    +

    None

    @@ -526,10 +530,10 @@ - - - - - + + + + + \ No newline at end of file diff --git a/v8.0.0/output/botcore.utils.regex.html b/v8.0.0/output/botcore.utils.regex.html index 5ed741a4..81e4c373 100644 --- a/v8.0.0/output/botcore.utils.regex.html +++ b/v8.0.0/output/botcore.utils.regex.html @@ -1,18 +1,18 @@ - + - + regex - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,17 +423,17 @@
    -

    regex#

    +

    regex#

    Common regular expressions.

    -DISCORD_INVITE[source]#
    +DISCORD_INVITE[source]#

    Regex for Discord server invites.

    Warning

    This regex pattern will capture until a whitespace, if you are to use the ‘invite’ capture group in any HTTP requests or similar. Please ensure you sanitise the output using something -such as urllib.parse.quote().

    +such as urllib.parse.quote().

    @@ -437,7 +441,7 @@ such as
    -FORMATTED_CODE_REGEX[source]#
    +FORMATTED_CODE_REGEX[source]#

    Regex for formatted code, using Discord’s code blocks.

    @@ -445,7 +449,7 @@ such as
    -RAW_CODE_REGEX[source]#
    +RAW_CODE_REGEX[source]#

    Regex for raw code, not using Discord’s code blocks.

    @@ -523,10 +527,10 @@ such as - - - - + + + + + \ No newline at end of file diff --git a/v8.0.0/output/botcore.utils.scheduling.html b/v8.0.0/output/botcore.utils.scheduling.html index b71c02b5..f9287c98 100644 --- a/v8.0.0/output/botcore.utils.scheduling.html +++ b/v8.0.0/output/botcore.utils.scheduling.html @@ -1,18 +1,18 @@ - + - + scheduling - Pydis Core v8.0.0 - - - - - - + + + + + + @@ -351,6 +351,10 @@ v7.1.1 +
  • + v10.3.0 +
  • +
  • v10.2.0
  • @@ -419,12 +423,12 @@
    -

    scheduling#

    +

    scheduling#

    Generic python scheduler.

    -class Scheduler(name)[source]#
    -

    Bases: object

    +class Scheduler(name)[source]# +

    Bases: object

    Schedule the execution of coroutines and keep track of them.

    When instantiating a Scheduler, a name must be provided. This name is used to distinguish the instance’s log messages from other instances. Using the name of the class or module containing @@ -437,79 +441,79 @@ the same ID used to schedule it.

    Any exception raised in a scheduled task is logged when the task is done.

    -__contains__(task_id)[source]#
    -

    Return True if a task with the given task_id is currently scheduled.

    +__contains__(task_id)[source]# +

    Return True if a task with the given task_id is currently scheduled.

    Parameters:
    -

    task_id (Hashable) – The task to look for.

    +

    task_id (Hashable) – The task to look for.

    Return type:
    -

    bool

    +

    bool

    Returns:
    -

    True if the task was found.

    +

    True if the task was found.

    -__init__(name)[source]#
    +__init__(name)[source]#

    Initialize a new Scheduler instance.

    Parameters:
    -

    name (str) – The name of the Scheduler. Used in logging, and namespacing.

    +

    name (str) – The name of the Scheduler. Used in logging, and namespacing.

    -cancel(task_id)[source]#
    +cancel(task_id)[source]#

    Unschedule the task identified by task_id. Log a warning if the task doesn’t exist.

    Parameters:
    -

    task_id (Hashable) – The task’s unique ID.

    +

    task_id (Hashable) – The task’s unique ID.

    Return type:
    -

    None

    +

    None

    -cancel_all()[source]#
    +cancel_all()[source]#

    Unschedule all known tasks.

    Return type:
    -

    None

    +

    None

    -schedule(task_id, coroutine)[source]#
    +schedule(task_id, coroutine)[source]#

    Schedule the execution of a coroutine.

    If a task with task_id already exists, close coroutine instead of scheduling it. This prevents unawaited coroutine warnings. Don’t pass a coroutine that’ll be re-used elsewhere.

    Parameters:
      -
    • task_id (Hashable) – A unique ID to create the task with.

    • -
    • coroutine (Coroutine) – The function to be called.

    • +
    • task_id (Hashable) – A unique ID to create the task with.

    • +
    • coroutine (Coroutine) – The function to be called.

    Return type:
    -

    None

    +

    None

    -schedule_at(time, task_id, coroutine)[source]#
    +schedule_at(time, task_id, coroutine)[source]#

    Schedule coroutine to be executed at the given time.

    If time is timezone aware, then use that timezone to calculate now() when subtracting. If time is naïve, then use UTC.

    @@ -519,33 +523,33 @@ prevents unawaited coroutine warnings. Don’t pass a coroutine that’ll be re-
    Parameters:
      -
    • time (datetime) – The time to start the task.

    • -
    • task_id (Hashable) – A unique ID to create the task with.

    • -
    • coroutine (Coroutine) – The function to be called.

    • +
    • time (datetime) – The time to start the task.

    • +
    • task_id (Hashable) – A unique ID to create the task with.

    • +
    • coroutine (Coroutine) – The function to be called.

    Return type:
    -

    None

    +

    None

    -schedule_later(delay, task_id, coroutine)[source]#
    +schedule_later(delay, task_id, coroutine)[source]#

    Schedule coroutine to be executed after delay seconds.

    If a task with task_id already exists, close coroutine instead of scheduling it. This prevents unawaited coroutine warnings. Don’t pass a coroutine that’ll be re-used elsewhere.

    Parameters:
      -
    • delay (Union[int, float]) – How long to wait before starting the task.

    • -
    • task_id (Hashable) – A unique ID to create the task with.

    • -
    • coroutine (Coroutine) – The function to be called.

    • +
    • delay (Union[int, float]) – How long to wait before starting the task.

    • +
    • task_id (Hashable) – A unique ID to create the task with.

    • +
    • coroutine (Coroutine) – The function to be called.

    Return type:
    -

    None

    +

    None

    @@ -554,24 +558,24 @@ prevents unawaited coroutine warnings. Don’t pass a coroutine that’ll be re-
    -create_task(coro, *, suppressed_exceptions=(), event_loop=None, **kwargs)[source]#
    -

    Wrapper for creating an asyncio.Task which logs exceptions raised in the task.

    +create_task(coro, *, suppressed_exceptions=(), event_loop=None, **kwargs)[source]# +

    Wrapper for creating an asyncio.Task which logs exceptions raised in the task.

    If the event_loop kwarg is provided, the task is created from that event loop, otherwise the running loop is used.

    Parameters:
    Returns:

    The wrapped task.

    Return type:
    -

    asyncio.Task

    +

    asyncio.Task

    @@ -656,10 +660,10 @@ otherwise the running loop is used.

    - - - - - + + + + + \ No newline at end of file -- cgit v1.2.3