Full Code of GutaShow/discord.py-library for AI

master ff638d393d0f cached
247 files
5.6 MB
1.5M tokens
4787 symbols
1 requests
Download .txt
Showing preview only (6,397K chars total). Download the full file or copy to clipboard to get everything.
Repository: GutaShow/discord.py-library
Branch: master
Commit: ff638d393d0f
Files: 247
Total size: 5.6 MB

Directory structure:
gitextract_bpdvc9yc/

├── .github/
│   ├── CONTRIBUTING.md
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.yml
│   │   ├── config.yml
│   │   └── feature_request.yml
│   ├── PULL_REQUEST_TEMPLATE.md
│   └── workflows/
│       ├── build.yml
│       ├── crowdin_download.yml
│       ├── crowdin_upload.yml
│       ├── lint.yml
│       ├── scripts/
│       │   └── close_and_reopen_pr.js
│       └── test.yml
├── .gitignore
├── .readthedocs.yml
├── LICENSE
├── MANIFEST.in
├── README.ja.rst
├── README.rst
├── discord/
│   ├── __init__.py
│   ├── __main__.py
│   ├── _types.py
│   ├── abc.py
│   ├── activity.py
│   ├── app_commands/
│   │   ├── __init__.py
│   │   ├── checks.py
│   │   ├── commands.py
│   │   ├── errors.py
│   │   ├── installs.py
│   │   ├── models.py
│   │   ├── namespace.py
│   │   ├── transformers.py
│   │   ├── translator.py
│   │   └── tree.py
│   ├── appinfo.py
│   ├── asset.py
│   ├── audit_logs.py
│   ├── automod.py
│   ├── backoff.py
│   ├── bin/
│   │   └── COPYING
│   ├── channel.py
│   ├── client.py
│   ├── colour.py
│   ├── components.py
│   ├── context_managers.py
│   ├── embeds.py
│   ├── emoji.py
│   ├── enums.py
│   ├── errors.py
│   ├── ext/
│   │   ├── commands/
│   │   │   ├── __init__.py
│   │   │   ├── _types.py
│   │   │   ├── bot.py
│   │   │   ├── cog.py
│   │   │   ├── context.py
│   │   │   ├── converter.py
│   │   │   ├── cooldowns.py
│   │   │   ├── core.py
│   │   │   ├── errors.py
│   │   │   ├── flags.py
│   │   │   ├── help.py
│   │   │   ├── hybrid.py
│   │   │   ├── parameters.py
│   │   │   └── view.py
│   │   └── tasks/
│   │       └── __init__.py
│   ├── file.py
│   ├── flags.py
│   ├── gateway.py
│   ├── guild.py
│   ├── http.py
│   ├── integrations.py
│   ├── interactions.py
│   ├── invite.py
│   ├── member.py
│   ├── mentions.py
│   ├── message.py
│   ├── mixins.py
│   ├── object.py
│   ├── oggparse.py
│   ├── opus.py
│   ├── partial_emoji.py
│   ├── permissions.py
│   ├── player.py
│   ├── poll.py
│   ├── py.typed
│   ├── raw_models.py
│   ├── reaction.py
│   ├── role.py
│   ├── scheduled_event.py
│   ├── shard.py
│   ├── sku.py
│   ├── stage_instance.py
│   ├── state.py
│   ├── sticker.py
│   ├── team.py
│   ├── template.py
│   ├── threads.py
│   ├── types/
│   │   ├── __init__.py
│   │   ├── activity.py
│   │   ├── appinfo.py
│   │   ├── audit_log.py
│   │   ├── automod.py
│   │   ├── channel.py
│   │   ├── command.py
│   │   ├── components.py
│   │   ├── embed.py
│   │   ├── emoji.py
│   │   ├── gateway.py
│   │   ├── guild.py
│   │   ├── integration.py
│   │   ├── interactions.py
│   │   ├── invite.py
│   │   ├── member.py
│   │   ├── message.py
│   │   ├── poll.py
│   │   ├── role.py
│   │   ├── scheduled_event.py
│   │   ├── sku.py
│   │   ├── snowflake.py
│   │   ├── sticker.py
│   │   ├── team.py
│   │   ├── template.py
│   │   ├── threads.py
│   │   ├── user.py
│   │   ├── voice.py
│   │   ├── webhook.py
│   │   ├── welcome_screen.py
│   │   └── widget.py
│   ├── ui/
│   │   ├── __init__.py
│   │   ├── button.py
│   │   ├── dynamic.py
│   │   ├── item.py
│   │   ├── modal.py
│   │   ├── select.py
│   │   ├── text_input.py
│   │   └── view.py
│   ├── user.py
│   ├── utils.py
│   ├── voice_client.py
│   ├── voice_state.py
│   ├── webhook/
│   │   ├── __init__.py
│   │   ├── async_.py
│   │   └── sync.py
│   ├── welcome_screen.py
│   └── widget.py
├── docs/
│   ├── Makefile
│   ├── _static/
│   │   ├── codeblocks.css
│   │   ├── copy.js
│   │   ├── custom.js
│   │   ├── icons.css
│   │   ├── scorer.js
│   │   ├── settings.js
│   │   ├── sidebar.js
│   │   └── style.css
│   ├── _templates/
│   │   ├── genindex.html
│   │   ├── gettext/
│   │   │   └── message.pot_t
│   │   ├── layout.html
│   │   └── relations.html
│   ├── api.rst
│   ├── conf.py
│   ├── crowdin.yml
│   ├── discord.rst
│   ├── ext/
│   │   ├── commands/
│   │   │   ├── api.rst
│   │   │   ├── cogs.rst
│   │   │   ├── commands.rst
│   │   │   ├── extensions.rst
│   │   │   └── index.rst
│   │   └── tasks/
│   │       └── index.rst
│   ├── extensions/
│   │   ├── attributetable.py
│   │   ├── builder.py
│   │   ├── colour_preview.py
│   │   ├── details.py
│   │   ├── exception_hierarchy.py
│   │   ├── nitpick_file_ignorer.py
│   │   └── resourcelinks.py
│   ├── faq.rst
│   ├── index.rst
│   ├── intents.rst
│   ├── interactions/
│   │   └── api.rst
│   ├── intro.rst
│   ├── locale/
│   │   └── ja/
│   │       └── LC_MESSAGES/
│   │           ├── api.po
│   │           ├── discord.po
│   │           ├── ext/
│   │           │   ├── commands/
│   │           │   │   ├── api.po
│   │           │   │   ├── cogs.po
│   │           │   │   ├── commands.po
│   │           │   │   ├── extensions.po
│   │           │   │   └── index.po
│   │           │   └── tasks/
│   │           │       └── index.po
│   │           ├── faq.po
│   │           ├── index.po
│   │           ├── intents.po
│   │           ├── interactions/
│   │           │   └── api.po
│   │           ├── intro.po
│   │           ├── logging.po
│   │           ├── migrating.po
│   │           ├── migrating_to_async.po
│   │           ├── migrating_to_v1.po
│   │           ├── quickstart.po
│   │           ├── sphinx.po
│   │           ├── version_guarantees.po
│   │           └── whats_new.po
│   ├── logging.rst
│   ├── make.bat
│   ├── migrating.rst
│   ├── migrating_to_async.rst
│   ├── migrating_to_v1.rst
│   ├── quickstart.rst
│   ├── version_guarantees.rst
│   └── whats_new.rst
├── examples/
│   ├── advanced_startup.py
│   ├── app_commands/
│   │   ├── basic.py
│   │   └── transformers.py
│   ├── background_task.py
│   ├── background_task_asyncio.py
│   ├── basic_bot.py
│   ├── basic_voice.py
│   ├── converters.py
│   ├── custom_context.py
│   ├── deleted.py
│   ├── edits.py
│   ├── guessing_game.py
│   ├── modals/
│   │   └── basic.py
│   ├── new_member.py
│   ├── reaction_roles.py
│   ├── reply.py
│   ├── secret.py
│   └── views/
│       ├── confirm.py
│       ├── counter.py
│       ├── dropdown.py
│       ├── dynamic_counter.py
│       ├── ephemeral.py
│       ├── link.py
│       ├── persistent.py
│       └── tic_tac_toe.py
├── pyproject.toml
├── requirements.txt
├── setup.py
└── tests/
    ├── test_annotated_annotation.py
    ├── test_app_commands_autocomplete.py
    ├── test_app_commands_description.py
    ├── test_app_commands_group.py
    ├── test_app_commands_invoke.py
    ├── test_colour.py
    ├── test_ext_commands_cog.py
    ├── test_ext_commands_description.py
    ├── test_ext_tasks.py
    ├── test_files.py
    ├── test_ui_selects.py
    └── test_utils.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/CONTRIBUTING.md
================================================
## Contributing to discord.py

First off, thanks for taking the time to contribute. It makes the library substantially better. :+1:

The following is a set of guidelines for contributing to the repository. These are guidelines, not hard rules.

## This is too much to read! I want to ask a question!

Generally speaking questions are better suited in our resources below.

- The official support server: https://discord.gg/r3sSKJJ
- The Discord API server under #python_discord-py: https://discord.gg/discord-api
- [The FAQ in the documentation](https://discordpy.readthedocs.io/en/latest/faq.html)
- [StackOverflow's `discord.py` tag](https://stackoverflow.com/questions/tagged/discord.py)

Please try your best not to ask questions in our issue tracker. Most of them don't belong there unless they provide value to a larger audience.

## Good Bug Reports

Please be aware of the following things when filing bug reports.

1. Don't open duplicate issues. Please search your issue to see if it has been asked already. Duplicate issues will be closed.
2. When filing a bug about exceptions or tracebacks, please include the *complete* traceback. Without the complete traceback the issue might be **unsolvable** and you will be asked to provide more information.
3. Make sure to provide enough information to make the issue workable. The issue template will generally walk you through the process but they are enumerated here as well:
    - A **summary** of your bug report. This is generally a quick sentence or two to describe the issue in human terms.
    - Guidance on **how to reproduce the issue**. Ideally, this should have a small code sample that allows us to run and see the issue for ourselves to debug. **Please make sure that the token is not displayed**. If you cannot provide a code snippet, then let us know what the steps were, how often it happens, etc.
    - Tell us **what you expected to happen**. That way we can meet that expectation.
    - Tell us **what actually happens**. What ends up happening in reality? It's not helpful to say "it fails" or "it doesn't work". Say *how* it failed, do you get an exception? Does it hang? How are the expectations different from reality?
    - Tell us **information about your environment**. What version of discord.py are you using? How was it installed? What operating system are you running on? These are valuable questions and information that we use.

If the bug report is missing this information then it'll take us longer to fix the issue. We will probably ask for clarification, and barring that if no response was given then the issue will be closed.

## Submitting a Pull Request

Submitting a pull request is fairly simple, just make sure it focuses on a single aspect and doesn't manage to have scope creep and it's probably good to go. It would be incredibly lovely if the style is consistent to that found in the project. This project follows PEP-8 guidelines (mostly) with a column limit of 125.

### Git Commit Guidelines

- Use present tense (e.g. "Add feature" not "Added feature")
- Limit all lines to 72 characters or less.
- Reference issues or pull requests outside of the first line.
    - Please use the shorthand `#123` and not the full URL.
- Commits regarding the commands extension must be prefixed with `[commands]`

If you do not meet any of these guidelines, don't fret. Chances are they will be fixed upon rebasing but please do try to meet them to remove some of the workload.


================================================
FILE: .github/FUNDING.yml
================================================
open_collective: discordpy


================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.yml
================================================
name: Bug Report
description: Report broken or incorrect behaviour
labels: unconfirmed bug
body:
  - type: markdown
    attributes:
      value: >
        Thanks for taking the time to fill out a bug.
        If you want real-time support, consider joining our Discord at https://discord.gg/r3sSKJJ instead.

        Please note that this form is for bugs only!
  - type: input
    attributes:
      label: Summary
      description: A simple summary of your bug report
    validations:
      required: true
  - type: textarea
    attributes:
      label: Reproduction Steps
      description: >
         What you did to make it happen.
    validations:
      required: true
  - type: textarea
    attributes:
      label: Minimal Reproducible Code
      description: >
        A short snippet of code that showcases the bug.
      render: python
  - type: textarea
    attributes:
      label: Expected Results
      description: >
        What did you expect to happen?
    validations:
      required: true
  - type: textarea
    attributes:
      label: Actual Results
      description: >
        What actually happened?
    validations:
      required: true
  - type: input
    attributes:
      label: Intents
      description: >
        What intents are you using for your bot?
        This is the `discord.Intents` class you pass to the client.
    validations:
      required: true
  - type: textarea
    attributes:
      label: System Information
      description: >
        Run `python -m discord -v` and paste this information below.

        This command required v1.1.0 or higher of the library. If this errors out then show some basic
        information involving your system such as operating system and Python version.
    validations:
      required: true
  - type: checkboxes
    attributes:
      label: Checklist
      description: >
        Let's make sure you've properly done due diligence when reporting this issue!
      options:
        - label: I have searched the open issues for duplicates.
          required: true
        - label: I have shown the entire traceback, if possible.
          required: true
        - label: I have removed my token from display, if visible.
          required: true
  - type: textarea
    attributes:
      label: Additional Context
      description: If there is anything else to say, please do so here.


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
contact_links:
  - name: Ask a question
    about: Ask questions and discuss with other users of the library.
    url: https://github.com/Rapptz/discord.py/discussions
  - name: Discord Server
    about: Use our official Discord server to ask for help and questions as well.
    url: https://discord.gg/r3sSKJJ


================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.yml
================================================
name: Feature Request
description: Suggest a feature for this library
labels: feature request
body:
  - type: input
    attributes:
      label: Summary
      description: >
        A short summary of what your feature request is.
    validations:
      required: true
  - type: dropdown
    attributes:
      multiple: false
      label: What is the feature request for?
      options:
        - The core library
        - discord.ext.commands
        - discord.ext.tasks
        - The documentation
    validations:
      required: true
  - type: textarea
    attributes:
      label: The Problem
      description: >
        What problem is your feature trying to solve?
        What becomes easier or possible when this feature is implemented?
    validations:
      required: true
  - type: textarea
    attributes:
      label: The Ideal Solution
      description: >
        What is your ideal solution to the problem?
        What would you like this feature to do?
    validations:
      required: true
  - type: textarea
    attributes:
      label: The Current Solution
      description: >
        What is the current solution to the problem, if any?
    validations:
      required: false
  - type: textarea
    attributes:
      label: Additional Context
      description: If there is anything else to say, please do so here.


================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
## Summary

<!-- What is this pull request for? Does it fix any issues? -->

## Checklist

<!-- Put an x inside [ ] to check it, like so: [x] -->

- [ ] If code changes were made then they have been tested.
    - [ ] I have updated the documentation to reflect the changes.
- [ ] This PR fixes an issue.
- [ ] This PR adds something new (e.g. new method or parameters).
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
- [ ] This PR is **not** a code change (e.g. documentation, README, ...)


================================================
FILE: .github/workflows/build.yml
================================================
name: build

on:
  push:
  pull_request:
    types: [ opened, reopened, synchronize ]

jobs:
  dists-and-docs:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: [ '3.8', '3.x' ]
        language: [ 'en', 'ja' ]

    name: dists & docs (${{ matrix.python-version }}/${{ matrix.language }})
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Set up CPython ${{ matrix.python-version }}
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip setuptools wheel
          pip install -U -r requirements.txt

      - name: Build distributions
        run: |
          python ./setup.py sdist bdist_wheel

      # - name: Upload artifacts
      #   uses: actions/upload-artifact@v2
      #   with:
      #     name: distributions
      #     path: dist/*

      - name: Install package
        run: |
          pip install -e .[docs,speed,voice]

      - name: Build docs
        shell: bash
        run: |
          cd docs
          sphinx-build -b html -D language=${DOCS_LANGUAGE} -j auto -a -n -T -W --keep-going . _build/html
        env:
          DOCS_LANGUAGE: ${{ matrix.language }}

      # - name: Upload docs
      #   uses: actions/upload-artifact@v2
      #   if: always()
      #   with:
      #     name: docs-${{ matrix.language }}
      #     path: docs/_build/html/*


================================================
FILE: .github/workflows/crowdin_download.yml
================================================
name: crowdin download

on:
  schedule:
    - cron: '0 18 * * 1'
  workflow_dispatch:

jobs:
  check-environment:
    runs-on: ubuntu-latest
    environment: Crowdin
    outputs:
      available: ${{ steps.check.outputs.available }}
    steps:
      - id: check
        if: env.CROWDIN_API_KEY != null
        run: |
          echo "available=true" >> $GITHUB_OUTPUT
        env:
          CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}

  download:
    runs-on: ubuntu-latest
    needs: [ check-environment ]
    # secrets cannot be accessed inside an `if` so this needs to be checked in separate job
    if: needs.check-environment.outputs.available == 'true'
    environment: Crowdin
    name: download
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          ref: master

      - name: Install system dependencies
        run: |
          wget -qO - https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
          echo "deb https://artifacts.crowdin.com/repo/deb/ /" | sudo tee -a /etc/apt/sources.list.d/crowdin.list
          sudo apt-get update -qq
          sudo apt-get install -y crowdin3

      - name: Download translations
        shell: bash
        run: |
          cd docs
          crowdin download --all
        env:
          CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}

      - name: Create pull request
        id: cpr_crowdin
        uses: peter-evans/create-pull-request@v3
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          commit-message: Crowdin translations download
          title: "[Crowdin] Updated translation files"
          body: |
            Created by the [Crowdin download workflow](.github/workflows/crowdin_download.yml).
          branch: "auto/crowdin"
          author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

      - name: Close and reopen the PR with different token to trigger CI
        uses: actions/github-script@v3
        env:
          PR_NUMBER: ${{ steps.cpr_crowdin.outputs.pull-request-number }}
          PR_OPERATION: ${{ steps.cpr_crowdin.outputs.pull-request-operation }}
        with:
          github-token: ${{ secrets.GH_REPO_SCOPED_TOKEN }}
          script: |
            const script = require(
              `${process.env.GITHUB_WORKSPACE}/.github/workflows/scripts/close_and_reopen_pr.js`
            );
            console.log(script({github, context}));


================================================
FILE: .github/workflows/crowdin_upload.yml
================================================
name: crowdin upload

on:
  workflow_dispatch:

jobs:
  upload:
    runs-on: ubuntu-latest
    environment: Crowdin
    name: upload
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Set up CPython 3.x
        uses: actions/setup-python@v4
        with:
          python-version: 3.x

      - name: Install system dependencies
        run: |
          wget -qO - https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
          echo "deb https://artifacts.crowdin.com/repo/deb/ /" | sudo tee -a /etc/apt/sources.list.d/crowdin.list
          sudo apt-get update -qq
          sudo apt-get install -y crowdin3

      - name: Install Python dependencies
        run: |
          python -m pip install --upgrade pip setuptools wheel
          pip install -e .[docs,speed,voice]

      - name: Build gettext
        run: |
          cd docs
          make gettext

      - name: Upload sources
        shell: bash
        run: |
          cd docs
          crowdin upload
        env:
          CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}


================================================
FILE: .github/workflows/lint.yml
================================================
name: lint

on:
  push:
  pull_request:
    types: [ opened, reopened, synchronize ]

jobs:
  check:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: [ '3.8', '3.x' ]

    name: check ${{ matrix.python-version }}
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Set up CPython ${{ matrix.python-version }}
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install dependencies
        id: install-deps
        run: |
          python -m pip install --upgrade pip setuptools wheel black==22.6 requests
          pip install -U -r requirements.txt

      - name: Setup node.js
        uses: actions/setup-node@v3
        with:
          node-version: '16'

      - name: Run Pyright
        uses: jakebailey/pyright-action@v1
        with:
          version: '1.1.351'
          warnings: false
          no-comments: ${{ matrix.python-version != '3.x' }}

      - name: Run black
        if: ${{ always() && steps.install-deps.outcome == 'success' }}
        run: |
          black --check discord examples


================================================
FILE: .github/workflows/scripts/close_and_reopen_pr.js
================================================
module.exports = (async function ({github, context}) {
    const pr_number = process.env.PR_NUMBER;
    const pr_operation = process.env.PR_OPERATION;

    if (!['created', 'updated'].includes(pr_operation)) {
        console.log('PR was not created as there were no changes.')
        return;
    }

    for (const state of ['closed', 'open']) {
        // Wait a moment for GitHub to process the previous action..
        await new Promise(r => setTimeout(r, 5000));

        // Close the PR
        github.issues.update({
            issue_number: pr_number,
            owner: context.repo.owner,
            repo: context.repo.repo,
            state
        });
    }
})


================================================
FILE: .github/workflows/test.yml
================================================
name: test

on:
  push:
  pull_request:
    types: [ opened, reopened, synchronize ]

jobs:
  pytest:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: [ '3.8', '3.x' ]

    name: pytest ${{ matrix.python-version }}
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Set up CPython ${{ matrix.python-version }}
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install dependencies
        run: |
          python -m pip install -e .[test]

      - name: Run tests
        shell: bash
        run: |
          PYTHONPATH="$(pwd)" pytest -vs --cov=discord --cov-report term-missing:skip-covered


================================================
FILE: .gitignore
================================================
*.json
*.py[cod]
*.log
*.egg-info
venv
.venv
docs/_build
docs/crowdin.py
*.buildinfo
*.mp3
*.m4a
*.wav
*.png
*.jpg
*.flac
*.mo
/.coverage
build/*


================================================
FILE: .readthedocs.yml
================================================
version: 2
formats: []

build:
  os: "ubuntu-22.04"
  tools:
    python: "3.8"

sphinx:
  configuration: docs/conf.py
  fail_on_warning: false
  builder: html

python:
  install:
    - method: pip
      path: .
      extra_requirements:
        - docs


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2015-present Rapptz

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.


================================================
FILE: MANIFEST.in
================================================
include README.rst
include LICENSE
include requirements.txt
include discord/bin/*.dll
include discord/py.typed


================================================
FILE: README.ja.rst
================================================
discord.py
==========

.. image:: https://discord.com/api/guilds/336642139381301249/embed.png
   :target: https://discord.gg/nXzj3dg
   :alt: Discordサーバーの招待
.. image:: https://img.shields.io/pypi/v/discord.py.svg
   :target: https://pypi.python.org/pypi/discord.py
   :alt: PyPIのバージョン情報
.. image:: https://img.shields.io/pypi/pyversions/discord.py.svg
   :target: https://pypi.python.org/pypi/discord.py
   :alt: PyPIのサポートしているPythonのバージョン

discord.py は機能豊富かつモダンで使いやすい、非同期処理にも対応したDiscord用のAPIラッパーです。

主な特徴
-------------

- ``async`` と ``await`` を使ったモダンなPythonらしいAPI。
- 適切なレート制限処理
- メモリと速度の両方を最適化。

インストール
-------------

**Python 3.8 以降のバージョンが必須です**

完全な音声サポートなしでライブラリをインストールする場合は次のコマンドを実行してください:

.. code:: sh

    # Linux/macOS
    python3 -m pip install -U discord.py

    # Windows
    py -3 -m pip install -U discord.py

音声サポートが必要なら、次のコマンドを実行しましょう:

.. code:: sh

    # Linux/macOS
    python3 -m pip install -U discord.py[voice]

    # Windows
    py -3 -m pip install -U discord.py[voice]


開発版をインストールしたいのならば、次の手順に従ってください:

.. code:: sh

    $ git clone https://github.com/Rapptz/discord.py
    $ cd discord.py
    $ python3 -m pip install -U .[voice]


オプションパッケージ
~~~~~~~~~~~~~~~~~~~~~~

* PyNaCl (音声サポート用)

Linuxで音声サポートを導入するには、前述のコマンドを実行する前にお気に入りのパッケージマネージャー(例えば ``apt`` や ``dnf`` など)を使って以下のパッケージをインストールする必要があります:

* libffi-dev (システムによっては ``libffi-devel``)
* python-dev (例えばPython 3.8用の ``python3.8-dev``)

簡単な例
--------------

.. code:: py

    import discord

    class MyClient(discord.Client):
        async def on_ready(self):
            print('Logged on as', self.user)

        async def on_message(self, message):
            # don't respond to ourselves
            if message.author == self.user:
                return

            if message.content == 'ping':
                await message.channel.send('pong')

    intents = discord.Intents.default()
    intents.message_content = True
    client = MyClient(intents=intents)
    client.run('token')

Botの例
~~~~~~~~~~~~~

.. code:: py

    import discord
    from discord.ext import commands

    intents = discord.Intents.default()
    intents.message_content = True
    bot = commands.Bot(command_prefix='>', intents=intents)

    @bot.command()
    async def ping(ctx):
        await ctx.send('pong')

    bot.run('token')

examplesディレクトリに更に多くのサンプルがあります。

リンク
------

- `ドキュメント <https://discordpy.readthedocs.io/ja/latest/index.html>`_
- `公式Discordサーバー <https://discord.gg/nXzj3dg>`_
- `Discord API <https://discord.gg/discord-api>`_


================================================
FILE: README.rst
================================================
discord.py
==========

.. image:: https://discord.com/api/guilds/336642139381301249/embed.png
   :target: https://discord.gg/r3sSKJJ
   :alt: Discord server invite
.. image:: https://img.shields.io/pypi/v/discord.py.svg
   :target: https://pypi.python.org/pypi/discord.py
   :alt: PyPI version info
.. image:: https://img.shields.io/pypi/pyversions/discord.py.svg
   :target: https://pypi.python.org/pypi/discord.py
   :alt: PyPI supported Python versions

A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.

Key Features
-------------

- Modern Pythonic API using ``async`` and ``await``.
- Proper rate limit handling.
- Optimised in both speed and memory.

Installing
----------

**Python 3.8 or higher is required**

To install the library without full voice support, you can just run the following command:

.. code:: sh

    # Linux/macOS
    python3 -m pip install -U discord.py

    # Windows
    py -3 -m pip install -U discord.py

Otherwise to get voice support you should run the following command:

.. code:: sh

    # Linux/macOS
    python3 -m pip install -U "discord.py[voice]"

    # Windows
    py -3 -m pip install -U discord.py[voice]


To install the development version, do the following:

.. code:: sh

    $ git clone https://github.com/Rapptz/discord.py
    $ cd discord.py
    $ python3 -m pip install -U .[voice]


Optional Packages
~~~~~~~~~~~~~~~~~~

* `PyNaCl <https://pypi.org/project/PyNaCl/>`__ (for voice support)

Please note that when installing voice support on Linux, you must install the following packages via your favourite package manager (e.g. ``apt``, ``dnf``, etc) before running the above commands:

* libffi-dev (or ``libffi-devel`` on some systems)
* python-dev (e.g. ``python3.8-dev`` for Python 3.8)

Quick Example
--------------

.. code:: py

    import discord

    class MyClient(discord.Client):
        async def on_ready(self):
            print('Logged on as', self.user)

        async def on_message(self, message):
            # don't respond to ourselves
            if message.author == self.user:
                return

            if message.content == 'ping':
                await message.channel.send('pong')

    intents = discord.Intents.default()
    intents.message_content = True
    client = MyClient(intents=intents)
    client.run('token')

Bot Example
~~~~~~~~~~~~~

.. code:: py

    import discord
    from discord.ext import commands

    intents = discord.Intents.default()
    intents.message_content = True
    bot = commands.Bot(command_prefix='>', intents=intents)

    @bot.command()
    async def ping(ctx):
        await ctx.send('pong')

    bot.run('token')

You can find more examples in the examples directory.

Links
------

- `Documentation <https://discordpy.readthedocs.io/en/latest/index.html>`_
- `Official Discord Server <https://discord.gg/r3sSKJJ>`_
- `Discord API <https://discord.gg/discord-api>`_


================================================
FILE: discord/__init__.py
================================================
"""
Discord API Wrapper
~~~~~~~~~~~~~~~~~~~

A basic wrapper for the Discord API.

:copyright: (c) 2015-present Rapptz
:license: MIT, see LICENSE for more details.

"""

__title__ = 'discord'
__author__ = 'Rapptz'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015-present Rapptz'
__version__ = '2.5.0a'

__path__ = __import__('pkgutil').extend_path(__path__, __name__)

import logging
from typing import NamedTuple, Literal

from .client import *
from .appinfo import *
from .user import *
from .emoji import *
from .partial_emoji import *
from .activity import *
from .channel import *
from .guild import *
from .flags import *
from .member import *
from .message import *
from .asset import *
from .errors import *
from .permissions import *
from .role import *
from .file import *
from .colour import *
from .integrations import *
from .invite import *
from .template import *
from .welcome_screen import *
from .sku import *
from .widget import *
from .object import *
from .reaction import *
from . import (
    utils as utils,
    opus as opus,
    abc as abc,
    ui as ui,
    app_commands as app_commands,
)
from .enums import *
from .embeds import *
from .mentions import *
from .shard import *
from .player import *
from .webhook import *
from .voice_client import *
from .audit_logs import *
from .raw_models import *
from .team import *
from .sticker import *
from .stage_instance import *
from .scheduled_event import *
from .interactions import *
from .components import *
from .threads import *
from .automod import *
from .poll import *


class VersionInfo(NamedTuple):
    major: int
    minor: int
    micro: int
    releaselevel: Literal["alpha", "beta", "candidate", "final"]
    serial: int


version_info: VersionInfo = VersionInfo(major=2, minor=5, micro=0, releaselevel='alpha', serial=0)

logging.getLogger(__name__).addHandler(logging.NullHandler())

del logging, NamedTuple, Literal, VersionInfo


================================================
FILE: discord/__main__.py
================================================
"""
The MIT License (MIT)

Copyright (c) 2015-present Rapptz

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

from __future__ import annotations

from typing import Optional, Tuple, Dict

import argparse
import sys
from pathlib import Path

import discord
import importlib.metadata
import aiohttp
import platform


def show_version() -> None:
    entries = []

    entries.append('- Python v{0.major}.{0.minor}.{0.micro}-{0.releaselevel}'.format(sys.version_info))
    version_info = discord.version_info
    entries.append('- discord.py v{0.major}.{0.minor}.{0.micro}-{0.releaselevel}'.format(version_info))
    if version_info.releaselevel != 'final':
        version = importlib.metadata.version('discord.py')
        if version:
            entries.append(f'    - discord.py metadata: v{version}')

    entries.append(f'- aiohttp v{aiohttp.__version__}')
    uname = platform.uname()
    entries.append('- system info: {0.system} {0.release} {0.version}'.format(uname))
    print('\n'.join(entries))


def core(parser: argparse.ArgumentParser, args: argparse.Namespace) -> None:
    if args.version:
        show_version()
    else:
        parser.print_help()


_bot_template = """#!/usr/bin/env python3

from discord.ext import commands
import discord
import config

class Bot(commands.{base}):
    def __init__(self, intents: discord.Intents, **kwargs):
        super().__init__(command_prefix=commands.when_mentioned_or('{prefix}'), intents=intents, **kwargs)

    async def setup_hook(self):
        for cog in config.cogs:
            try:
                await self.load_extension(cog)
            except Exception as exc:
                print(f'Could not load extension {{cog}} due to {{exc.__class__.__name__}}: {{exc}}')

    async def on_ready(self):
        print(f'Logged on as {{self.user}} (ID: {{self.user.id}})')


intents = discord.Intents.default()
intents.message_content = True
bot = Bot(intents=intents)

# write general commands here

bot.run(config.token)
"""

_gitignore_template = """# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# Our configuration files
config.py
"""

_cog_template = '''from discord.ext import commands
import discord

class {name}(commands.Cog{attrs}):
    """The description for {name} goes here."""

    def __init__(self, bot):
        self.bot = bot
{extra}
async def setup(bot):
    await bot.add_cog({name}(bot))
'''

_cog_extras = '''
    async def cog_load(self):
        # loading logic goes here
        pass

    async def cog_unload(self):
        # clean up logic goes here
        pass

    async def cog_check(self, ctx):
        # checks that apply to every command in here
        return True

    async def bot_check(self, ctx):
        # checks that apply to every command to the bot
        return True

    async def bot_check_once(self, ctx):
        # check that apply to every command but is guaranteed to be called only once
        return True

    async def cog_command_error(self, ctx, error):
        # error handling to every command in here
        pass

    async def cog_app_command_error(self, interaction, error):
        # error handling to every application command in here
        pass

    async def cog_before_invoke(self, ctx):
        # called before a command is called here
        pass

    async def cog_after_invoke(self, ctx):
        # called after a command is called here
        pass

'''


# certain file names and directory names are forbidden
# see: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx
# although some of this doesn't apply to Linux, we might as well be consistent
_base_table: Dict[str, Optional[str]] = {
    '<': '-',
    '>': '-',
    ':': '-',
    '"': '-',
    # '/': '-', these are fine
    # '\\': '-',
    '|': '-',
    '?': '-',
    '*': '-',
}

# NUL (0) and 1-31 are disallowed
_base_table.update((chr(i), None) for i in range(32))

_translation_table = str.maketrans(_base_table)


def to_path(parser: argparse.ArgumentParser, name: str, *, replace_spaces: bool = False) -> Path:
    if isinstance(name, Path):
        return name

    if sys.platform == 'win32':
        forbidden = (
            'CON',
            'PRN',
            'AUX',
            'NUL',
            'COM1',
            'COM2',
            'COM3',
            'COM4',
            'COM5',
            'COM6',
            'COM7',
            'COM8',
            'COM9',
            'LPT1',
            'LPT2',
            'LPT3',
            'LPT4',
            'LPT5',
            'LPT6',
            'LPT7',
            'LPT8',
            'LPT9',
        )
        if len(name) <= 4 and name.upper() in forbidden:
            parser.error('invalid directory name given, use a different one')

    name = name.translate(_translation_table)
    if replace_spaces:
        name = name.replace(' ', '-')
    return Path(name)


def newbot(parser: argparse.ArgumentParser, args: argparse.Namespace) -> None:
    new_directory = to_path(parser, args.directory) / to_path(parser, args.name)

    # as a note exist_ok for Path is a 3.5+ only feature
    # since we already checked above that we're >3.5
    try:
        new_directory.mkdir(exist_ok=True, parents=True)
    except OSError as exc:
        parser.error(f'could not create our bot directory ({exc})')

    cogs = new_directory / 'cogs'

    try:
        cogs.mkdir(exist_ok=True)
        init = cogs / '__init__.py'
        init.touch()
    except OSError as exc:
        print(f'warning: could not create cogs directory ({exc})')

    try:
        with open(str(new_directory / 'config.py'), 'w', encoding='utf-8') as fp:
            fp.write('token = "place your token here"\ncogs = []\n')
    except OSError as exc:
        parser.error(f'could not create config file ({exc})')

    try:
        with open(str(new_directory / 'bot.py'), 'w', encoding='utf-8') as fp:
            base = 'Bot' if not args.sharded else 'AutoShardedBot'
            fp.write(_bot_template.format(base=base, prefix=args.prefix))
    except OSError as exc:
        parser.error(f'could not create bot file ({exc})')

    if not args.no_git:
        try:
            with open(str(new_directory / '.gitignore'), 'w', encoding='utf-8') as fp:
                fp.write(_gitignore_template)
        except OSError as exc:
            print(f'warning: could not create .gitignore file ({exc})')

    print('successfully made bot at', new_directory)


def newcog(parser: argparse.ArgumentParser, args: argparse.Namespace) -> None:
    cog_dir = to_path(parser, args.directory)
    try:
        cog_dir.mkdir(exist_ok=True)
    except OSError as exc:
        print(f'warning: could not create cogs directory ({exc})')

    directory = cog_dir / to_path(parser, args.name)
    directory = directory.with_suffix('.py')
    try:
        with open(str(directory), 'w', encoding='utf-8') as fp:
            attrs = ''
            extra = _cog_extras if args.full else ''
            if args.class_name:
                name = args.class_name
            else:
                name = str(directory.stem)
                if '-' in name or '_' in name:
                    translation = str.maketrans('-_', '  ')
                    name = name.translate(translation).title().replace(' ', '')
                else:
                    name = name.title()

            if args.display_name:
                attrs += f', name="{args.display_name}"'
            if args.hide_commands:
                attrs += ', command_attrs=dict(hidden=True)'
            fp.write(_cog_template.format(name=name, extra=extra, attrs=attrs))
    except OSError as exc:
        parser.error(f'could not create cog file ({exc})')
    else:
        print('successfully made cog at', directory)


def add_newbot_args(subparser: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
    parser = subparser.add_parser('newbot', help='creates a command bot project quickly')
    parser.set_defaults(func=newbot)

    parser.add_argument('name', help='the bot project name')
    parser.add_argument('directory', help='the directory to place it in (default: .)', nargs='?', default=Path.cwd())
    parser.add_argument('--prefix', help='the bot prefix (default: $)', default='$', metavar='<prefix>')
    parser.add_argument('--sharded', help='whether to use AutoShardedBot', action='store_true')
    parser.add_argument('--no-git', help='do not create a .gitignore file', action='store_true', dest='no_git')


def add_newcog_args(subparser: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
    parser = subparser.add_parser('newcog', help='creates a new cog template quickly')
    parser.set_defaults(func=newcog)

    parser.add_argument('name', help='the cog name')
    parser.add_argument('directory', help='the directory to place it in (default: cogs)', nargs='?', default=Path('cogs'))
    parser.add_argument('--class-name', help='the class name of the cog (default: <name>)', dest='class_name')
    parser.add_argument('--display-name', help='the cog name (default: <name>)')
    parser.add_argument('--hide-commands', help='whether to hide all commands in the cog', action='store_true')
    parser.add_argument('--full', help='add all special methods as well', action='store_true')


def parse_args() -> Tuple[argparse.ArgumentParser, argparse.Namespace]:
    parser = argparse.ArgumentParser(prog='discord', description='Tools for helping with discord.py')
    parser.add_argument('-v', '--version', action='store_true', help='shows the library version')
    parser.set_defaults(func=core)

    subparser = parser.add_subparsers(dest='subcommand', title='subcommands')
    add_newbot_args(subparser)
    add_newcog_args(subparser)
    return parser, parser.parse_args()


def main() -> None:
    parser, args = parse_args()
    args.func(parser, args)


if __name__ == '__main__':
    main()


================================================
FILE: discord/_types.py
================================================
"""
The MIT License (MIT)

Copyright (c) 2015-present Rapptz

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

from __future__ import annotations
from typing import TypeVar, TYPE_CHECKING

if TYPE_CHECKING:
    from typing_extensions import TypeVar
    from .client import Client

    ClientT = TypeVar('ClientT', bound=Client, covariant=True, default=Client)
else:
    ClientT = TypeVar('ClientT', bound='Client', covariant=True)


================================================
FILE: discord/abc.py
================================================
"""
The MIT License (MIT)

Copyright (c) 2015-present Rapptz

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

from __future__ import annotations

import copy
import time
import asyncio
from datetime import datetime
from typing import (
    Any,
    AsyncIterator,
    Callable,
    Dict,
    Iterable,
    List,
    Optional,
    TYPE_CHECKING,
    Protocol,
    Sequence,
    Tuple,
    TypeVar,
    Union,
    overload,
    runtime_checkable,
)

from .object import OLDEST_OBJECT, Object
from .context_managers import Typing
from .enums import ChannelType, InviteTarget
from .errors import ClientException, NotFound
from .mentions import AllowedMentions
from .permissions import PermissionOverwrite, Permissions
from .role import Role
from .invite import Invite
from .file import File
from .http import handle_message_parameters
from .voice_client import VoiceClient, VoiceProtocol
from .sticker import GuildSticker, StickerItem
from . import utils

__all__ = (
    'Snowflake',
    'User',
    'PrivateChannel',
    'GuildChannel',
    'Messageable',
    'Connectable',
)

T = TypeVar('T', bound=VoiceProtocol)

if TYPE_CHECKING:
    from typing_extensions import Self

    from .client import Client
    from .user import ClientUser
    from .asset import Asset
    from .state import ConnectionState
    from .guild import Guild
    from .member import Member
    from .channel import CategoryChannel
    from .embeds import Embed
    from .message import Message, MessageReference, PartialMessage
    from .channel import (
        TextChannel,
        DMChannel,
        GroupChannel,
        PartialMessageable,
        VocalGuildChannel,
        VoiceChannel,
        StageChannel,
    )
    from .poll import Poll
    from .threads import Thread
    from .ui.view import View
    from .types.channel import (
        PermissionOverwrite as PermissionOverwritePayload,
        Channel as ChannelPayload,
        GuildChannel as GuildChannelPayload,
        OverwriteType,
    )
    from .types.snowflake import (
        SnowflakeList,
    )

    PartialMessageableChannel = Union[TextChannel, VoiceChannel, StageChannel, Thread, DMChannel, PartialMessageable]
    MessageableChannel = Union[PartialMessageableChannel, GroupChannel]
    SnowflakeTime = Union["Snowflake", datetime]

MISSING = utils.MISSING


class _Undefined:
    def __repr__(self) -> str:
        return 'see-below'


_undefined: Any = _Undefined()


async def _single_delete_strategy(messages: Iterable[Message], *, reason: Optional[str] = None):
    for m in messages:
        try:
            await m.delete()
        except NotFound as exc:
            if exc.code == 10008:
                continue  # bulk deletion ignores not found messages, single deletion does not.
            # several other race conditions with deletion should fail without continuing,
            # such as the channel being deleted and not found.
            raise


async def _purge_helper(
    channel: Union[Thread, TextChannel, VocalGuildChannel],
    *,
    limit: Optional[int] = 100,
    check: Callable[[Message], bool] = MISSING,
    before: Optional[SnowflakeTime] = None,
    after: Optional[SnowflakeTime] = None,
    around: Optional[SnowflakeTime] = None,
    oldest_first: Optional[bool] = None,
    bulk: bool = True,
    reason: Optional[str] = None,
) -> List[Message]:
    if check is MISSING:
        check = lambda m: True

    iterator = channel.history(limit=limit, before=before, after=after, oldest_first=oldest_first, around=around)
    ret: List[Message] = []
    count = 0

    minimum_time = int((time.time() - 14 * 24 * 60 * 60) * 1000.0 - 1420070400000) << 22
    strategy = channel.delete_messages if bulk else _single_delete_strategy

    async for message in iterator:
        if count == 100:
            to_delete = ret[-100:]
            await strategy(to_delete, reason=reason)
            count = 0
            await asyncio.sleep(1)

        if not check(message):
            continue

        if message.id < minimum_time:
            # older than 14 days old
            if count == 1:
                await ret[-1].delete()
            elif count >= 2:
                to_delete = ret[-count:]
                await strategy(to_delete, reason=reason)

            count = 0
            strategy = _single_delete_strategy

        count += 1
        ret.append(message)

    # Some messages remaining to poll
    if count >= 2:
        # more than 2 messages -> bulk delete
        to_delete = ret[-count:]
        await strategy(to_delete, reason=reason)
    elif count == 1:
        # delete a single message
        await ret[-1].delete()

    return ret


@runtime_checkable
class Snowflake(Protocol):
    """An ABC that details the common operations on a Discord model.

    Almost all :ref:`Discord models <discord_api_models>` meet this
    abstract base class.

    If you want to create a snowflake on your own, consider using
    :class:`.Object`.

    Attributes
    -----------
    id: :class:`int`
        The model's unique ID.
    """

    id: int


@runtime_checkable
class User(Snowflake, Protocol):
    """An ABC that details the common operations on a Discord user.

    The following implement this ABC:

    - :class:`~discord.User`
    - :class:`~discord.ClientUser`
    - :class:`~discord.Member`

    This ABC must also implement :class:`~discord.abc.Snowflake`.

    Attributes
    -----------
    name: :class:`str`
        The user's username.
    discriminator: :class:`str`
        The user's discriminator. This is a legacy concept that is no longer used.
    global_name: Optional[:class:`str`]
        The user's global nickname.
    bot: :class:`bool`
        If the user is a bot account.
    system: :class:`bool`
        If the user is a system account.
    """

    name: str
    discriminator: str
    global_name: Optional[str]
    bot: bool
    system: bool

    @property
    def display_name(self) -> str:
        """:class:`str`: Returns the user's display name."""
        raise NotImplementedError

    @property
    def mention(self) -> str:
        """:class:`str`: Returns a string that allows you to mention the given user."""
        raise NotImplementedError

    @property
    def avatar(self) -> Optional[Asset]:
        """Optional[:class:`~discord.Asset`]: Returns an Asset that represents the user's avatar, if present."""
        raise NotImplementedError

    @property
    def avatar_decoration(self) -> Optional[Asset]:
        """Optional[:class:`~discord.Asset`]: Returns an Asset that represents the user's avatar decoration, if present.

        .. versionadded:: 2.4
        """
        raise NotImplementedError

    @property
    def avatar_decoration_sku_id(self) -> Optional[int]:
        """Optional[:class:`int`]: Returns an integer that represents the user's avatar decoration SKU ID, if present.

        .. versionadded:: 2.4
        """
        raise NotImplementedError

    @property
    def default_avatar(self) -> Asset:
        """:class:`~discord.Asset`: Returns the default avatar for a given user."""
        raise NotImplementedError

    @property
    def display_avatar(self) -> Asset:
        """:class:`~discord.Asset`: Returns the user's display avatar.

        For regular users this is just their default avatar or uploaded avatar.

        .. versionadded:: 2.0
        """
        raise NotImplementedError

    def mentioned_in(self, message: Message) -> bool:
        """Checks if the user is mentioned in the specified message.

        Parameters
        -----------
        message: :class:`~discord.Message`
            The message to check if you're mentioned in.

        Returns
        -------
        :class:`bool`
            Indicates if the user is mentioned in the message.
        """
        raise NotImplementedError


class PrivateChannel:
    """An ABC that details the common operations on a private Discord channel.

    The following implement this ABC:

    - :class:`~discord.DMChannel`
    - :class:`~discord.GroupChannel`

    This ABC must also implement :class:`~discord.abc.Snowflake`.

    Attributes
    -----------
    me: :class:`~discord.ClientUser`
        The user presenting yourself.
    """

    __slots__ = ()

    id: int
    me: ClientUser


class _Overwrites:
    __slots__ = ('id', 'allow', 'deny', 'type')

    ROLE = 0
    MEMBER = 1

    def __init__(self, data: PermissionOverwritePayload) -> None:
        self.id: int = int(data['id'])
        self.allow: int = int(data.get('allow', 0))
        self.deny: int = int(data.get('deny', 0))
        self.type: OverwriteType = data['type']

    def _asdict(self) -> PermissionOverwritePayload:
        return {
            'id': self.id,
            'allow': str(self.allow),
            'deny': str(self.deny),
            'type': self.type,
        }

    def is_role(self) -> bool:
        return self.type == 0

    def is_member(self) -> bool:
        return self.type == 1


class GuildChannel:
    """An ABC that details the common operations on a Discord guild channel.

    The following implement this ABC:

    - :class:`~discord.TextChannel`
    - :class:`~discord.VoiceChannel`
    - :class:`~discord.CategoryChannel`
    - :class:`~discord.StageChannel`
    - :class:`~discord.ForumChannel`

    This ABC must also implement :class:`~discord.abc.Snowflake`.

    Attributes
    -----------
    name: :class:`str`
        The channel name.
    guild: :class:`~discord.Guild`
        The guild the channel belongs to.
    position: :class:`int`
        The position in the channel list. This is a number that starts at 0.
        e.g. the top channel is position 0.
    """

    __slots__ = ()

    id: int
    name: str
    guild: Guild
    type: ChannelType
    position: int
    category_id: Optional[int]
    _state: ConnectionState
    _overwrites: List[_Overwrites]

    if TYPE_CHECKING:

        def __init__(self, *, state: ConnectionState, guild: Guild, data: GuildChannelPayload):
            ...

    def __str__(self) -> str:
        return self.name

    @property
    def _sorting_bucket(self) -> int:
        raise NotImplementedError

    def _update(self, guild: Guild, data: Dict[str, Any]) -> None:
        raise NotImplementedError

    async def _move(
        self,
        position: int,
        parent_id: Optional[Any] = None,
        lock_permissions: bool = False,
        *,
        reason: Optional[str],
    ) -> None:
        if position < 0:
            raise ValueError('Channel position cannot be less than 0.')

        http = self._state.http
        bucket = self._sorting_bucket
        channels: List[GuildChannel] = [c for c in self.guild.channels if c._sorting_bucket == bucket]

        channels.sort(key=lambda c: c.position)

        try:
            # remove ourselves from the channel list
            channels.remove(self)
        except ValueError:
            # not there somehow lol
            return
        else:
            index = next((i for i, c in enumerate(channels) if c.position >= position), len(channels))
            # add ourselves at our designated position
            channels.insert(index, self)

        payload = []
        for index, c in enumerate(channels):
            d: Dict[str, Any] = {'id': c.id, 'position': index}
            if parent_id is not _undefined and c.id == self.id:
                d.update(parent_id=parent_id, lock_permissions=lock_permissions)
            payload.append(d)

        await http.bulk_channel_update(self.guild.id, payload, reason=reason)

    async def _edit(self, options: Dict[str, Any], reason: Optional[str]) -> Optional[ChannelPayload]:
        try:
            parent = options.pop('category')
        except KeyError:
            parent_id = _undefined
        else:
            parent_id = parent and parent.id

        try:
            options['rate_limit_per_user'] = options.pop('slowmode_delay')
        except KeyError:
            pass

        try:
            options['default_thread_rate_limit_per_user'] = options.pop('default_thread_slowmode_delay')
        except KeyError:
            pass

        try:
            rtc_region = options.pop('rtc_region')
        except KeyError:
            pass
        else:
            options['rtc_region'] = None if rtc_region is None else str(rtc_region)

        try:
            video_quality_mode = options.pop('video_quality_mode')
        except KeyError:
            pass
        else:
            options['video_quality_mode'] = int(video_quality_mode)

        lock_permissions = options.pop('sync_permissions', False)

        try:
            position = options.pop('position')
        except KeyError:
            if parent_id is not _undefined:
                if lock_permissions:
                    category = self.guild.get_channel(parent_id)
                    if category:
                        options['permission_overwrites'] = [c._asdict() for c in category._overwrites]
                options['parent_id'] = parent_id
            elif lock_permissions and self.category_id is not None:
                # if we're syncing permissions on a pre-existing channel category without changing it
                # we need to update the permissions to point to the pre-existing category
                category = self.guild.get_channel(self.category_id)
                if category:
                    options['permission_overwrites'] = [c._asdict() for c in category._overwrites]
        else:
            await self._move(position, parent_id=parent_id, lock_permissions=lock_permissions, reason=reason)

        overwrites = options.get('overwrites', None)
        if overwrites is not None:
            perms = []
            for target, perm in overwrites.items():
                if not isinstance(perm, PermissionOverwrite):
                    raise TypeError(f'Expected PermissionOverwrite received {perm.__class__.__name__}')

                allow, deny = perm.pair()
                payload = {
                    'allow': allow.value,
                    'deny': deny.value,
                    'id': target.id,
                }

                if isinstance(target, Role):
                    payload['type'] = _Overwrites.ROLE
                elif isinstance(target, Object):
                    payload['type'] = _Overwrites.ROLE if target.type is Role else _Overwrites.MEMBER
                else:
                    payload['type'] = _Overwrites.MEMBER

                perms.append(payload)
            options['permission_overwrites'] = perms

        try:
            ch_type = options['type']
        except KeyError:
            pass
        else:
            if not isinstance(ch_type, ChannelType):
                raise TypeError('type field must be of type ChannelType')
            options['type'] = ch_type.value

        try:
            status = options.pop('status')
        except KeyError:
            pass
        else:
            await self._state.http.edit_voice_channel_status(status, channel_id=self.id, reason=reason)

        if options:
            return await self._state.http.edit_channel(self.id, reason=reason, **options)

    def _fill_overwrites(self, data: GuildChannelPayload) -> None:
        self._overwrites = []
        everyone_index = 0
        everyone_id = self.guild.id

        for index, overridden in enumerate(data.get('permission_overwrites', [])):
            overwrite = _Overwrites(overridden)
            self._overwrites.append(overwrite)

            if overwrite.type == _Overwrites.MEMBER:
                continue

            if overwrite.id == everyone_id:
                # the @everyone role is not guaranteed to be the first one
                # in the list of permission overwrites, however the permission
                # resolution code kind of requires that it is the first one in
                # the list since it is special. So we need the index so we can
                # swap it to be the first one.
                everyone_index = index

        # do the swap
        tmp = self._overwrites
        if tmp:
            tmp[everyone_index], tmp[0] = tmp[0], tmp[everyone_index]

    @property
    def changed_roles(self) -> List[Role]:
        """List[:class:`~discord.Role`]: Returns a list of roles that have been overridden from
        their default values in the :attr:`~discord.Guild.roles` attribute."""
        ret = []
        g = self.guild
        for overwrite in filter(lambda o: o.is_role(), self._overwrites):
            role = g.get_role(overwrite.id)
            if role is None:
                continue

            role = copy.copy(role)
            role.permissions.handle_overwrite(overwrite.allow, overwrite.deny)
            ret.append(role)
        return ret

    @property
    def mention(self) -> str:
        """:class:`str`: The string that allows you to mention the channel."""
        return f'<#{self.id}>'

    @property
    def jump_url(self) -> str:
        """:class:`str`: Returns a URL that allows the client to jump to the channel.

        .. versionadded:: 2.0
        """
        return f'https://discord.com/channels/{self.guild.id}/{self.id}'

    @property
    def created_at(self) -> datetime:
        """:class:`datetime.datetime`: Returns the channel's creation time in UTC."""
        return utils.snowflake_time(self.id)

    def overwrites_for(self, obj: Union[Role, User, Object]) -> PermissionOverwrite:
        """Returns the channel-specific overwrites for a member or a role.

        Parameters
        -----------
        obj: Union[:class:`~discord.Role`, :class:`~discord.abc.User`, :class:`~discord.Object`]
            The role or user denoting whose overwrite to get.

        Returns
        ---------
        :class:`~discord.PermissionOverwrite`
            The permission overwrites for this object.
        """

        if isinstance(obj, User):
            predicate = lambda p: p.is_member()
        elif isinstance(obj, Role):
            predicate = lambda p: p.is_role()
        else:
            predicate = lambda p: True

        for overwrite in filter(predicate, self._overwrites):
            if overwrite.id == obj.id:
                allow = Permissions(overwrite.allow)
                deny = Permissions(overwrite.deny)
                return PermissionOverwrite.from_pair(allow, deny)

        return PermissionOverwrite()

    @property
    def overwrites(self) -> Dict[Union[Role, Member, Object], PermissionOverwrite]:
        """Returns all of the channel's overwrites.

        This is returned as a dictionary where the key contains the target which
        can be either a :class:`~discord.Role` or a :class:`~discord.Member` and the value is the
        overwrite as a :class:`~discord.PermissionOverwrite`.

        .. versionchanged:: 2.0
            Overwrites can now be type-aware :class:`~discord.Object` in case of cache lookup failure

        Returns
        --------
        Dict[Union[:class:`~discord.Role`, :class:`~discord.Member`, :class:`~discord.Object`], :class:`~discord.PermissionOverwrite`]
            The channel's permission overwrites.
        """
        ret = {}
        for ow in self._overwrites:
            allow = Permissions(ow.allow)
            deny = Permissions(ow.deny)
            overwrite = PermissionOverwrite.from_pair(allow, deny)
            target = None

            if ow.is_role():
                target = self.guild.get_role(ow.id)
            elif ow.is_member():
                target = self.guild.get_member(ow.id)

            if target is None:
                target_type = Role if ow.is_role() else User
                target = Object(id=ow.id, type=target_type)  # type: ignore

            ret[target] = overwrite
        return ret

    @property
    def category(self) -> Optional[CategoryChannel]:
        """Optional[:class:`~discord.CategoryChannel`]: The category this channel belongs to.

        If there is no category then this is ``None``.
        """
        return self.guild.get_channel(self.category_id)  # type: ignore # These are coerced into CategoryChannel

    @property
    def permissions_synced(self) -> bool:
        """:class:`bool`: Whether or not the permissions for this channel are synced with the
        category it belongs to.

        If there is no category then this is ``False``.

        .. versionadded:: 1.3
        """
        if self.category_id is None:
            return False

        category = self.guild.get_channel(self.category_id)
        return bool(category and category.overwrites == self.overwrites)

    def _apply_implicit_permissions(self, base: Permissions) -> None:
        # if you can't send a message in a channel then you can't have certain
        # permissions as well
        if not base.send_messages:
            base.send_tts_messages = False
            base.mention_everyone = False
            base.embed_links = False
            base.attach_files = False

        # if you can't read a channel then you have no permissions there
        if not base.read_messages:
            denied = Permissions.all_channel()
            base.value &= ~denied.value

    def permissions_for(self, obj: Union[Member, Role], /) -> Permissions:
        """Handles permission resolution for the :class:`~discord.Member`
        or :class:`~discord.Role`.

        This function takes into consideration the following cases:

        - Guild owner
        - Guild roles
        - Channel overrides
        - Member overrides
        - Implicit permissions
        - Member timeout
        - User installed app

        If a :class:`~discord.Role` is passed, then it checks the permissions
        someone with that role would have, which is essentially:

        - The default role permissions
        - The permissions of the role used as a parameter
        - The default role permission overwrites
        - The permission overwrites of the role used as a parameter

        .. versionchanged:: 2.0
            The object passed in can now be a role object.

        .. versionchanged:: 2.0
            ``obj`` parameter is now positional-only.

        .. versionchanged:: 2.4
            User installed apps are now taken into account.
            The permissions returned for a user installed app mirrors the
            permissions Discord returns in :attr:`~discord.Interaction.app_permissions`,
            though it is recommended to use that attribute instead.

        Parameters
        ----------
        obj: Union[:class:`~discord.Member`, :class:`~discord.Role`]
            The object to resolve permissions for. This could be either
            a member or a role. If it's a role then member overwrites
            are not computed.

        Returns
        -------
        :class:`~discord.Permissions`
            The resolved permissions for the member or role.
        """

        # The current cases can be explained as:
        # Guild owner get all permissions -- no questions asked. Otherwise...
        # The @everyone role gets the first application.
        # After that, the applied roles that the user has in the channel
        # (or otherwise) are then OR'd together.
        # After the role permissions are resolved, the member permissions
        # have to take into effect.
        # After all that is done.. you have to do the following:

        # If manage permissions is True, then all permissions are set to True.

        # The operation first takes into consideration the denied
        # and then the allowed.

        if self.guild.owner_id == obj.id:
            return Permissions.all()

        default = self.guild.default_role
        if default is None:

            if self._state.self_id == obj.id:
                return Permissions._user_installed_permissions(in_guild=True)
            else:
                return Permissions.none()

        base = Permissions(default.permissions.value)

        # Handle the role case first
        if isinstance(obj, Role):
            base.value |= obj._permissions

            if base.administrator:
                return Permissions.all()

            # Apply @everyone allow/deny first since it's special
            try:
                maybe_everyone = self._overwrites[0]
                if maybe_everyone.id == self.guild.id:
                    base.handle_overwrite(allow=maybe_everyone.allow, deny=maybe_everyone.deny)
            except IndexError:
                pass

            if obj.is_default():
                return base

            overwrite = utils.get(self._overwrites, type=_Overwrites.ROLE, id=obj.id)
            if overwrite is not None:
                base.handle_overwrite(overwrite.allow, overwrite.deny)

            return base

        roles = obj._roles
        get_role = self.guild.get_role

        # Apply guild roles that the member has.
        for role_id in roles:
            role = get_role(role_id)
            if role is not None:
                base.value |= role._permissions

        # Guild-wide Administrator -> True for everything
        # Bypass all channel-specific overrides
        if base.administrator:
            return Permissions.all()

        # Apply @everyone allow/deny first since it's special
        try:
            maybe_everyone = self._overwrites[0]
            if maybe_everyone.id == self.guild.id:
                base.handle_overwrite(allow=maybe_everyone.allow, deny=maybe_everyone.deny)
                remaining_overwrites = self._overwrites[1:]
            else:
                remaining_overwrites = self._overwrites
        except IndexError:
            remaining_overwrites = self._overwrites

        denies = 0
        allows = 0

        # Apply channel specific role permission overwrites
        for overwrite in remaining_overwrites:
            if overwrite.is_role() and roles.has(overwrite.id):
                denies |= overwrite.deny
                allows |= overwrite.allow

        base.handle_overwrite(allow=allows, deny=denies)

        # Apply member specific permission overwrites
        for overwrite in remaining_overwrites:
            if overwrite.is_member() and overwrite.id == obj.id:
                base.handle_overwrite(allow=overwrite.allow, deny=overwrite.deny)
                break

        if obj.is_timed_out():
            # Timeout leads to every permission except VIEW_CHANNEL and READ_MESSAGE_HISTORY
            # being explicitly denied
            # N.B.: This *must* come last, because it's a conclusive mask
            base.value &= Permissions._timeout_mask()

        return base

    async def delete(self, *, reason: Optional[str] = None) -> None:
        """|coro|

        Deletes the channel.

        You must have :attr:`~discord.Permissions.manage_channels` to do this.

        Parameters
        -----------
        reason: Optional[:class:`str`]
            The reason for deleting this channel.
            Shows up on the audit log.

        Raises
        -------
        ~discord.Forbidden
            You do not have proper permissions to delete the channel.
        ~discord.NotFound
            The channel was not found or was already deleted.
        ~discord.HTTPException
            Deleting the channel failed.
        """
        await self._state.http.delete_channel(self.id, reason=reason)

    @overload
    async def set_permissions(
        self,
        target: Union[Member, Role],
        *,
        overwrite: Optional[Union[PermissionOverwrite, _Undefined]] = ...,
        reason: Optional[str] = ...,
    ) -> None:
        ...

    @overload
    async def set_permissions(
        self,
        target: Union[Member, Role],
        *,
        reason: Optional[str] = ...,
        **permissions: Optional[bool],
    ) -> None:
        ...

    async def set_permissions(
        self,
        target: Union[Member, Role],
        *,
        overwrite: Any = _undefined,
        reason: Optional[str] = None,
        **permissions: Optional[bool],
    ) -> None:
        r"""|coro|

        Sets the channel specific permission overwrites for a target in the
        channel.

        The ``target`` parameter should either be a :class:`~discord.Member` or a
        :class:`~discord.Role` that belongs to guild.

        The ``overwrite`` parameter, if given, must either be ``None`` or
        :class:`~discord.PermissionOverwrite`. For convenience, you can pass in
        keyword arguments denoting :class:`~discord.Permissions` attributes. If this is
        done, then you cannot mix the keyword arguments with the ``overwrite``
        parameter.

        If the ``overwrite`` parameter is ``None``, then the permission
        overwrites are deleted.

        You must have :attr:`~discord.Permissions.manage_roles` to do this.

        .. note::

            This method *replaces* the old overwrites with the ones given.

        Examples
        ----------

        Setting allow and deny: ::

            await message.channel.set_permissions(message.author, read_messages=True,
                                                                  send_messages=False)

        Deleting overwrites ::

            await channel.set_permissions(member, overwrite=None)

        Using :class:`~discord.PermissionOverwrite` ::

            overwrite = discord.PermissionOverwrite()
            overwrite.send_messages = False
            overwrite.read_messages = True
            await channel.set_permissions(member, overwrite=overwrite)

        .. versionchanged:: 2.0
            This function will now raise :exc:`TypeError` instead of
            ``InvalidArgument``.


        Parameters
        -----------
        target: Union[:class:`~discord.Member`, :class:`~discord.Role`]
            The member or role to overwrite permissions for.
        overwrite: Optional[:class:`~discord.PermissionOverwrite`]
            The permissions to allow and deny to the target, or ``None`` to
            delete the overwrite.
        \*\*permissions
            A keyword argument list of permissions to set for ease of use.
            Cannot be mixed with ``overwrite``.
        reason: Optional[:class:`str`]
            The reason for doing this action. Shows up on the audit log.

        Raises
        -------
        ~discord.Forbidden
            You do not have permissions to edit channel specific permissions.
        ~discord.HTTPException
            Editing channel specific permissions failed.
        ~discord.NotFound
            The role or member being edited is not part of the guild.
        TypeError
            The ``overwrite`` parameter was invalid or the target type was not
            :class:`~discord.Role` or :class:`~discord.Member`.
        ValueError
            The ``overwrite`` parameter and ``positions`` parameters were both
            unset.
        """

        http = self._state.http

        if isinstance(target, User):
            perm_type = _Overwrites.MEMBER
        elif isinstance(target, Role):
            perm_type = _Overwrites.ROLE
        else:
            raise ValueError('target parameter must be either Member or Role')

        if overwrite is _undefined:
            if len(permissions) == 0:
                raise ValueError('No overwrite provided.')
            try:
                overwrite = PermissionOverwrite(**permissions)
            except (ValueError, TypeError):
                raise TypeError('Invalid permissions given to keyword arguments.')
        else:
            if len(permissions) > 0:
                raise TypeError('Cannot mix overwrite and keyword arguments.')

        if overwrite is None:
            await http.delete_channel_permissions(self.id, target.id, reason=reason)
        elif isinstance(overwrite, PermissionOverwrite):
            (allow, deny) = overwrite.pair()
            await http.edit_channel_permissions(
                self.id, target.id, str(allow.value), str(deny.value), perm_type, reason=reason
            )
        else:
            raise TypeError('Invalid overwrite type provided.')

    async def _clone_impl(
        self,
        base_attrs: Dict[str, Any],
        *,
        name: Optional[str] = None,
        reason: Optional[str] = None,
    ) -> Self:
        base_attrs['permission_overwrites'] = [x._asdict() for x in self._overwrites]
        base_attrs['parent_id'] = self.category_id
        base_attrs['name'] = name or self.name
        guild_id = self.guild.id
        cls = self.__class__
        data = await self._state.http.create_channel(guild_id, self.type.value, reason=reason, **base_attrs)
        obj = cls(state=self._state, guild=self.guild, data=data)

        # temporarily add it to the cache
        self.guild._channels[obj.id] = obj  # type: ignore # obj is a GuildChannel
        return obj

    async def clone(self, *, name: Optional[str] = None, reason: Optional[str] = None) -> Self:
        """|coro|

        Clones this channel. This creates a channel with the same properties
        as this channel.

        You must have :attr:`~discord.Permissions.manage_channels` to do this.

        .. versionadded:: 1.1

        Parameters
        ------------
        name: Optional[:class:`str`]
            The name of the new channel. If not provided, defaults to this
            channel name.
        reason: Optional[:class:`str`]
            The reason for cloning this channel. Shows up on the audit log.

        Raises
        -------
        ~discord.Forbidden
            You do not have the proper permissions to create this channel.
        ~discord.HTTPException
            Creating the channel failed.

        Returns
        --------
        :class:`.abc.GuildChannel`
            The channel that was created.
        """
        raise NotImplementedError

    @overload
    async def move(
        self,
        *,
        beginning: bool,
        offset: int = MISSING,
        category: Optional[Snowflake] = MISSING,
        sync_permissions: bool = MISSING,
        reason: Optional[str] = MISSING,
    ) -> None:
        ...

    @overload
    async def move(
        self,
        *,
        end: bool,
        offset: int = MISSING,
        category: Optional[Snowflake] = MISSING,
        sync_permissions: bool = MISSING,
        reason: str = MISSING,
    ) -> None:
        ...

    @overload
    async def move(
        self,
        *,
        before: Snowflake,
        offset: int = MISSING,
        category: Optional[Snowflake] = MISSING,
        sync_permissions: bool = MISSING,
        reason: str = MISSING,
    ) -> None:
        ...

    @overload
    async def move(
        self,
        *,
        after: Snowflake,
        offset: int = MISSING,
        category: Optional[Snowflake] = MISSING,
        sync_permissions: bool = MISSING,
        reason: str = MISSING,
    ) -> None:
        ...

    async def move(self, **kwargs: Any) -> None:
        """|coro|

        A rich interface to help move a channel relative to other channels.

        If exact position movement is required, ``edit`` should be used instead.

        You must have :attr:`~discord.Permissions.manage_channels` to do this.

        .. note::

            Voice channels will always be sorted below text channels.
            This is a Discord limitation.

        .. versionadded:: 1.7

        .. versionchanged:: 2.0
            This function will now raise :exc:`TypeError` or
            :exc:`ValueError` instead of ``InvalidArgument``.

        Parameters
        ------------
        beginning: :class:`bool`
            Whether to move the channel to the beginning of the
            channel list (or category if given).
            This is mutually exclusive with ``end``, ``before``, and ``after``.
        end: :class:`bool`
            Whether to move the channel to the end of the
            channel list (or category if given).
            This is mutually exclusive with ``beginning``, ``before``, and ``after``.
        before: :class:`~discord.abc.Snowflake`
            Whether to move the channel before the given channel.
            This is mutually exclusive with ``beginning``, ``end``, and ``after``.
        after: :class:`~discord.abc.Snowflake`
            Whether to move the channel after the given channel.
            This is mutually exclusive with ``beginning``, ``end``, and ``before``.
        offset: :class:`int`
            The number of channels to offset the move by. For example,
            an offset of ``2`` with ``beginning=True`` would move
            it 2 after the beginning. A positive number moves it below
            while a negative number moves it above. Note that this
            number is relative and computed after the ``beginning``,
            ``end``, ``before``, and ``after`` parameters.
        category: Optional[:class:`~discord.abc.Snowflake`]
            The category to move this channel under.
            If ``None`` is given then it moves it out of the category.
            This parameter is ignored if moving a category channel.
        sync_permissions: :class:`bool`
            Whether to sync the permissions with the category (if given).
        reason: :class:`str`
            The reason for the move.

        Raises
        -------
        ValueError
            An invalid position was given.
        TypeError
            A bad mix of arguments were passed.
        Forbidden
            You do not have permissions to move the channel.
        HTTPException
            Moving the channel failed.
        """

        if not kwargs:
            return

        beginning, end = kwargs.get('beginning'), kwargs.get('end')
        before, after = kwargs.get('before'), kwargs.get('after')
        offset = kwargs.get('offset', 0)
        if sum(bool(a) for a in (beginning, end, before, after)) > 1:
            raise TypeError('Only one of [before, after, end, beginning] can be used.')

        bucket = self._sorting_bucket
        parent_id = kwargs.get('category', MISSING)
        # fmt: off
        channels: List[GuildChannel]
        if parent_id not in (MISSING, None):
            parent_id = parent_id.id
            channels = [
                ch
                for ch in self.guild.channels
                if ch._sorting_bucket == bucket
                and ch.category_id == parent_id
            ]
        else:
            channels = [
                ch
                for ch in self.guild.channels
                if ch._sorting_bucket == bucket
                and ch.category_id == self.category_id
            ]
        # fmt: on

        channels.sort(key=lambda c: (c.position, c.id))

        try:
            # Try to remove ourselves from the channel list
            channels.remove(self)
        except ValueError:
            # If we're not there then it's probably due to not being in the category
            pass

        index = None
        if beginning:
            index = 0
        elif end:
            index = len(channels)
        elif before:
            index = next((i for i, c in enumerate(channels) if c.id == before.id), None)
        elif after:
            index = next((i + 1 for i, c in enumerate(channels) if c.id == after.id), None)

        if index is None:
            raise ValueError('Could not resolve appropriate move position')

        channels.insert(max((index + offset), 0), self)
        payload = []
        lock_permissions = kwargs.get('sync_permissions', False)
        reason = kwargs.get('reason')
        for index, channel in enumerate(channels):
            d = {'id': channel.id, 'position': index}
            if parent_id is not MISSING and channel.id == self.id:
                d.update(parent_id=parent_id, lock_permissions=lock_permissions)
            payload.append(d)

        await self._state.http.bulk_channel_update(self.guild.id, payload, reason=reason)

    async def create_invite(
        self,
        *,
        reason: Optional[str] = None,
        max_age: int = 0,
        max_uses: int = 0,
        temporary: bool = False,
        unique: bool = True,
        target_type: Optional[InviteTarget] = None,
        target_user: Optional[User] = None,
        target_application_id: Optional[int] = None,
    ) -> Invite:
        """|coro|

        Creates an instant invite from a text or voice channel.

        You must have :attr:`~discord.Permissions.create_instant_invite` to do this.

        Parameters
        ------------
        max_age: :class:`int`
            How long the invite should last in seconds. If it's 0 then the invite
            doesn't expire. Defaults to ``0``.
        max_uses: :class:`int`
            How many uses the invite could be used for. If it's 0 then there
            are unlimited uses. Defaults to ``0``.
        temporary: :class:`bool`
            Denotes that the invite grants temporary membership
            (i.e. they get kicked after they disconnect). Defaults to ``False``.
        unique: :class:`bool`
            Indicates if a unique invite URL should be created. Defaults to True.
            If this is set to ``False`` then it will return a previously created
            invite.
        reason: Optional[:class:`str`]
            The reason for creating this invite. Shows up on the audit log.
        target_type: Optional[:class:`.InviteTarget`]
            The type of target for the voice channel invite, if any.

            .. versionadded:: 2.0

        target_user: Optional[:class:`User`]
            The user whose stream to display for this invite, required if ``target_type`` is :attr:`.InviteTarget.stream`. The user must be streaming in the channel.

            .. versionadded:: 2.0

        target_application_id:: Optional[:class:`int`]
            The id of the embedded application for the invite, required if ``target_type`` is :attr:`.InviteTarget.embedded_application`.

            .. versionadded:: 2.0

        Raises
        -------
        ~discord.HTTPException
            Invite creation failed.

        ~discord.NotFound
            The channel that was passed is a category or an invalid channel.

        Returns
        --------
        :class:`~discord.Invite`
            The invite that was created.
        """
        if target_type is InviteTarget.unknown:
            raise ValueError('Cannot create invite with an unknown target type')

        data = await self._state.http.create_invite(
            self.id,
            reason=reason,
            max_age=max_age,
            max_uses=max_uses,
            temporary=temporary,
            unique=unique,
            target_type=target_type.value if target_type else None,
            target_user_id=target_user.id if target_user else None,
            target_application_id=target_application_id,
        )
        return Invite.from_incomplete(data=data, state=self._state)

    async def invites(self) -> List[Invite]:
        """|coro|

        Returns a list of all active instant invites from this channel.

        You must have :attr:`~discord.Permissions.manage_channels` to get this information.

        Raises
        -------
        ~discord.Forbidden
            You do not have proper permissions to get the information.
        ~discord.HTTPException
            An error occurred while fetching the information.

        Returns
        -------
        List[:class:`~discord.Invite`]
            The list of invites that are currently active.
        """

        state = self._state
        data = await state.http.invites_from_channel(self.id)
        guild = self.guild
        return [Invite(state=state, data=invite, channel=self, guild=guild) for invite in data]


class Messageable:
    """An ABC that details the common operations on a model that can send messages.

    The following classes implement this ABC:

    - :class:`~discord.TextChannel`
    - :class:`~discord.VoiceChannel`
    - :class:`~discord.StageChannel`
    - :class:`~discord.DMChannel`
    - :class:`~discord.GroupChannel`
    - :class:`~discord.PartialMessageable`
    - :class:`~discord.User`
    - :class:`~discord.Member`
    - :class:`~discord.ext.commands.Context`
    - :class:`~discord.Thread`
    """

    __slots__ = ()
    _state: ConnectionState

    async def _get_channel(self) -> MessageableChannel:
        raise NotImplementedError

    @overload
    async def send(
        self,
        content: Optional[str] = ...,
        *,
        tts: bool = ...,
        embed: Embed = ...,
        file: File = ...,
        stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
        delete_after: float = ...,
        nonce: Union[str, int] = ...,
        allowed_mentions: AllowedMentions = ...,
        reference: Union[Message, MessageReference, PartialMessage] = ...,
        mention_author: bool = ...,
        view: View = ...,
        suppress_embeds: bool = ...,
        silent: bool = ...,
        poll: Poll = ...,
    ) -> Message:
        ...

    @overload
    async def send(
        self,
        content: Optional[str] = ...,
        *,
        tts: bool = ...,
        embed: Embed = ...,
        files: Sequence[File] = ...,
        stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
        delete_after: float = ...,
        nonce: Union[str, int] = ...,
        allowed_mentions: AllowedMentions = ...,
        reference: Union[Message, MessageReference, PartialMessage] = ...,
        mention_author: bool = ...,
        view: View = ...,
        suppress_embeds: bool = ...,
        silent: bool = ...,
        poll: Poll = ...,
    ) -> Message:
        ...

    @overload
    async def send(
        self,
        content: Optional[str] = ...,
        *,
        tts: bool = ...,
        embeds: Sequence[Embed] = ...,
        file: File = ...,
        stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
        delete_after: float = ...,
        nonce: Union[str, int] = ...,
        allowed_mentions: AllowedMentions = ...,
        reference: Union[Message, MessageReference, PartialMessage] = ...,
        mention_author: bool = ...,
        view: View = ...,
        suppress_embeds: bool = ...,
        silent: bool = ...,
        poll: Poll = ...,
    ) -> Message:
        ...

    @overload
    async def send(
        self,
        content: Optional[str] = ...,
        *,
        tts: bool = ...,
        embeds: Sequence[Embed] = ...,
        files: Sequence[File] = ...,
        stickers: Sequence[Union[GuildSticker, StickerItem]] = ...,
        delete_after: float = ...,
        nonce: Union[str, int] = ...,
        allowed_mentions: AllowedMentions = ...,
        reference: Union[Message, MessageReference, PartialMessage] = ...,
        mention_author: bool = ...,
        view: View = ...,
        suppress_embeds: bool = ...,
        silent: bool = ...,
        poll: Poll = ...,
    ) -> Message:
        ...

    async def send(
        self,
        content: Optional[str] = None,
        *,
        tts: bool = False,
        embed: Optional[Embed] = None,
        embeds: Optional[Sequence[Embed]] = None,
        file: Optional[File] = None,
        files: Optional[Sequence[File]] = None,
        stickers: Optional[Sequence[Union[GuildSticker, StickerItem]]] = None,
        delete_after: Optional[float] = None,
        nonce: Optional[Union[str, int]] = None,
        allowed_mentions: Optional[AllowedMentions] = None,
        reference: Optional[Union[Message, MessageReference, PartialMessage]] = None,
        mention_author: Optional[bool] = None,
        view: Optional[View] = None,
        suppress_embeds: bool = False,
        silent: bool = False,
        poll: Optional[Poll] = None,
    ) -> Message:
        """|coro|

        Sends a message to the destination with the content given.

        The content must be a type that can convert to a string through ``str(content)``.
        If the content is set to ``None`` (the default), then the ``embed`` parameter must
        be provided.

        To upload a single file, the ``file`` parameter should be used with a
        single :class:`~discord.File` object. To upload multiple files, the ``files``
        parameter should be used with a :class:`list` of :class:`~discord.File` objects.
        **Specifying both parameters will lead to an exception**.

        To upload a single embed, the ``embed`` parameter should be used with a
        single :class:`~discord.Embed` object. To upload multiple embeds, the ``embeds``
        parameter should be used with a :class:`list` of :class:`~discord.Embed` objects.
        **Specifying both parameters will lead to an exception**.

        .. versionchanged:: 2.0
            This function will now raise :exc:`TypeError` or
            :exc:`ValueError` instead of ``InvalidArgument``.

        Parameters
        ------------
        content: Optional[:class:`str`]
            The content of the message to send.
        tts: :class:`bool`
            Indicates if the message should be sent using text-to-speech.
        embed: :class:`~discord.Embed`
            The rich embed for the content.
        embeds: List[:class:`~discord.Embed`]
            A list of embeds to upload. Must be a maximum of 10.

            .. versionadded:: 2.0
        file: :class:`~discord.File`
            The file to upload.
        files: List[:class:`~discord.File`]
            A list of files to upload. Must be a maximum of 10.
        nonce: :class:`int`
            The nonce to use for sending this message. If the message was successfully sent,
            then the message will have a nonce with this value.
        delete_after: :class:`float`
            If provided, the number of seconds to wait in the background
            before deleting the message we just sent. If the deletion fails,
            then it is silently ignored.
        allowed_mentions: :class:`~discord.AllowedMentions`
            Controls the mentions being processed in this message. If this is
            passed, then the object is merged with :attr:`~discord.Client.allowed_mentions`.
            The merging behaviour only overrides attributes that have been explicitly passed
            to the object, otherwise it uses the attributes set in :attr:`~discord.Client.allowed_mentions`.
            If no object is passed at all then the defaults given by :attr:`~discord.Client.allowed_mentions`
            are used instead.

            .. versionadded:: 1.4

        reference: Union[:class:`~discord.Message`, :class:`~discord.MessageReference`, :class:`~discord.PartialMessage`]
            A reference to the :class:`~discord.Message` to which you are replying, this can be created using
            :meth:`~discord.Message.to_reference` or passed directly as a :class:`~discord.Message`. You can control
            whether this mentions the author of the referenced message using the :attr:`~discord.AllowedMentions.replied_user`
            attribute of ``allowed_mentions`` or by setting ``mention_author``.

            .. versionadded:: 1.6

        mention_author: Optional[:class:`bool`]
            If set, overrides the :attr:`~discord.AllowedMentions.replied_user` attribute of ``allowed_mentions``.

            .. versionadded:: 1.6
        view: :class:`discord.ui.View`
            A Discord UI View to add to the message.

            .. versionadded:: 2.0
        stickers: Sequence[Union[:class:`~discord.GuildSticker`, :class:`~discord.StickerItem`]]
            A list of stickers to upload. Must be a maximum of 3.

            .. versionadded:: 2.0
        suppress_embeds: :class:`bool`
            Whether to suppress embeds for the message. This sends the message without any embeds if set to ``True``.

            .. versionadded:: 2.0
        silent: :class:`bool`
            Whether to suppress push and desktop notifications for the message. This will increment the mention counter
            in the UI, but will not actually send a notification.

            .. versionadded:: 2.2
        poll: :class:`~discord.Poll`
            The poll to send with this message.

            .. versionadded:: 2.4

        Raises
        --------
        ~discord.HTTPException
            Sending the message failed.
        ~discord.Forbidden
            You do not have the proper permissions to send the message.
        ValueError
            The ``files`` or ``embeds`` list is not of the appropriate size.
        TypeError
            You specified both ``file`` and ``files``,
            or you specified both ``embed`` and ``embeds``,
            or the ``reference`` object is not a :class:`~discord.Message`,
            :class:`~discord.MessageReference` or :class:`~discord.PartialMessage`.

        Returns
        ---------
        :class:`~discord.Message`
            The message that was sent.
        """

        channel = await self._get_channel()
        state = self._state
        content = str(content) if content is not None else None
        previous_allowed_mention = state.allowed_mentions

        if stickers is not None:
            sticker_ids: SnowflakeList = [sticker.id for sticker in stickers]
        else:
            sticker_ids = MISSING

        if reference is not None:
            try:
                reference_dict = reference.to_message_reference_dict()
            except AttributeError:
                raise TypeError('reference parameter must be Message, MessageReference, or PartialMessage') from None
        else:
            reference_dict = MISSING

        if view and not hasattr(view, '__discord_ui_view__'):
            raise TypeError(f'view parameter must be View not {view.__class__.__name__}')

        if suppress_embeds or silent:
            from .message import MessageFlags  # circular import

            flags = MessageFlags._from_value(0)
            flags.suppress_embeds = suppress_embeds
            flags.suppress_notifications = silent
        else:
            flags = MISSING

        with handle_message_parameters(
            content=content,
            tts=tts,
            file=file if file is not None else MISSING,
            files=files if files is not None else MISSING,
            embed=embed if embed is not None else MISSING,
            embeds=embeds if embeds is not None else MISSING,
            nonce=nonce,
            allowed_mentions=allowed_mentions,
            message_reference=reference_dict,
            previous_allowed_mentions=previous_allowed_mention,
            mention_author=mention_author,
            stickers=sticker_ids,
            view=view,
            flags=flags,
            poll=poll,
        ) as params:
            data = await state.http.send_message(channel.id, params=params)

        ret = state.create_message(channel=channel, data=data)
        if view and not view.is_finished():
            state.store_view(view, ret.id)

        if poll:
            poll._update(ret)

        if delete_after is not None:
            await ret.delete(delay=delete_after)
        return ret

    def typing(self) -> Typing:
        """Returns an asynchronous context manager that allows you to send a typing indicator to
        the destination for an indefinite period of time, or 10 seconds if the context manager
        is called using ``await``.

        Example Usage: ::

            async with channel.typing():
                # simulate something heavy
                await asyncio.sleep(20)

            await channel.send('Done!')

        Example Usage: ::

            await channel.typing()
            # Do some computational magic for about 10 seconds
            await channel.send('Done!')

        .. versionchanged:: 2.0
            This no longer works with the ``with`` syntax, ``async with`` must be used instead.

        .. versionchanged:: 2.0
            Added functionality to ``await`` the context manager to send a typing indicator for 10 seconds.
        """
        return Typing(self)

    async def fetch_message(self, id: int, /) -> Message:
        """|coro|

        Retrieves a single :class:`~discord.Message` from the destination.

        Parameters
        ------------
        id: :class:`int`
            The message ID to look for.

        Raises
        --------
        ~discord.NotFound
            The specified message was not found.
        ~discord.Forbidden
            You do not have the permissions required to get a message.
        ~discord.HTTPException
            Retrieving the message failed.

        Returns
        --------
        :class:`~discord.Message`
            The message asked for.
        """

        channel = await self._get_channel()
        data = await self._state.http.get_message(channel.id, id)
        return self._state.create_message(channel=channel, data=data)

    async def pins(self) -> List[Message]:
        """|coro|

        Retrieves all messages that are currently pinned in the channel.

        .. note::

            Due to a limitation with the Discord API, the :class:`.Message`
            objects returned by this method do not contain complete
            :attr:`.Message.reactions` data.

        Raises
        -------
        ~discord.Forbidden
            You do not have the permission to retrieve pinned messages.
        ~discord.HTTPException
            Retrieving the pinned messages failed.

        Returns
        --------
        List[:class:`~discord.Message`]
            The messages that are currently pinned.
        """

        channel = await self._get_channel()
        state = self._state
        data = await state.http.pins_from(channel.id)
        return [state.create_message(channel=channel, data=m) for m in data]

    async def history(
        self,
        *,
        limit: Optional[int] = 100,
        before: Optional[SnowflakeTime] = None,
        after: Optional[SnowflakeTime] = None,
        around: Optional[SnowflakeTime] = None,
        oldest_first: Optional[bool] = None,
    ) -> AsyncIterator[Message]:
        """Returns an :term:`asynchronous iterator` that enables receiving the destination's message history.

        You must have :attr:`~discord.Permissions.read_message_history` to do this.

        Examples
        ---------

        Usage ::

            counter = 0
            async for message in channel.history(limit=200):
                if message.author == client.user:
                    counter += 1

        Flattening into a list: ::

            messages = [message async for message in channel.history(limit=123)]
            # messages is now a list of Message...

        All parameters are optional.

        Parameters
        -----------
        limit: Optional[:class:`int`]
            The number of messages to retrieve.
            If ``None``, retrieves every message in the channel. Note, however,
            that this would make it a slow operation.
        before: Optional[Union[:class:`~discord.abc.Snowflake`, :class:`datetime.datetime`]]
            Retrieve messages before this date or message.
            If a datetime is provided, it is recommended to use a UTC aware datetime.
            If the datetime is naive, it is assumed to be local time.
        after: Optional[Union[:class:`~discord.abc.Snowflake`, :class:`datetime.datetime`]]
            Retrieve messages after this date or message.
            If a datetime is provided, it is recommended to use a UTC aware datetime.
            If the datetime is naive, it is assumed to be local time.
        around: Optional[Union[:class:`~discord.abc.Snowflake`, :class:`datetime.datetime`]]
            Retrieve messages around this date or message.
            If a datetime is provided, it is recommended to use a UTC aware datetime.
            If the datetime is naive, it is assumed to be local time.
            When using this argument, the maximum limit is 101. Note that if the limit is an
            even number then this will return at most limit + 1 messages.
        oldest_first: Optional[:class:`bool`]
            If set to ``True``, return messages in oldest->newest order. Defaults to ``True`` if
            ``after`` is specified, otherwise ``False``.

        Raises
        ------
        ~discord.Forbidden
            You do not have permissions to get channel message history.
        ~discord.HTTPException
            The request to get message history failed.

        Yields
        -------
        :class:`~discord.Message`
            The message with the message data parsed.
        """

        async def _around_strategy(retrieve: int, around: Optional[Snowflake], limit: Optional[int]):
            if not around:
                return [], None, 0

            around_id = around.id if around else None
            data = await self._state.http.logs_from(channel.id, retrieve, around=around_id)

            return data, None, 0

        async def _after_strategy(retrieve: int, after: Optional[Snowflake], limit: Optional[int]):
            after_id = after.id if after else None
            data = await self._state.http.logs_from(channel.id, retrieve, after=after_id)

            if data:
                if limit is not None:
                    limit -= len(data)

                after = Object(id=int(data[0]['id']))

            return data, after, limit

        async def _before_strategy(retrieve: int, before: Optional[Snowflake], limit: Optional[int]):
            before_id = before.id if before else None
            data = await self._state.http.logs_from(channel.id, retrieve, before=before_id)

            if data:
                if limit is not None:
                    limit -= len(data)

                before = Object(id=int(data[-1]['id']))

            return data, before, limit

        if isinstance(before, datetime):
            before = Object(id=utils.time_snowflake(before, high=False))
        if isinstance(after, datetime):
            after = Object(id=utils.time_snowflake(after, high=True))
        if isinstance(around, datetime):
            around = Object(id=utils.time_snowflake(around))

        if oldest_first is None:
            reverse = after is not None
        else:
            reverse = oldest_first

        after = after or OLDEST_OBJECT
        predicate = None

        if around:
            if limit is None:
                raise ValueError('history does not support around with limit=None')
            if limit > 101:
                raise ValueError("history max limit 101 when specifying around parameter")

            # Strange Discord quirk
            limit = 100 if limit == 101 else limit

            strategy, state = _around_strategy, around

            if before and after:
                predicate = lambda m: after.id < int(m['id']) < before.id
            elif before:
                predicate = lambda m: int(m['id']) < before.id
            elif after:
                predicate = lambda m: after.id < int(m['id'])
        elif reverse:
            strategy, state = _after_strategy, after
            if before:
                predicate = lambda m: int(m['id']) < before.id
        else:
            strategy, state = _before_strategy, before
            if after and after != OLDEST_OBJECT:
                predicate = lambda m: int(m['id']) > after.id

        channel = await self._get_channel()

        while True:
            retrieve = 100 if limit is None else min(limit, 100)
            if retrieve < 1:
                return

            data, state, limit = await strategy(retrieve, state, limit)

            if reverse:
                data = reversed(data)
            if predicate:
                data = filter(predicate, data)

            count = 0

            for count, raw_message in enumerate(data, 1):
                yield self._state.create_message(channel=channel, data=raw_message)

            if count < 100:
                # There's no data left after this
                break


class Connectable(Protocol):
    """An ABC that details the common operations on a channel that can
    connect to a voice server.

    The following implement this ABC:

    - :class:`~discord.VoiceChannel`
    - :class:`~discord.StageChannel`
    """

    __slots__ = ()
    _state: ConnectionState

    def _get_voice_client_key(self) -> Tuple[int, str]:
        raise NotImplementedError

    def _get_voice_state_pair(self) -> Tuple[int, int]:
        raise NotImplementedError

    async def connect(
        self,
        *,
        timeout: float = 30.0,
        reconnect: bool = True,
        cls: Callable[[Client, Connectable], T] = VoiceClient,
        self_deaf: bool = False,
        self_mute: bool = False,
    ) -> T:
        """|coro|

        Connects to voice and creates a :class:`~discord.VoiceClient` to establish
        your connection to the voice server.

        This requires :attr:`~discord.Intents.voice_states`.

        Parameters
        -----------
        timeout: :class:`float`
            The timeout in seconds to wait the connection to complete.
        reconnect: :class:`bool`
            Whether the bot should automatically attempt
            a reconnect if a part of the handshake fails
            or the gateway goes down.
        cls: Type[:class:`~discord.VoiceProtocol`]
            A type that subclasses :class:`~discord.VoiceProtocol` to connect with.
            Defaults to :class:`~discord.VoiceClient`.
        self_mute: :class:`bool`
            Indicates if the client should be self-muted.

            .. versionadded:: 2.0
        self_deaf: :class:`bool`
            Indicates if the client should be self-deafened.

            .. versionadded:: 2.0

        Raises
        -------
        asyncio.TimeoutError
            Could not connect to the voice channel in time.
        ~discord.ClientException
            You are already connected to a voice channel.
        ~discord.opus.OpusNotLoaded
            The opus library has not been loaded.

        Returns
        --------
        :class:`~discord.VoiceProtocol`
            A voice client that is fully connected to the voice server.
        """

        key_id, _ = self._get_voice_client_key()
        state = self._state

        if state._get_voice_client(key_id):
            raise ClientException('Already connected to a voice channel.')

        client = state._get_client()
        voice: T = cls(client, self)

        if not isinstance(voice, VoiceProtocol):
            raise TypeError('Type must meet VoiceProtocol abstract base class.')

        state._add_voice_client(key_id, voice)

        try:
            await voice.connect(timeout=timeout, reconnect=reconnect, self_deaf=self_deaf, self_mute=self_mute)
        except asyncio.TimeoutError:
            try:
                await voice.disconnect(force=True)
            except Exception:
                # we don't care if disconnect failed because connection failed
                pass
            raise  # re-raise

        return voice


================================================
FILE: discord/activity.py
================================================
"""
The MIT License (MIT)

Copyright (c) 2015-present Rapptz

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

from __future__ import annotations

import datetime
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union, overload

from .asset import Asset
from .enums import ActivityType, try_enum
from .colour import Colour
from .partial_emoji import PartialEmoji
from .utils import _get_as_snowflake

__all__ = (
    'BaseActivity',
    'Activity',
    'Streaming',
    'Game',
    'Spotify',
    'CustomActivity',
)

"""If curious, this is the current schema for an activity.

It's fairly long so I will document it here:

All keys are optional.

state: str (max: 128),
details: str (max: 128)
timestamps: dict
    start: int (min: 1)
    end: int (min: 1)
assets: dict
    large_image: str (max: 32)
    large_text: str (max: 128)
    small_image: str (max: 32)
    small_text: str (max: 128)
party: dict
    id: str (max: 128),
    size: List[int] (max-length: 2)
        elem: int (min: 1)
secrets: dict
    match: str (max: 128)
    join: str (max: 128)
    spectate: str (max: 128)
instance: bool
application_id: str
name: str (max: 128)
url: str
type: int
sync_id: str
session_id: str
flags: int
buttons: list[str (max: 32)]

There are also activity flags which are mostly uninteresting for the library atm.

t.ActivityFlags = {
    INSTANCE: 1,
    JOIN: 2,
    SPECTATE: 4,
    JOIN_REQUEST: 8,
    SYNC: 16,
    PLAY: 32
}
"""

if TYPE_CHECKING:
    from .types.activity import (
        Activity as ActivityPayload,
        ActivityTimestamps,
        ActivityParty,
        ActivityAssets,
    )

    from .state import ConnectionState


class BaseActivity:
    """The base activity that all user-settable activities inherit from.
    A user-settable activity is one that can be used in :meth:`Client.change_presence`.

    The following types currently count as user-settable:

    - :class:`Activity`
    - :class:`Game`
    - :class:`Streaming`
    - :class:`CustomActivity`

    Note that although these types are considered user-settable by the library,
    Discord typically ignores certain combinations of activity depending on
    what is currently set. This behaviour may change in the future so there are
    no guarantees on whether Discord will actually let you set these types.

    .. versionadded:: 1.3
    """

    __slots__ = ('_created_at',)

    def __init__(self, **kwargs: Any) -> None:
        self._created_at: Optional[float] = kwargs.pop('created_at', None)

    @property
    def created_at(self) -> Optional[datetime.datetime]:
        """Optional[:class:`datetime.datetime`]: When the user started doing this activity in UTC.

        .. versionadded:: 1.3
        """
        if self._created_at is not None:
            return datetime.datetime.fromtimestamp(self._created_at / 1000, tz=datetime.timezone.utc)

    def to_dict(self) -> ActivityPayload:
        raise NotImplementedError


class Activity(BaseActivity):
    """Represents an activity in Discord.

    This could be an activity such as streaming, playing, listening
    or watching.

    For memory optimisation purposes, some activities are offered in slimmed
    down versions:

    - :class:`Game`
    - :class:`Streaming`

    Attributes
    ------------
    application_id: Optional[:class:`int`]
        The application ID of the game.
    name: Optional[:class:`str`]
        The name of the activity.
    url: Optional[:class:`str`]
        A stream URL that the activity could be doing.
    type: :class:`ActivityType`
        The type of activity currently being done.
    state: Optional[:class:`str`]
        The user's current state. For example, "In Game".
    details: Optional[:class:`str`]
        The detail of the user's current activity.
    platform: Optional[:class:`str`]
        The user's current platform.

        .. versionadded:: 2.4
    timestamps: :class:`dict`
        A dictionary of timestamps. It contains the following optional keys:

        - ``start``: Corresponds to when the user started doing the
          activity in milliseconds since Unix epoch.
        - ``end``: Corresponds to when the user will finish doing the
          activity in milliseconds since Unix epoch.

    assets: :class:`dict`
        A dictionary representing the images and their hover text of an activity.
        It contains the following optional keys:

        - ``large_image``: A string representing the ID for the large image asset.
        - ``large_text``: A string representing the text when hovering over the large image asset.
        - ``small_image``: A string representing the ID for the small image asset.
        - ``small_text``: A string representing the text when hovering over the small image asset.

    party: :class:`dict`
        A dictionary representing the activity party. It contains the following optional keys:

        - ``id``: A string representing the party ID.
        - ``size``: A list of up to two integer elements denoting (current_size, maximum_size).
    buttons: List[:class:`str`]
        A list of strings representing the labels of custom buttons shown in a rich presence.

        .. versionadded:: 2.0

    emoji: Optional[:class:`PartialEmoji`]
        The emoji that belongs to this activity.
    """

    __slots__ = (
        'state',
        'details',
        'timestamps',
        'platform',
        'assets',
        'party',
        'flags',
        'sync_id',
        'session_id',
        'type',
        'name',
        'url',
        'application_id',
        'emoji',
        'buttons',
    )

    def __init__(self, **kwargs: Any) -> None:
        super().__init__(**kwargs)
        self.state: Optional[str] = kwargs.pop('state', None)
        self.details: Optional[str] = kwargs.pop('details', None)
        self.timestamps: ActivityTimestamps = kwargs.pop('timestamps', {})
        self.platform: Optional[str] = kwargs.pop('platform', None)
        self.assets: ActivityAssets = kwargs.pop('assets', {})
        self.party: ActivityParty = kwargs.pop('party', {})
        self.application_id: Optional[int] = _get_as_snowflake(kwargs, 'application_id')
        self.name: Optional[str] = kwargs.pop('name', None)
        self.url: Optional[str] = kwargs.pop('url', None)
        self.flags: int = kwargs.pop('flags', 0)
        self.sync_id: Optional[str] = kwargs.pop('sync_id', None)
        self.session_id: Optional[str] = kwargs.pop('session_id', None)
        self.buttons: List[str] = kwargs.pop('buttons', [])

        activity_type = kwargs.pop('type', -1)
        self.type: ActivityType = (
            activity_type if isinstance(activity_type, ActivityType) else try_enum(ActivityType, activity_type)
        )

        emoji = kwargs.pop('emoji', None)
        self.emoji: Optional[PartialEmoji] = PartialEmoji.from_dict(emoji) if emoji is not None else None

    def __repr__(self) -> str:
        attrs = (
            ('type', self.type),
            ('name', self.name),
            ('url', self.url),
            ('platform', self.platform),
            ('details', self.details),
            ('application_id', self.application_id),
            ('session_id', self.session_id),
            ('emoji', self.emoji),
        )
        inner = ' '.join('%s=%r' % t for t in attrs)
        return f'<Activity {inner}>'

    def to_dict(self) -> Dict[str, Any]:
        ret: Dict[str, Any] = {}
        for attr in self.__slots__:
            value = getattr(self, attr, None)
            if value is None:
                continue

            if isinstance(value, dict) and len(value) == 0:
                continue

            ret[attr] = value
        ret['type'] = int(self.type)
        if self.emoji:
            ret['emoji'] = self.emoji.to_dict()
        return ret

    @property
    def start(self) -> Optional[datetime.datetime]:
        """Optional[:class:`datetime.datetime`]: When the user started doing this activity in UTC, if applicable."""
        try:
            timestamp = self.timestamps['start'] / 1000
        except KeyError:
            return None
        else:
            return datetime.datetime.fromtimestamp(timestamp, tz=datetime.timezone.utc)

    @property
    def end(self) -> Optional[datetime.datetime]:
        """Optional[:class:`datetime.datetime`]: When the user will stop doing this activity in UTC, if applicable."""
        try:
            timestamp = self.timestamps['end'] / 1000
        except KeyError:
            return None
        else:
            return datetime.datetime.fromtimestamp(timestamp, tz=datetime.timezone.utc)

    @property
    def large_image_url(self) -> Optional[str]:
        """Optional[:class:`str`]: Returns a URL pointing to the large image asset of this activity, if applicable."""
        try:
            large_image = self.assets['large_image']
        except KeyError:
            return None
        else:
            return self._image_url(large_image)

    @property
    def small_image_url(self) -> Optional[str]:
        """Optional[:class:`str`]: Returns a URL pointing to the small image asset of this activity, if applicable."""
        try:
            small_image = self.assets['small_image']
        except KeyError:
            return None
        else:
            return self._image_url(small_image)

    def _image_url(self, image: str) -> Optional[str]:
        if image.startswith('mp:'):
            return f'https://media.discordapp.net/{image[3:]}'
        elif self.application_id is not None:
            return Asset.BASE + f'/app-assets/{self.application_id}/{image}.png'

    @property
    def large_image_text(self) -> Optional[str]:
        """Optional[:class:`str`]: Returns the large image asset hover text of this activity, if applicable."""
        return self.assets.get('large_text', None)

    @property
    def small_image_text(self) -> Optional[str]:
        """Optional[:class:`str`]: Returns the small image asset hover text of this activity, if applicable."""
        return self.assets.get('small_text', None)


class Game(BaseActivity):
    """A slimmed down version of :class:`Activity` that represents a Discord game.

    This is typically displayed via **Playing** on the official Discord client.

    .. container:: operations

        .. describe:: x == y

            Checks if two games are equal.

        .. describe:: x != y

            Checks if two games are not equal.

        .. describe:: hash(x)

            Returns the game's hash.

        .. describe:: str(x)

            Returns the game's name.

    Parameters
    -----------
    name: :class:`str`
        The game's name.

    Attributes
    -----------
    name: :class:`str`
        The game's name.
    platform: Optional[:class:`str`]
        Where the user is playing from (ie. PS5, Xbox).

        .. versionadded:: 2.4

    assets: :class:`dict`
        A dictionary representing the images and their hover text of a game.
        It contains the following optional keys:

        - ``large_image``: A string representing the ID for the large image asset.
        - ``large_text``: A string representing the text when hovering over the large image asset.
        - ``small_image``: A string representing the ID for the small image asset.
        - ``small_text``: A string representing the text when hovering over the small image asset.

        .. versionadded:: 2.4
    """

    __slots__ = ('name', '_end', '_start', 'platform', 'assets')

    def __init__(self, name: str, **extra: Any) -> None:
        super().__init__(**extra)
        self.name: str = name
        self.platform: Optional[str] = extra.get('platform')
        self.assets: ActivityAssets = extra.get('assets', {}) or {}

        try:
            timestamps: ActivityTimestamps = extra['timestamps']
        except KeyError:
            self._start = 0
            self._end = 0
        else:
            self._start = timestamps.get('start', 0)
            self._end = timestamps.get('end', 0)

    @property
    def type(self) -> ActivityType:
        """:class:`ActivityType`: Returns the game's type. This is for compatibility with :class:`Activity`.

        It always returns :attr:`ActivityType.playing`.
        """
        return ActivityType.playing

    @property
    def start(self) -> Optional[datetime.datetime]:
        """Optional[:class:`datetime.datetime`]: When the user started playing this game in UTC, if applicable."""
        if self._start:
            return datetime.datetime.fromtimestamp(self._start / 1000, tz=datetime.timezone.utc)
        return None

    @property
    def end(self) -> Optional[datetime.datetime]:
        """Optional[:class:`datetime.datetime`]: When the user will stop playing this game in UTC, if applicable."""
        if self._end:
            return datetime.datetime.fromtimestamp(self._end / 1000, tz=datetime.timezone.utc)
        return None

    def __str__(self) -> str:
        return str(self.name)

    def __repr__(self) -> str:
        return f'<Game name={self.name!r}>'

    def to_dict(self) -> Dict[str, Any]:
        timestamps: Dict[str, Any] = {}
        if self._start:
            timestamps['start'] = self._start

        if self._end:
            timestamps['end'] = self._end

        return {
            'type': ActivityType.playing.value,
            'name': str(self.name),
            'timestamps': timestamps,
            'platform': str(self.platform) if self.platform else None,
            'assets': self.assets,
        }

    def __eq__(self, other: object) -> bool:
        return isinstance(other, Game) and other.name == self.name

    def __ne__(self, other: object) -> bool:
        return not self.__eq__(other)

    def __hash__(self) -> int:
        return hash(self.name)


class Streaming(BaseActivity):
    """A slimmed down version of :class:`Activity` that represents a Discord streaming status.

    This is typically displayed via **Streaming** on the official Discord client.

    .. container:: operations

        .. describe:: x == y

            Checks if two streams are equal.

        .. describe:: x != y

            Checks if two streams are not equal.

        .. describe:: hash(x)

            Returns the stream's hash.

        .. describe:: str(x)

            Returns the stream's name.

    Attributes
    -----------
    platform: Optional[:class:`str`]
        Where the user is streaming from (ie. YouTube, Twitch).

        .. versionadded:: 1.3

    name: Optional[:class:`str`]
        The stream's name.
    details: Optional[:class:`str`]
        An alias for :attr:`name`
    game: Optional[:class:`str`]
        The game being streamed.

        .. versionadded:: 1.3

    url: :class:`str`
        The stream's URL.
    assets: :class:`dict`
        A dictionary comprising of similar keys than those in :attr:`Activity.assets`.
    """

    __slots__ = ('platform', 'name', 'game', 'url', 'details', 'assets')

    def __init__(self, *, name: Optional[str], url: str, **extra: Any) -> None:
        super().__init__(**extra)
        self.platform: Optional[str] = name
        self.name: Optional[str] = extra.pop('details', name)
        self.game: Optional[str] = extra.pop('state', None)
        self.url: str = url
        self.details: Optional[str] = extra.pop('details', self.name)  # compatibility
        self.assets: ActivityAssets = extra.pop('assets', {})

    @property
    def type(self) -> ActivityType:
        """:class:`ActivityType`: Returns the game's type. This is for compatibility with :class:`Activity`.

        It always returns :attr:`ActivityType.streaming`.
        """
        return ActivityType.streaming

    def __str__(self) -> str:
        return str(self.name)

    def __repr__(self) -> str:
        return f'<Streaming name={self.name!r}>'

    @property
    def twitch_name(self) -> Optional[str]:
        """Optional[:class:`str`]: If provided, the twitch name of the user streaming.

        This corresponds to the ``large_image`` key of the :attr:`Streaming.assets`
        dictionary if it starts with ``twitch:``. Typically set by the Discord client.
        """

        try:
            name = self.assets['large_image']
        except KeyError:
            return None
        else:
            return name[7:] if name[:7] == 'twitch:' else None

    def to_dict(self) -> Dict[str, Any]:
        ret: Dict[str, Any] = {
            'type': ActivityType.streaming.value,
            'name': str(self.name),
            'url': str(self.url),
            'assets': self.assets,
        }
        if self.details:
            ret['details'] = self.details
        return ret

    def __eq__(self, other: object) -> bool:
        return isinstance(other, Streaming) and other.name == self.name and other.url == self.url

    def __ne__(self, other: object) -> bool:
        return not self.__eq__(other)

    def __hash__(self) -> int:
        return hash(self.name)


class Spotify:
    """Represents a Spotify listening activity from Discord. This is a special case of
    :class:`Activity` that makes it easier to work with the Spotify integration.

    .. container:: operations

        .. describe:: x == y

            Checks if two activities are equal.

        .. describe:: x != y

            Checks if two activities are not equal.

        .. describe:: hash(x)

            Returns the activity's hash.

        .. describe:: str(x)

            Returns the string 'Spotify'.
    """

    __slots__ = ('_state', '_details', '_timestamps', '_assets', '_party', '_sync_id', '_session_id', '_created_at')

    def __init__(self, **data: Any) -> None:
        self._state: str = data.pop('state', '')
        self._details: str = data.pop('details', '')
        self._timestamps: ActivityTimestamps = data.pop('timestamps', {})
        self._assets: ActivityAssets = data.pop('assets', {})
        self._party: ActivityParty = data.pop('party', {})
        self._sync_id: str = data.pop('sync_id', '')
        self._session_id: Optional[str] = data.pop('session_id')
        self._created_at: Optional[float] = data.pop('created_at', None)

    @property
    def type(self) -> ActivityType:
        """:class:`ActivityType`: Returns the activity's type. This is for compatibility with :class:`Activity`.

        It always returns :attr:`ActivityType.listening`.
        """
        return ActivityType.listening

    @property
    def created_at(self) -> Optional[datetime.datetime]:
        """Optional[:class:`datetime.datetime`]: When the user started listening in UTC.

        .. versionadded:: 1.3
        """
        if self._created_at is not None:
            return datetime.datetime.fromtimestamp(self._created_at / 1000, tz=datetime.timezone.utc)

    @property
    def colour(self) -> Colour:
        """:class:`Colour`: Returns the Spotify integration colour, as a :class:`Colour`.

        There is an alias for this named :attr:`color`"""
        return Colour(0x1DB954)

    @property
    def color(self) -> Colour:
        """:class:`Colour`: Returns the Spotify integration colour, as a :class:`Colour`.

        There is an alias for this named :attr:`colour`"""
        return self.colour

    def to_dict(self) -> Dict[str, Any]:
        return {
            'flags': 48,  # SYNC | PLAY
            'name': 'Spotify',
            'assets': self._assets,
            'party': self._party,
            'sync_id': self._sync_id,
            'session_id': self._session_id,
            'timestamps': self._timestamps,
            'details': self._details,
            'state': self._state,
        }

    @property
    def name(self) -> str:
        """:class:`str`: The activity's name. This will always return "Spotify"."""
        return 'Spotify'

    def __eq__(self, other: object) -> bool:
        return (
            isinstance(other, Spotify)
            and other._session_id == self._session_id
            and other._sync_id == self._sync_id
            and other.start == self.start
        )

    def __ne__(self, other: object) -> bool:
        return not self.__eq__(other)

    def __hash__(self) -> int:
        return hash(self._session_id)

    def __str__(self) -> str:
        return 'Spotify'

    def __repr__(self) -> str:
        return f'<Spotify title={self.title!r} artist={self.artist!r} track_id={self.track_id!r}>'

    @property
    def title(self) -> str:
        """:class:`str`: The title of the song being played."""
        return self._details

    @property
    def artists(self) -> List[str]:
        """List[:class:`str`]: The artists of the song being played."""
        return self._state.split('; ')

    @property
    def artist(self) -> str:
        """:class:`str`: The artist of the song being played.

        This does not attempt to split the artist information into
        multiple artists. Useful if there's only a single artist.
        """
        return self._state

    @property
    def album(self) -> str:
        """:class:`str`: The album that the song being played belongs to."""
        return self._assets.get('large_text', '')

    @property
    def album_cover_url(self) -> str:
        """:class:`str`: The album cover image URL from Spotify's CDN."""
        large_image = self._assets.get('large_image', '')
        if large_image[:8] != 'spotify:':
            return ''
        album_image_id = large_image[8:]
        return 'https://i.scdn.co/image/' + album_image_id

    @property
    def track_id(self) -> str:
        """:class:`str`: The track ID used by Spotify to identify this song."""
        return self._sync_id

    @property
    def track_url(self) -> str:
        """:class:`str`: The track URL to listen on Spotify.

        .. versionadded:: 2.0
        """
        return f'https://open.spotify.com/track/{self.track_id}'

    @property
    def start(self) -> datetime.datetime:
        """:class:`datetime.datetime`: When the user started playing this song in UTC."""
        # the start key will be present here
        return datetime.datetime.fromtimestamp(self._timestamps['start'] / 1000, tz=datetime.timezone.utc)  # type: ignore

    @property
    def end(self) -> datetime.datetime:
        """:class:`datetime.datetime`: When the user will stop playing this song in UTC."""
        # the end key will be present here
        return datetime.datetime.fromtimestamp(self._timestamps['end'] / 1000, tz=datetime.timezone.utc)  # type: ignore

    @property
    def duration(self) -> datetime.timedelta:
        """:class:`datetime.timedelta`: The duration of the song being played."""
        return self.end - self.start

    @property
    def party_id(self) -> str:
        """:class:`str`: The party ID of the listening party."""
        return self._party.get('id', '')


class CustomActivity(BaseActivity):
    """Represents a custom activity from Discord.

    .. container:: operations

        .. describe:: x == y

            Checks if two activities are equal.

        .. describe:: x != y

            Checks if two activities are not equal.

        .. describe:: hash(x)

            Returns the activity's hash.

        .. describe:: str(x)

            Returns the custom status text.

    .. versionadded:: 1.3

    Attributes
    -----------
    name: Optional[:class:`str`]
        The custom activity's name.
    emoji: Optional[:class:`PartialEmoji`]
        The emoji to pass to the activity, if any.
    """

    __slots__ = ('name', 'emoji', 'state')

    def __init__(
        self, name: Optional[str], *, emoji: Optional[Union[PartialEmoji, Dict[str, Any], str]] = None, **extra: Any
    ) -> None:
        super().__init__(**extra)
        self.name: Optional[str] = name
        self.state: Optional[str] = extra.pop('state', name)
        if self.name == 'Custom Status':
            self.name = self.state

        self.emoji: Optional[PartialEmoji]
        if emoji is None:
            self.emoji = emoji
        elif isinstance(emoji, dict):
            self.emoji = PartialEmoji.from_dict(emoji)
        elif isinstance(emoji, str):
            self.emoji = PartialEmoji(name=emoji)
        elif isinstance(emoji, PartialEmoji):
            self.emoji = emoji
        else:
            raise TypeError(f'Expected str, PartialEmoji, or None, received {type(emoji)!r} instead.')

    @property
    def type(self) -> ActivityType:
        """:class:`ActivityType`: Returns the activity's type. This is for compatibility with :class:`Activity`.

        It always returns :attr:`ActivityType.custom`.
        """
        return ActivityType.custom

    def to_dict(self) -> Dict[str, Any]:
        if self.name == self.state:
            o = {
                'type': ActivityType.custom.value,
                'state': self.name,
                'name': 'Custom Status',
            }
        else:
            o = {
                'type': ActivityType.custom.value,
                'name': self.name,
            }

        if self.emoji:
            o['emoji'] = self.emoji.to_dict()
        return o

    def __eq__(self, other: object) -> bool:
        return isinstance(other, CustomActivity) and other.name == self.name and other.emoji == self.emoji

    def __ne__(self, other: object) -> bool:
        return not self.__eq__(other)

    def __hash__(self) -> int:
        return hash((self.name, str(self.emoji)))

    def __str__(self) -> str:
        if self.emoji:
            if self.name:
                return f'{self.emoji} {self.name}'
            return str(self.emoji)
        else:
            return str(self.name)

    def __repr__(self) -> str:
        return f'<CustomActivity name={self.name!r} emoji={self.emoji!r}>'


ActivityTypes = Union[Activity, Game, CustomActivity, Streaming, Spotify]


@overload
def create_activity(data: ActivityPayload, state: ConnectionState) -> ActivityTypes:
    ...


@overload
def create_activity(data: None, state: ConnectionState) -> None:
    ...


def create_activity(data: Optional[ActivityPayload], state: ConnectionState) -> Optional[ActivityTypes]:
    if not data:
        return None

    game_type = try_enum(ActivityType, data.get('type', -1))
    if game_type is ActivityType.playing:
        if 'application_id' in data or 'session_id' in data:
            return Activity(**data)
        return Game(**data)
    elif game_type is ActivityType.custom:
        try:
            name = data.pop('name')  # type: ignore
        except KeyError:
            ret = Activity(**data)
        else:
            # we removed the name key from data already
            ret = CustomActivity(name=name, **data)  # type: ignore
    elif game_type is ActivityType.streaming:
        if 'url' in data:
            # the url won't be None here
            return Streaming(**data)  # type: ignore
        return Activity(**data)
    elif game_type is ActivityType.listening and 'sync_id' in data and 'session_id' in data:
        return Spotify(**data)
    else:
        ret = Activity(**data)

    if isinstance(ret.emoji, PartialEmoji):
        ret.emoji._state = state
    return ret


================================================
FILE: discord/app_commands/__init__.py
================================================
"""
discord.app_commands
~~~~~~~~~~~~~~~~~~~~~

Application commands support for the Discord API

:copyright: (c) 2015-present Rapptz
:license: MIT, see LICENSE for more details.

"""

from .commands import *
from .errors import *
from .models import *
from .tree import *
from .namespace import *
from .transformers import *
from .translator import *
from .installs import *
from . import checks as checks
from .checks import Cooldown as Cooldown


================================================
FILE: discord/app_commands/checks.py
================================================
"""
The MIT License (MIT)

Copyright (c) 2015-present Rapptz

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

from __future__ import annotations

from typing import (
    Any,
    Coroutine,
    Dict,
    Hashable,
    Union,
    Callable,
    TypeVar,
    Optional,
    TYPE_CHECKING,
)

import time

from .commands import check
from .errors import (
    NoPrivateMessage,
    MissingRole,
    MissingAnyRole,
    MissingPermissions,
    BotMissingPermissions,
    CommandOnCooldown,
)

from ..user import User
from ..permissions import Permissions
from ..utils import get as utils_get, MISSING, maybe_coroutine

T = TypeVar('T')

if TYPE_CHECKING:
    from typing_extensions import Self
    from ..interactions import Interaction

    CooldownFunction = Union[
        Callable[[Interaction[Any]], Coroutine[Any, Any, T]],
        Callable[[Interaction[Any]], T],
    ]

__all__ = (
    'has_role',
    'has_any_role',
    'has_permissions',
    'bot_has_permissions',
    'cooldown',
    'dynamic_cooldown',
)


class Cooldown:
    """Represents a cooldown for a command.

    .. versionadded:: 2.0

    Attributes
    -----------
    rate: :class:`float`
        The total number of tokens available per :attr:`per` seconds.
    per: :class:`float`
        The length of the cooldown period in seconds.
    """

    __slots__ = ('rate', 'per', '_window', '_tokens', '_last')

    def __init__(self, rate: float, per: float) -> None:
        self.rate: int = int(rate)
        self.per: float = float(per)
        self._window: float = 0.0
        self._tokens: int = self.rate
        self._last: float = 0.0

    def get_tokens(self, current: Optional[float] = None) -> int:
        """Returns the number of available tokens before rate limiting is applied.

        Parameters
        ------------
        current: Optional[:class:`float`]
            The time in seconds since Unix epoch to calculate tokens at.
            If not supplied then :func:`time.time()` is used.

        Returns
        --------
        :class:`int`
            The number of tokens available before the cooldown is to be applied.
        """
        if not current:
            current = time.time()

        # the calculated tokens should be non-negative
        tokens = max(self._tokens, 0)

        if current > self._window + self.per:
            tokens = self.rate
        return tokens

    def get_retry_after(self, current: Optional[float] = None) -> float:
        """Returns the time in seconds until the cooldown will be reset.

        Parameters
        -------------
        current: Optional[:class:`float`]
            The current time in seconds since Unix epoch.
            If not supplied, then :func:`time.time()` is used.

        Returns
        -------
        :class:`float`
            The number of seconds to wait before this cooldown will be reset.
        """
        current = current or time.time()
        tokens = self.get_tokens(current)

        if tokens == 0:
            return self.per - (current - self._window)

        return 0.0

    def update_rate_limit(self, current: Optional[float] = None, *, tokens: int = 1) -> Optional[float]:
        """Updates the cooldown rate limit.

        Parameters
        -------------
        current: Optional[:class:`float`]
            The time in seconds since Unix epoch to update the rate limit at.
            If not supplied, then :func:`time.time()` is used.
        tokens: :class:`int`
            The amount of tokens to deduct from the rate limit.

        Returns
        -------
        Optional[:class:`float`]
            The retry-after time in seconds if rate limited.
        """
        current = current or time.time()
        self._last = current

        self._tokens = self.get_tokens(current)

        # first token used means that we start a new rate limit window
        if self._tokens == self.rate:
            self._window = current

        # decrement tokens by specified number
        self._tokens -= tokens

        # check if we are rate limited and return retry-after
        if self._tokens < 0:
            return self.per - (current - self._window)

    def reset(self) -> None:
        """Reset the cooldown to its initial state."""
        self._tokens = self.rate
        self._last = 0.0

    def copy(self) -> Self:
        """Creates a copy of this cooldown.

        Returns
        --------
        :class:`Cooldown`
            A new instance of this cooldown.
        """
        return self.__class__(self.rate, self.per)

    def __repr__(self) -> str:
        return f'<Cooldown rate: {self.rate} per: {self.per} window: {self._window} tokens: {self._tokens}>'


def has_role(item: Union[int, str], /) -> Callable[[T], T]:
    """A :func:`~discord.app_commands.check` that is added that checks if the member invoking the
    command has the role specified via the name or ID specified.

    If a string is specified, you must give the exact name of the role, including
    caps and spelling.

    If an integer is specified, you must give the exact snowflake ID of the role.

    This check raises one of two special exceptions, :exc:`~discord.app_commands.MissingRole`
    if the user is missing a role, or :exc:`~discord.app_commands.NoPrivateMessage` if
    it is used in a private message. Both inherit from :exc:`~discord.app_commands.CheckFailure`.

    .. versionadded:: 2.0

    .. note::

        This is different from the permission system that Discord provides for application
        commands. This is done entirely locally in the program rather than being handled
        by Discord.

    Parameters
    -----------
    item: Union[:class:`int`, :class:`str`]
        The name or ID of the role to check.
    """

    def predicate(interaction: Interaction) -> bool:
        if isinstance(interaction.user, User):
            raise NoPrivateMessage()

        if isinstance(item, int):
            role = interaction.user.get_role(item)
        else:
            role = utils_get(interaction.user.roles, name=item)

        if role is None:
            raise MissingRole(item)
        return True

    return check(predicate)


def has_any_role(*items: Union[int, str]) -> Callable[[T], T]:
    r"""A :func:`~discord.app_commands.check` that is added that checks if the member
    invoking the command has **any** of the roles specified. This means that if they have
    one out of the three roles specified, then this check will return ``True``.

    Similar to :func:`has_role`\, the names or IDs passed in must be exact.

    This check raises one of two special exceptions, :exc:`~discord.app_commands.MissingAnyRole`
    if the user is missing all roles, or :exc:`~discord.app_commands.NoPrivateMessage` if
    it is used in a private message. Both inherit from :exc:`~discord.app_commands.CheckFailure`.

    .. versionadded:: 2.0

    .. note::

        This is different from the permission system that Discord provides for application
        commands. This is done entirely locally in the program rather than being handled
        by Discord.

    Parameters
    -----------
    items: List[Union[:class:`str`, :class:`int`]]
        An argument list of names or IDs to check that the member has roles wise.

    Example
    --------

    .. code-block:: python3

        @tree.command()
        @app_commands.checks.has_any_role('Library Devs', 'Moderators', 492212595072434186)
        async def cool(interaction: discord.Interaction):
            await interaction.response.send_message('You are cool indeed')
    """

    def predicate(interaction: Interaction) -> bool:
        if isinstance(interaction.user, User):
            raise NoPrivateMessage()

        if any(
            interaction.user.get_role(item) is not None
            if isinstance(item, int)
            else utils_get(interaction.user.roles, name=item) is not None
            for item in items
        ):
            return True
        raise MissingAnyRole(list(items))

    return check(predicate)


def has_permissions(**perms: bool) -> Callable[[T], T]:
    r"""A :func:`~discord.app_commands.check` that is added that checks if the member
    has all of the permissions necessary.

    Note that this check operates on the permissions given by
    :attr:`discord.Interaction.permissions`.

    The permissions passed in must be exactly like the properties shown under
    :class:`discord.Permissions`.

    This check raises a special exception, :exc:`~discord.app_commands.MissingPermissions`
    that is inherited from :exc:`~discord.app_commands.CheckFailure`.

    .. versionadded:: 2.0

    .. note::

        This is different from the permission system that Discord provides for application
        commands. This is done entirely locally in the program rather than being handled
        by Discord.

    Parameters
    ------------
    \*\*perms: :class:`bool`
        Keyword arguments denoting the permissions to check for.

    Example
    ---------

    .. code-block:: python3

        @tree.command()
        @app_commands.checks.has_permissions(manage_messages=True)
        async def test(interaction: discord.Interaction):
            await interaction.response.send_message('You can manage messages.')

    """

    invalid = perms.keys() - Permissions.VALID_FLAGS.keys()
    if invalid:
        raise TypeError(f"Invalid permission(s): {', '.join(invalid)}")

    def predicate(interaction: Interaction) -> bool:
        permissions = interaction.permissions

        missing = [perm for perm, value in perms.items() if getattr(permissions, perm) != value]

        if not missing:
            return True

        raise MissingPermissions(missing)

    return check(predicate)


def bot_has_permissions(**perms: bool) -> Callable[[T], T]:
    """Similar to :func:`has_permissions` except checks if the bot itself has
    the permissions listed. This relies on :attr:`discord.Interaction.app_permissions`.

    This check raises a special exception, :exc:`~discord.app_commands.BotMissingPermissions`
    that is inherited from :exc:`~discord.app_commands.CheckFailure`.

    .. versionadded:: 2.0
    """

    invalid = set(perms) - set(Permissions.VALID_FLAGS)
    if invalid:
        raise TypeError(f"Invalid permission(s): {', '.join(invalid)}")

    def predicate(interaction: Interaction) -> bool:
        permissions = interaction.app_permissions
        missing = [perm for perm, value in perms.items() if getattr(permissions, perm) != value]

        if not missing:
            return True

        raise BotMissingPermissions(missing)

    return check(predicate)


def _create_cooldown_decorator(
    key: CooldownFunction[Hashable], factory: CooldownFunction[Optional[Cooldown]]
) -> Callable[[T], T]:

    mapping: Dict[Any, Cooldown] = {}

    async def get_bucket(
        interaction: Interaction,
        *,
        mapping: Dict[Any, Cooldown] = mapping,
        key: CooldownFunction[Hashable] = key,
        factory: CooldownFunction[Optional[Cooldown]] = factory,
    ) -> Optional[Cooldown]:
        current = interaction.created_at.timestamp()
        dead_keys = [k for k, v in mapping.items() if current > v._last + v.per]
        for k in dead_keys:
            del mapping[k]

        k = await maybe_coroutine(key, interaction)
        if k not in mapping:
            bucket: Optional[Cooldown] = await maybe_coroutine(factory, interaction)
            if bucket is not None:
                mapping[k] = bucket
        else:
            bucket = mapping[k]

        return bucket

    async def predicate(interaction: Interaction) -> bool:
        bucket = await get_bucket(interaction)
        if bucket is None:
            return True

        retry_after = bucket.update_rate_limit(interaction.created_at.timestamp())
        if retry_after is None:
            return True

        raise CommandOnCooldown(bucket, retry_after)

    return check(predicate)


def cooldown(
    rate: float,
    per: float,
    *,
    key: Optional[CooldownFunction[Hashable]] = MISSING,
) -> Callable[[T], T]:
    """A decorator that adds a cooldown to a command.

    A cooldown allows a command to only be used a specific amount
    of times in a specific time frame. These cooldowns are based off
    of the ``key`` function provided. If a ``key`` is not provided
    then it defaults to a user-level cooldown. The ``key`` function
    must take a single parameter, the :class:`discord.Interaction` and
    return a value that is used as a key to the internal cooldown mapping.

    The ``key`` function can optionally be a coroutine.

    If a cooldown is triggered, then :exc:`~discord.app_commands.CommandOnCooldown` is
    raised to the error handlers.

    Examples
    ---------

    Setting a one per 5 seconds per member cooldown on a command:

    .. code-block:: python3

        @tree.command()
        @app_commands.checks.cooldown(1, 5.0, key=lambda i: (i.guild_id, i.user.id))
        async def test(interaction: discord.Interaction):
            await interaction.response.send_message('Hello')

        @test.error
        async def on_test_error(interaction: discord.Interaction, error: app_commands.AppCommandError):
            if isinstance(error, app_commands.CommandOnCooldown):
                await interaction.response.send_message(str(error), ephemeral=True)

    Parameters
    ------------
    rate: :class:`int`
        The number of times a command can be used before triggering a cooldown.
    per: :class:`float`
        The amount of seconds to wait for a cooldown when it's been triggered.
    key: Optional[Callable[[:class:`discord.Interaction`], :class:`collections.abc.Hashable`]]
        A function that returns a key to the mapping denoting the type of cooldown.
        Can optionally be a coroutine. If not given then defaults to a user-level
        cooldown. If ``None`` is passed then it is interpreted as a "global" cooldown.
    """

    if key is MISSING:
        key_func = lambda interaction: interaction.user.id
    elif key is None:
        key_func = lambda i: None
    else:
        key_func = key

    factory = lambda interaction: Cooldown(rate, per)

    return _create_cooldown_decorator(key_func, factory)


def dynamic_cooldown(
    factory: CooldownFunction[Optional[Cooldown]],
    *,
    key: Optional[CooldownFunction[Hashable]] = MISSING,
) -> Callable[[T], T]:
    """A decorator that adds a dynamic cooldown to a command.

    A cooldown allows a command to only be used a specific amount
    of times in a specific time frame. These cooldowns are based off
    of the ``key`` function provided. If a ``key`` is not provided
    then it defaults to a user-level cooldown. The ``key`` function
    must take a single parameter, the :class:`discord.Interaction` and
    return a value that is used as a key to the internal cooldown mapping.

    If a ``factory`` function is given, it must be a function that
    accepts a single parameter of type :class:`discord.Interaction` and must
    return a :class:`~discord.app_commands.Cooldown` or ``None``.
    If ``None`` is returned then that cooldown is effectively bypassed.

    Both ``key`` and ``factory`` can optionally be coroutines.

    If a cooldown is triggered, then :exc:`~discord.app_commands.CommandOnCooldown` is
    raised to the error handlers.

    Examples
    ---------

    Setting a cooldown for everyone but the owner.

    .. code-block:: python3

        def cooldown_for_everyone_but_me(interaction: discord.Interaction) -> Optional[app_commands.Cooldown]:
            if interaction.user.id == 80088516616269824:
                return None
            return app_commands.Cooldown(1, 10.0)

        @tree.command()
        @app_commands.checks.dynamic_cooldown(cooldown_for_everyone_but_me)
        async def test(interaction: discord.Interaction):
            await interaction.response.send_message('Hello')

        @test.error
        async def on_test_error(interaction: discord.Interaction, error: app_commands.AppCommandError):
            if isinstance(error, app_commands.CommandOnCooldown):
                await interaction.response.send_message(str(error), ephemeral=True)

    Parameters
    ------------
    factory: Optional[Callable[[:class:`discord.Interaction`], Optional[:class:`~discord.app_commands.Cooldown`]]]
        A function that takes an interaction and returns a cooldown that will apply to that interaction
        or ``None`` if the interaction should not have a cooldown.
    key: Optional[Callable[[:class:`discord.Interaction`], :class:`collections.abc.Hashable`]]
        A function that returns a key to the mapping denoting the type of cooldown.
        Can optionally be a coroutine. If not given then defaults to a user-level
        cooldown. If ``None`` is passed then it is interpreted as a "global" cooldown.
    """

    if key is MISSING:
        key_func = lambda interaction: interaction.user.id
    elif key is None:
        key_func = lambda i: None
    else:
        key_func = key

    return _create_cooldown_decorator(key_func, factory)


================================================
FILE: discord/app_commands/commands.py
================================================
"""
The MIT License (MIT)

Copyright (c) 2015-present Rapptz

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

from __future__ import annotations
import inspect

from typing import (
    Any,
    Callable,
    ClassVar,
    Coroutine,
    Dict,
    Generator,
    Generic,
    List,
    MutableMapping,
    Optional,
    Set,
    TYPE_CHECKING,
    Tuple,
    Type,
    TypeVar,
    Union,
    overload,
)

import re
from copy import copy as shallow_copy

from ..enums import AppCommandOptionType, AppCommandType, ChannelType, Locale
from .installs import AppCommandContext, AppInstallationType
from .models import Choice
from .transformers import annotation_to_parameter, CommandParameter, NoneType
from .errors import AppCommandError, CheckFailure, CommandInvokeError, CommandSignatureMismatch, CommandAlreadyRegistered
from .translator import TranslationContextLocation, TranslationContext, Translator, locale_str
from ..message import Message
from ..user import User
from ..member import Member
from ..permissions import Permissions
from ..utils import resolve_annotation, MISSING, is_inside_class, maybe_coroutine, async_all, _shorten, _to_kebab_case

if TYPE_CHECKING:
    from typing_extensions import ParamSpec, Concatenate
    from ..interactions import Interaction
    from ..abc import Snowflake
    from .namespace import Namespace
    from .models import ChoiceT
    from .tree import CommandTree
    from .._types import ClientT

    # Generally, these two libraries are supposed to be separate from each other.
    # However, for type hinting purposes it's unfortunately necessary for one to
    # reference the other to prevent type checking errors in callbacks
    from discord.ext import commands

    ErrorFunc = Callable[[Interaction, AppCommandError], Coroutine[Any, Any, None]]

__all__ = (
    'Command',
    'ContextMenu',
    'Group',
    'Parameter',
    'context_menu',
    'command',
    'describe',
    'check',
    'rename',
    'choices',
    'autocomplete',
    'guilds',
    'guild_only',
    'dm_only',
    'private_channel_only',
    'allowed_contexts',
    'guild_install',
    'user_install',
    'allowed_installs',
    'default_permissions',
)

if TYPE_CHECKING:
    P = ParamSpec('P')
else:
    P = TypeVar('P')

T = TypeVar('T')
F = TypeVar('F', bound=Callable[..., Any])
GroupT = TypeVar('GroupT', bound='Binding')
Coro = Coroutine[Any, Any, T]
UnboundError = Callable[['Interaction[Any]', AppCommandError], Coro[Any]]
Error = Union[
    Callable[[GroupT, 'Interaction[Any]', AppCommandError], Coro[Any]],
    UnboundError,
]
Check = Callable[['Interaction[Any]'], Union[bool, Coro[bool]]]
Binding = Union['Group', 'commands.Cog']


if TYPE_CHECKING:
    CommandCallback = Union[
        Callable[Concatenate[GroupT, 'Interaction[Any]', P], Coro[T]],
        Callable[Concatenate['Interaction[Any]', P], Coro[T]],
    ]

    ContextMenuCallback = Union[
        # If groups end up support context menus these would be uncommented
        # Callable[[GroupT, 'Interaction', Member], Coro[Any]],
        # Callable[[GroupT, 'Interaction', User], Coro[Any]],
        # Callable[[GroupT, 'Interaction', Message], Coro[Any]],
        # Callable[[GroupT, 'Interaction', Union[Member, User]], Coro[Any]],
        Callable[['Interaction[Any]', Member], Coro[Any]],
        Callable[['Interaction[Any]', User], Coro[Any]],
        Callable[['Interaction[Any]', Message], Coro[Any]],
        Callable[['Interaction[Any]', Union[Member, User]], Coro[Any]],
    ]

    AutocompleteCallback = Union[
        Callable[[GroupT, 'Interaction[Any]', str], Coro[List[Choice[ChoiceT]]]],
        Callable[['Interaction[Any]', str], Coro[List[Choice[ChoiceT]]]],
    ]
else:
    CommandCallback = Callable[..., Coro[T]]
    ContextMenuCallback = Callable[..., Coro[T]]
    AutocompleteCallback = Callable[..., Coro[T]]


CheckInputParameter = Union['Command[Any, ..., Any]', 'ContextMenu', 'CommandCallback[Any, ..., Any]', ContextMenuCallback]

# The re module doesn't support \p{} so we have to list characters from Thai and Devanagari manually.
THAI_COMBINING = r'\u0e31-\u0e3a\u0e47-\u0e4e'
DEVANAGARI_COMBINING = r'\u0900-\u0903\u093a\u093b\u093c\u093e\u093f\u0940-\u094f\u0955\u0956\u0957\u0962\u0963'
VALID_SLASH_COMMAND_NAME = re.compile(r'^[-_\w' + THAI_COMBINING + DEVANAGARI_COMBINING + r']{1,32}$')

ARG_NAME_SUBREGEX = r'(?:\\?\*){0,2}(?P<name>\w+)'

ARG_DESCRIPTION_SUBREGEX = r'(?P<description>(?:.|\n)+?(?:\Z|\r?\n(?=[\S\r\n])))'

ARG_TYPE_SUBREGEX = r'(?:.+)'

GOOGLE_DOCSTRING_ARG_REGEX = re.compile(
    rf'^{ARG_NAME_SUBREGEX}[ \t]*(?:\({ARG_TYPE_SUBREGEX}\))?[ \t]*:[ \t]*{ARG_DESCRIPTION_SUBREGEX}',
    re.MULTILINE,
)

SPHINX_DOCSTRING_ARG_REGEX = re.compile(
    rf'^:param {ARG_NAME_SUBREGEX}:[ \t]+{ARG_DESCRIPTION_SUBREGEX}',
    re.MULTILINE,
)

NUMPY_DOCSTRING_ARG_REGEX = re.compile(
    rf'^{ARG_NAME_SUBREGEX}(?:[ \t]*:)?(?:[ \t]+{ARG_TYPE_SUBREGEX})?[ \t]*\r?\n[ \t]+{ARG_DESCRIPTION_SUBREGEX}',
    re.MULTILINE,
)


def _parse_args_from_docstring(func: Callable[..., Any], params: Dict[str, CommandParameter]) -> Dict[str, str]:
    docstring = inspect.getdoc(func)

    if docstring is None:
        return {}

    # Extract the arguments
    # Note: These are loose regexes, but they are good enough for our purposes
    # For Google-style, look only at the lines that are indented
    section_lines = inspect.cleandoc('\n'.join(line for line in docstring.splitlines() if line.startswith('  ')))
    docstring_styles = (
        GOOGLE_DOCSTRING_ARG_REGEX.finditer(section_lines),
        SPHINX_DOCSTRING_ARG_REGEX.finditer(docstring),
        NUMPY_DOCSTRING_ARG_REGEX.finditer(docstring),
    )

    return {
        m.group('name'): m.group('description') for matches in docstring_styles for m in matches if m.group('name') in params
    }


def validate_name(name: str) -> str:
    match = VALID_SLASH_COMMAND_NAME.match(name)
    if match is None:
        raise ValueError(
            f'{name!r} must be between 1-32 characters and contain only lower-case letters, numbers, hyphens, or underscores.'
        )

    # Ideally, name.islower() would work instead but since certain characters
    # are Lo (e.g. CJK) those don't pass the test. I'd use `casefold` instead as
    # well, but chances are the server-side check is probably something similar to
    # this code anyway.
    if name.lower() != name:
        raise ValueError(f'{name!r} must be all lower-case')
    return name


def validate_context_menu_name(name: str) -> str:
    if not name or len(name) > 32:
        raise ValueError('context menu names must be between 1-32 characters')
    return name


def validate_auto_complete_callback(
    callback: AutocompleteCallback[GroupT, ChoiceT]
) -> AutocompleteCallback[GroupT, ChoiceT]:
    # This function needs to ensure the following is true:
    # If self.foo is passed then don't pass command.binding to the callback
    # If Class.foo is passed then it is assumed command.binding has to be passed
    # If free_function_foo is passed then no binding should be passed at all
    # Passing command.binding is mandated by pass_command_binding

    binding = getattr(callback, '__self__', None)
    pass_command_binding = binding is None and is_inside_class(callback)

    # 'method' objects can't have dynamic attributes
    if binding is None:
        callback.pass_command_binding = pass_command_binding

    required_parameters = 2 + pass_command_binding
    params = inspect.signature(callback).parameters
    if len(params) != required_parameters:
        raise TypeError(f'autocomplete callback {callback.__qualname__!r} requires either 2 or 3 parameters to be passed')

    return callback


def _context_menu_annotation(annotation: Any, *, _none: type = NoneType) -> AppCommandType:
    if annotation is Message:
        return AppCommandType.message

    supported_types: Set[Any] = {Member, User}
    if annotation in supported_types:
        return AppCommandType.user

    # Check if there's an origin
    origin = getattr(annotation, '__origin__', None)
    if origin is not Union:
        # Only Union is supported so bail early
        msg = (
            f'unsupported type annotation {annotation!r}, must be either discord.Member, '
            'discord.User, discord.Message, or a typing.Union of discord.Member and discord.User'
        )
        raise TypeError(msg)

    # Only Union[Member, User] is supported
    if not all(arg in supported_types for arg in annotation.__args__):
        raise TypeError(f'unsupported types given inside {annotation!r}')

    return AppCommandType.user


def _populate_descriptions(params: Dict[str, CommandParameter], descriptions: Dict[str, Any]) -> None:
    for name, param in params.items():
        description = descriptions.pop(name, MISSING)
        if description is MISSING:
            param.description = '…'
            continue

        if not isinstance(description, (str, locale_str)):
            raise TypeError('description must be a string')

        if isinstance(description, str):
            param.description = _shorten(description)
        else:
            param.description = description

    if descriptions:
        first = next(iter(descriptions))
        raise TypeError(f'unknown parameter given: {first}')


def _populate_renames(params: Dict[str, CommandParameter], renames: Dict[str, Union[str, locale_str]]) -> None:
    rename_map: Dict[str, Union[str, locale_str]] = {}

    # original name to renamed name

    for name in params.keys():
        new_name = renames.pop(name, MISSING)

        if new_name is MISSING:
            rename_map[name] = name
            continue

        if name in rename_map:
            raise ValueError(f'{new_name} is already used')

        if isinstance(new_name, str):
            new_name = validate_name(new_name)
        else:
            validate_name(new_name.message)

        rename_map[name] = new_name
        params[name]._rename = new_name

    if renames:
        first = next(iter(renames))
        raise ValueError(f'unknown parameter given: {first}')


def _populate_choices(params: Dict[str, CommandParameter], all_choices: Dict[str, List[Choice]]) -> None:
    for name, param in params.items():
        choices = all_choices.pop(name, MISSING)
        if choices is MISSING:
            continue

        if not isinstance(choices, list):
            raise TypeError('choices must be a list of Choice')

        if not all(isinstance(choice, Choice) for choice in choices):
            raise TypeError('choices must be a list of Choice')

        if param.type not in (AppCommandOptionType.string, AppCommandOptionType.number, AppCommandOptionType.integer):
            raise TypeError('choices are only supported for integer, string, or number option types')

        if not all(param.type == choice._option_type for choice in choices):
            raise TypeError('choices must all have the same inner option type as the parameter choice type')

        param.choices = choices

    if all_choices:
        first = next(iter(all_choices))
        raise TypeError(f'unknown parameter given: {first}')


def _populate_autocomplete(params: Dict[str, CommandParameter], autocomplete: Dict[str, Any]) -> None:
    for name, param in params.items():
        callback = autocomplete.pop(name, MISSING)
        if callback is MISSING:
            continue

        if not inspect.iscoroutinefunction(callback):
            raise TypeError('autocomplete callback must be a coroutine function')

        if param.type not in (AppCommandOptionType.string, AppCommandOptionType.number, AppCommandOptionType.integer):
            raise TypeError('autocomplete is only supported for integer, string, or number option types')

        if param.is_choice_annotation():
            raise TypeError(
                'Choice annotation unsupported for autocomplete parameters, consider using a regular annotation instead'
            )

        param.autocomplete = validate_auto_complete_callback(callback)

    if autocomplete:
        first = next(iter(autocomplete))
        raise TypeError(f'unknown parameter given: {first}')


def _extract_parameters_from_callback(func: Callable[..., Any], globalns: Dict[str, Any]) -> Dict[str, CommandParameter]:
    params = inspect.signature(func).parameters
    cache = {}
    required_params = is_inside_class(func) + 1
    if len(params) < required_params:
        raise TypeError(f'callback {func.__qualname__!r} must have more than {required_params - 1} parameter(s)')

    iterator = iter(params.values())
    for _ in range(0, required_params):
        next(iterator)

    parameters: List[CommandParameter] = []
    for parameter in iterator:
        if parameter.annotation is parameter.empty:
            raise TypeError(f'parameter {parameter.name!r} is missing a type annotation in callback {func.__qualname__!r}')

        resolved = resolve_annotation(parameter.annotation, globalns, globalns, cache)
        param = annotation_to_parameter(resolved, parameter)
        parameters.append(param)

    values = sorted(parameters, key=lambda a: a.required, reverse=True)
    result = {v.name: v for v in values}

    descriptions = _parse_args_from_docstring(func, result)

    try:
        descriptions.update(func.__discord_app_commands_param_description__)
    except AttributeError:
        for param in values:
            if param.description is MISSING:
                param.description = '…'
    if descriptions:
        _populate_descriptions(result, descriptions)

    try:
        renames = func.__discord_app_commands_param_rename__
    except AttributeError:
        pass
    else:
        _populate_renames(result, renames.copy())

    try:
        choices = func.__discord_app_commands_param_choices__
    except AttributeError:
        pass
    else:
        _populate_choices(result, choices.copy())

    try:
        autocomplete = func.__discord_app_commands_param_autocomplete__
    except AttributeError:
        pass
    else:
        _populate_autocomplete(result, autocomplete.copy())

    return result


def _get_context_menu_parameter(func: ContextMenuCallback) -> Tuple[str, Any, AppCommandType]:
    params = inspect.signature(func).parameters
    if is_inside_class(func) and not hasattr(func, '__self__'):
        raise TypeError('context menus cannot be defined inside a class')

    if len(params) != 2:
        msg = (
            f'context menu callback {func.__qualname__!r} requires 2 parameters, '
            'the first one being the interaction and the other one explicitly '
            'annotated with either discord.Message, discord.User, discord.Member, '
            'or a typing.Union of discord.Member and discord.User'
        )
        raise TypeError(msg)

    iterator = iter(params.values())
    next(iterator)  # skip interaction
    parameter = next(iterator)
    if parameter.annotation is parameter.empty:
        msg = (
            f'second parameter of context menu callback {func.__qualname__!r} must be explicitly '
            'annotated with either discord.Message, discord.User, discord.Member, or '
            'a typing.Union of discord.Member and discord.User'
        )
        raise TypeError(msg)

    resolved = resolve_annotation(parameter.annotation, func.__globals__, func.__globals__, {})
    type = _context_menu_annotation(resolved)
    return (parameter.name, resolved, type)


def mark_overrideable(func: F) -> F:
    func.__discord_app_commands_base_function__ = None
    return func


class Parameter:
    """A class that contains the parameter information of a :class:`Command` callback.

    .. versionadded:: 2.0

    Attributes
    -----------
    name: :class:`str`
        The name of the parameter. This is the Python identifier for the parameter.
    display_name: :class:`str`
        The displayed name of the parameter on Discord.
    description: :class:`str`
        The description of the parameter.
    autocomplete: :class:`bool`
        Whether the parameter has an autocomplete handler.
    locale_name: Optional[:class:`locale_str`]
        The display name's locale string, if available.
    locale_description: Optional[:class:`locale_str`]
        The description's locale string, if available.
    required: :class:`bool`
        Whether the parameter is required
    choices: List[:class:`~discord.app_commands.Choice`]
        A list of choices this parameter takes, if any.
    type: :class:`~discord.AppCommandOptionType`
        The underlying type of this parameter.
    channel_types: List[:class:`~discord.ChannelType`]
        The channel types that are allowed for this parameter.
    min_value: Optional[Union[:class:`int`, :class:`float`]]
        The minimum supported value for this parameter.
    max_value: Optional[Union[:class:`int`, :class:`float`]]
        The maximum supported value for this parameter.
    default: Any
        The default value of the parameter, if given.
        If not given then this is :data:`~discord.utils.MISSING`.
    command: :class:`Command`
        The command this parameter is attached to.
    """

    def __init__(self, parent: CommandParameter, command: Command[Any, ..., Any]) -> None:
        self.__parent: CommandParameter = parent
        self.__command: Command[Any, ..., Any] = command

    @property
    def command(self) -> Command[Any, ..., Any]:
        return self.__command

    @property
    def name(self) -> str:
        return self.__parent.name

    @property
    def display_name(self) -> str:
        return self.__parent.display_name

    @property
    def required(self) -> bool:
        return self.__parent.required

    @property
    def description(self) -> str:
        return str(self.__parent.description)

    @property
    def locale_name(self) -> Optional[locale_str]:
        if isinstance(self.__parent._rename, locale_str):
            return self.__parent._rename
        return None

    @property
    def locale_description(self) -> Optional[locale_str]:
        if isinstance(self.__parent.description, locale_str):
            return self.__parent.description
        return None

    @property
    def autocomplete(self) -> bool:
        return self.__parent.autocomplete is not None

    @property
    def default(self) -> Any:
        return self.__parent.default

    @property
    def type(self) -> AppCommandOptionType:
        return self.__parent.type

    @property
    def choices(self) -> List[Choice[Union[int, float, str]]]:
        choices = self.__parent.choices
        if choices is MISSING:
            return []
        return choices.copy()

    @property
    def channel_types(self) -> List[ChannelType]:
        channel_types = self.__parent.channel_types
        if channel_types is MISSING:
            return []
        return channel_types.copy()

    @property
    def min_value(self) -> Optional[Union[int, float]]:
        return self.__parent.min_value

    @property
    def max_value(self) -> Optional[Union[int, float]]:
        return self.__parent.max_value


class Command(Generic[GroupT, P, T]):
    """A class that implements an application command.

    These are usually not created manually, instead they are created using
    one of the following decorators:

    - :func:`~discord.app_commands.command`
    - :meth:`Group.command <discord.app_commands.Group.command>`
    - :meth:`CommandTree.command <discord.app_commands.CommandTree.command>`

    .. versionadded:: 2.0

    Parameters
    -----------
    name: Union[:class:`str`, :class:`locale_str`]
        The name of the application command.
    description: Union[:class:`str`, :class:`locale_str`]
        The description of the application command. This shows up in the UI to describe
        the application command.
    callback: :ref:`coroutine <coroutine>`
        The coroutine that is executed when the command is called.
    auto_locale_strings: :class:`bool`
        If this is set to ``True``, then all translatable strings will implicitly
        be wrapped into :class:`locale_str` rather than :class:`str`. This could
        avoid some repetition and be more ergonomic for certain defaults such
        as default command names, command descriptions, and parameter names.
        Defaults to ``True``.
    nsfw: :class:`bool`
        Whether the command is NSFW and should only work in NSFW channels.
        Defaults to ``False``.

        Due to a Discord limitation, this does not work on subcommands.
    parent: Optional[:class:`Group`]
        The parent application command. ``None`` if there isn't one.
    extras: :class:`dict`
        A dictionary that can be used to store extraneous data.
        The library will not touch any values or keys within this dictionary.

    Attributes
    ------------
    name: :class:`str`
        The name of the application command.
    description: :class:`str`
        The description of the application command. This shows up in the UI to describe
        the application command.
    checks
        A list of predicates that take a :class:`~discord.Interaction` parameter
        to indicate whether the command callback should be executed. If an exception
        is necessary to be thrown to signal failure, then one inherited from
        :exc:`AppCommandError` should be used. If all the checks fail without
        propagating an exception, :exc:`CheckFailure` is raised.
    default_permissions: Optional[:class:`~discord.Permissions`]
        The default permissions that can execute this command on Discord. Note
        that server administrators can override this value in the client.
        Setting an empty permissions field will disallow anyone except server
        administrators from using the command in a guild.

        Due to a Discord limitation, this does not work on subcommands.
    guild_only: :class:`bool`
        Whether the command should only be usable in guild contexts.

        Due to a Discord limitation, this does not work on subcommands.
    allowed_contexts: Optional[:class:`~discord.app_commands.AppCommandContext`]
        The contexts that the command is allowed to be used in.
        Overrides ``guild_only`` if this is set.

        .. versionadded:: 2.4
    allowed_installs: Optional[:class:`~discord.app_commands.AppInstallationType`]
        The installation contexts that the command is allowed to be installed
        on.

        .. versionadded:: 2.4
    nsfw: :class:`bool`
        Whether the command is NSFW and should only work in NSFW channels.

        Due to a Discord limitation, this does not work on subcommands.
    parent: Optional[:class:`Group`]
        The parent application command. ``None`` if there isn't one.
    extras: :class:`dict`
        A dictionary that can be used to store extraneous data.
        The library will not touch any values or keys within this dictionary.
    """

    def __init__(
        self,
        *,
        name: Union[str, locale_str],
        description: Union[str, locale_str],
        callback: CommandCallback[GroupT, P, T],
        nsfw: bool = False,
        parent: Optional[Group] = None,
        guild_ids: Optional[List[int]] = None,
        allowed_contexts: Optional[AppCommandContext] = None,
        allowed_installs: Optional[AppInstallationType] = None,
        auto_locale_strings: bool = True,
        extras: Dict[Any, Any] = MISSING,
    ):
        name, locale = (name.message, name) if isinstance(name, locale_str) else (name, None)
        self.name: str = validate_name(name)
        self._locale_name: Optional[locale_str] = locale
        description, locale = (
            (description.message, description) if isinstance(description, locale_str) else (description, None)
        )
        self.description: str = description
        self._locale_description: Optional[locale_str] = locale
        self._attr: Optional[str] = None
        self._callback: CommandCallback[GroupT, P, T] = callback
        self.parent: Optional[Group] = parent
        self.binding: Optional[GroupT] = None
        self.on_error: Optional[Error[GroupT]] = None
        self.module: Optional[str] = callback.__module__

        # Unwrap __self__ for bound methods
        try:
            self.binding = callback.__self__
            self._callback = callback = callback.__func__
        except AttributeError:
            pass

        self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
        self.checks: List[Check] = getattr(callback, '__discord_app_commands_checks__', [])
        self._guild_ids: Optional[List[int]] = guild_ids or getattr(
            callback, '__discord_app_commands_default_guilds__', None
        )
        self.default_permissions: Optional[Permissions] = getattr(
            callback, '__discord_app_commands_default_permissions__', None
        )
        self.guild_only: bool = getattr(callback, '__discord_app_commands_guild_only__', False)
        self.allowed_contexts: Optional[AppCommandContext] = allowed_contexts or getattr(
            callback, '__discord_app_commands_contexts__', None
        )
        self.allowed_installs: Optional[AppInstallationType] = allowed_installs or getattr(
            callback, '__discord_app_commands_installation_types__', None
        )

        self.nsfw: bool = nsfw
        self.extras: Dict[Any, Any] = extras or {}

        if self._guild_ids is not None and self.parent is not None:
            raise ValueError('child commands cannot have default guilds set, consider setting them in the parent instead')

        if auto_locale_strings:
            self._convert_to_locale_strings()

    def _convert_to_locale_strings(self) -> None:
        if self._locale_name is None:
            self._locale_name = locale_str(self.name)
        if self._locale_description is None:
            self._locale_description = locale_str(self.description)

        for param in self._params.values():
            param._convert_to_locale_strings()

    def __set_name__(self, owner: Type[Any], name: str) -> None:
        self._attr = name

    @property
    def callback(self) -> CommandCallback[GroupT, P, T]:
        """:ref:`coroutine <coroutine>`: The coroutine that is executed when the command is called."""
        return self._callback

    def _copy_with(
        self,
        *,
        parent: Optional[Group],
        binding: GroupT,
        bindings: MutableMapping[GroupT, GroupT] = MISSING,
        set_on_binding: bool = True,
    ) -> Command:
        bindings = {} if bindings is MISSING else bindings

        copy = shallow_copy(self)
        copy._params = self._params.copy()
        copy.parent = parent
        copy.binding = bindings.get(self.binding) if self.binding is not None else binding

        if copy._attr and set_on_binding:
            setattr(copy.binding, copy._attr, copy)

        return copy

    async def get_translated_payload(self, tree: CommandTree[ClientT], translator: Translator) -> Dict[str, Any]:
        base = self.to_dict(tree)
        name_localizations: Dict[str, str] = {}
        description_localizations: Dict[str, str] = {}

        # Prevent creating these objects in a heavy loop
        name_context = TranslationContext(location=TranslationContextLocation.command_name, data=self)
        description_context = TranslationContext(location=TranslationContextLocation.command_description, data=self)

        for locale in Locale:
            if self._locale_name:
                translation = await translator._checked_translate(self._locale_name, locale, name_context)
                if translation is not None:
                    name_localizations[locale.value] = translation

            if self._locale_description:
                translation = await translator._checked_translate(self._locale_description, locale, description_context)
                if translation is not None:
                    description_localizations[locale.value] = translation

        base['name_localizations'] = name_localizations
        base['description_localizations'] = description_localizations
        base['options'] = [
            await param.get_translated_payload(translator, Parameter(param, self)) for param in self._params.values()
        ]
        return base

    def to_dict(self, tree: CommandTree[ClientT]) -> Dict[str, Any]:
        # If we have a parent then our type is a subcommand
        # Otherwise, the type falls back to the specific command type (e.g. slash command or context menu)
        option_type = AppCommandType.chat_input.value if self.parent is None else AppCommandOptionType.subcommand.value
        base: Dict[str, Any] = {
            'name': self.name,
            'description': self.description,
            'type': option_type,
            'options': [param.to_dict() for param in self._params.values()],
        }

        if self.parent is None:
            base['nsfw'] = self.nsfw
            base['dm_permission'] = not self.guild_only
            base['default_member_permissions'] = None if self.default_permissions is None else self.default_permissions.value
            base['contexts'] = tree.allowed_contexts._merge_to_array(self.allowed_contexts)
            base['integration_types'] = tree.allowed_installs._merge_to_array(self.allowed_installs)

        return base

    async def _invoke_error_handlers(self, interaction: Interaction, error: AppCommandError) -> None:
        # These type ignores are because the type checker can't narrow this type properly.
        if self.on_error is not None:
            if self.binding is not None:
                await self.on_error(self.binding, interaction, error)  # type: ignore
            else:
                await self.on_error(interaction, error)  # type: ignore

        parent = self.parent
        if parent is not None:
            await parent.on_error(interaction, error)

            if parent.parent is not None:
                await parent.parent.on_error(interaction, error)

        binding_error_handler = getattr(self.binding, '__discord_app_commands_error_handler__', None)
        if binding_error_handler is not None:
            await binding_error_handler(interaction, error)

    def _has_any_error_handlers(self) -> bool:
        if self.on_error is not None:
            return True

        parent = self.parent
        if parent is not None:
            # Check if the on_error is overridden
            if not hasattr(parent.on_error, '__discord_app_commands_base_function__'):
                return True

            if parent.parent is not None:
                if not hasattr(parent.parent.on_error, '__discord_app_commands_base_function__'):
                    return True

        # Check if we have a bound error handler
        if getattr(self.binding, '__discord_app_commands_error_handler__', None) is not None:
            return True

        return False

    async def _transform_arguments(self, interaction: Interaction, namespace: Namespace) -> Dict[str, Any]:
        values = namespace.__dict__
        transformed_values = {}

        for param in self._params.values():
            try:
                value = values[param.display_name]
            except KeyError:
                if not param.required:
                    transformed_values[param.name] = param.default
                else:
                    raise CommandSignatureMismatch(self) from None
            else:
                transformed_values[param.name] = await param.transform(interaction, value)

        return transformed_values

    async def _do_call(self, interaction: Interaction, params: Dict[str, Any]) -> T:
        # These type ignores are because the type checker doesn't quite understand the narrowing here
        # Likewise, it thinks we're missing positional arguments when there aren't any.
        try:
            if self.binding is not None:
                return await self._callback(self.binding, interaction, **params)  # type: ignore
            return await self._callback(interaction, **params)  # type: ignore
        except TypeError as e:
            # In order to detect mismatch from the provided signature and the Discord data,
            # there are many ways it can go wrong yet all of them eventually lead to a TypeError
            # from the Python compiler showcasing that the signature is incorrect. This lovely
            # piece of code essentially checks the last frame of the caller and checks if the
            # locals contains our `self` reference.
            #
            # This is because there is a possibility that a TypeError is raised within the body
            # of the function, and in that case the locals wouldn't contain a reference to
            # the command object under the name `self`.
            frame = inspect.trace()[-1].frame
            if frame.f_locals.get('self') is self:
                raise CommandSignatureMismatch(self) from None
            raise CommandInvokeError(self, e) from e
        except AppCommandError:
            raise
        except Exception as e:
            raise CommandInvokeError(self, e) from e

    async def _invoke_with_namespace(self, interaction: Interaction, namespace: Namespace) -> T:
        if not await self._check_can_run(interaction):
            raise CheckFailure(f'The check functions for command {self.name!r} failed.')

        transformed_values = await self._transform_arguments(interaction, namespace)
        return await self._do_call(interaction, transformed_values)

    async def _invoke_autocomplete(self, interaction: Interaction, name: str, namespace: Namespace):
        # The namespace contains the Discord provided names so this will be fine
        # even if the name is renamed
        value = namespace.__dict__[name]

        try:
            param = self._params[name]
        except KeyError:
            # Slow case, it might be a rename
            params = {param.display_name: param for param in self._params.values()}
            try:
                param = params[name]
            except KeyError:
                raise CommandSignatureMismatch(self) from None

        if param.autocomplete is None:
            raise CommandSignatureMismatch(self)

        predicates = getattr(param.autocomplete, '__discord_app_commands_checks__', [])
        if predicates:
            try:
                passed = await async_all(f(interaction) for f in predicates)
            except Exception:
                passed = False

            if not passed:
                if not interaction.response.is_done():
                    await interaction.response.autocomplete([])
                return

        if getattr(param.autocomplete, 'pass_command_binding', False):
            binding = self.binding
            if binding is not None:
                choices = await param.autocomplete(binding, interaction, value)
            else:
                raise TypeError('autocomplete parameter expected a bound self parameter but one was not provided')
        else:
            choices = await param.autocomplete(interaction, value)

        if interaction.response.is_done():
            return

        await interaction.response.autocomplete(choices)

    def _get_internal_command(self, name: str) -> Optional[Union[Command, Group]]:
        return None

    @property
    def parameters(self) -> List[Parameter]:
        """Returns a list of parameters for this command.

        This does not include the ``self`` or ``interaction`` parameters.

        Returns
        --------
        List[:class:`Parameter`]
            The parameters of this command.
        """
        return [Parameter(p, self) for p in self._params.values()]

    def get_parameter(self, name: str) -> Optional[Parameter]:
        """Retrieves a parameter by its name.

        The name must be the Python identifier rather than the renamed
        one for display on Discord.

        Parameters
        -----------
        name: :class:`str`
            The parameter name in the callback function.

        Returns
        --------
        Optional[:class:`Parameter`]
            The parameter or ``None`` if not found.
        """

        parent = self._params.get(name)
        if parent is not None:
            return Parameter(parent, self)
        return None

    @property
    def root_parent(self) -> Optional[Group]:
        """Optional[:class:`Group`]: The root parent of this command."""
        if self.parent is None:
            return None
        parent = self.parent
        return parent.parent or parent

    @property
    def qualified_name(self) -> str:
        """:class:`str`: Returns the fully qualified command name.

        The qualified name includes the parent name as well. For example,
        in a command like ``/foo bar`` the qualified name is ``foo bar``.
        """
        # A B C
        #     ^ self
        #   ^ parent
        # ^ grandparent
        if self.parent is None:
            return self.name

        names = [self.name, self.parent.name]
        grandparent = self.parent.parent
        if grandparent is not None:
            names.append(grandparent.name)

        return ' '.join(reversed(names))

    async def _check_can_run(self, interaction: Interaction) -> bool:
        if self.parent is not None and self.parent is not self.binding:
            # For commands with a parent which isn't the binding, i.e.
            # <binding>
            #     <parent>
            #         <command>
            # The parent check needs to be called first
            if not await maybe_coroutine(self.parent.interaction_check, interaction):
                return False

        if self.binding is not None:
            check: Optional[Check] = getattr(self.binding, 'interaction_check', None)
            if check:
                ret = await maybe_coroutine(check, interaction)
                if not ret:
                    return False

        predicates = self.checks
        if not predicates:
            return True

        return await async_all(f(interaction) for f in predicates)

    def error(self, coro: Error[GroupT]) -> Error[GroupT]:
        """A decorator that registers a coroutine as a local error handler.

        The local error handler is called whenever an exception is raised in the body
        of the command or during handling of the command. The error handler must take
        2 parameters, the interaction and the error.

        The error passed will be derived from :exc:`AppCommandError`.

        Parameters
        -----------
        coro: :ref:`coroutine <coroutine>`
            The coroutine to register as the local error handler.

        Raises
        -------
        TypeError
            The coroutine passed is not actually a coroutine.
        """

        if not inspect.iscoroutinefunction(coro):
            raise TypeError('The error handler must be a coroutine.')

        self.on_error = coro
        return coro

    def autocomplete(
        self, name: str
    ) -> Callable[[AutocompleteCallback[GroupT, ChoiceT]], AutocompleteCallback[GroupT, ChoiceT]]:
        """A decorator that registers a coroutine as an autocomplete prompt for a parameter.

        The coroutine callback must have 2 parameters, the :class:`~discord.Interaction`,
        and the current value by the user (the string currently being typed by the user).

        To get the values from other parameters that may be filled in, accessing
        :attr:`.Interaction.namespace` will give a :class:`Namespace` object with those
        values.

        Parent :func:`checks <check>` are ignored within an autocomplete. However, checks can be added
        to the autocomplete callback and the ones added will be called. If the checks fail for any reason
        then an empty list is sent as the interaction response.

        The coroutine decorator **must** return a list of :class:`~discord.app_commands.Choice` objects.
        Only up to 25 objects are supported.

        .. warning::
            The choices returned from this coroutine are suggestions. The user may ignore them and input their own value.

        Example:

        .. code-block:: python3

            @app_commands.command()
            async def fruits(interaction: discord.Interaction, fruit: str):
                await interaction.response.send_message(f'Your favourite fruit seems to be {fruit}')

            @fruits.autocomplete('fruit')
            async def fruits_autocomplete(
                interaction: discord.Interaction,
                current: str,
            ) -> List[app_commands.Choice[str]]:
                fruits = ['Banana', 'Pineapple', 'Apple', 'Watermelon', 'Melon', 'Cherry']
                return [
                    app_commands.Choice(name=fruit, value=fruit)
                    for fruit in fruits if current.lower() in fruit.lower()
                ]


        Parameters
        -----------
        name: :class:`str`
            The parameter name to register as autocomplete.

        Raises
        -------
        TypeError
            The coroutine passed is not actually a coroutine or
            the parameter is not found or of an invalid type.
        """

        def decorator(coro: AutocompleteCallback[GroupT, ChoiceT]) -> AutocompleteCallback[GroupT, ChoiceT]:
            if not inspect.iscoroutinefunction(coro):
                raise TypeError('The autocomplete callback must be a coroutine function.')

            try:
                param = self._params[name]
            except KeyError:
                raise TypeError(f'unknown parameter: {name!r}') from None

            if param.type not in (AppCommandOptionType.string, AppCommandOptionType.number, AppCommandOptionType.integer):
                raise TypeError('autocomplete is only supported for integer, string, or number option types')

            if param.is_choice_annotation():
                raise TypeError(
                    'Choice annotation unsupported for autocomplete parameters, consider using a regular annotation instead'
                )

            param.autocomplete = validate_auto_complete_callback(coro)
            return coro

        return decorator

    def add_check(self, func: Check, /) -> None:
        """Adds a check to the command.

        This is the non-decorator interface to :func:`check`.

        Parameters
        -----------
        func
            The function that will be used as a check.
        """

        self.checks.append(func)

    def remove_check(self, func: Check, /) -> None:
        """Removes a check from the command.

        This function is idempotent and will not raise an exception
        if the function is not in the command's checks.

        Parameters
        -----------
        func
            The function to remove from the checks.
        """

        try:
            self.checks.remove(func)
        except ValueError:
            pass


class ContextMenu:
    """A class that implements a context menu application command.

    These are usually not created manually, instead they are created using
    one of the following decorators:

    - :func:`~discord.app_commands.context_menu`
    - :meth:`CommandTree.context_menu <discord.app_commands.CommandTree.context_menu>`

    .. versionadded:: 2.0

    Parameters
    -----------
    name: Union[:class:`str`, :class:`locale_str`]
        The name of the context menu.
    callback: :ref:`coroutine <coroutine>`
        The coroutine that is executed when the command is called.
    type: :class:`.AppCommandType`
        The type of context menu application command. By default, this is inferred
        by the parameter of the callback.
    auto_locale_strings: :class:`bool`
       
Download .txt
gitextract_bpdvc9yc/

├── .github/
│   ├── CONTRIBUTING.md
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.yml
│   │   ├── config.yml
│   │   └── feature_request.yml
│   ├── PULL_REQUEST_TEMPLATE.md
│   └── workflows/
│       ├── build.yml
│       ├── crowdin_download.yml
│       ├── crowdin_upload.yml
│       ├── lint.yml
│       ├── scripts/
│       │   └── close_and_reopen_pr.js
│       └── test.yml
├── .gitignore
├── .readthedocs.yml
├── LICENSE
├── MANIFEST.in
├── README.ja.rst
├── README.rst
├── discord/
│   ├── __init__.py
│   ├── __main__.py
│   ├── _types.py
│   ├── abc.py
│   ├── activity.py
│   ├── app_commands/
│   │   ├── __init__.py
│   │   ├── checks.py
│   │   ├── commands.py
│   │   ├── errors.py
│   │   ├── installs.py
│   │   ├── models.py
│   │   ├── namespace.py
│   │   ├── transformers.py
│   │   ├── translator.py
│   │   └── tree.py
│   ├── appinfo.py
│   ├── asset.py
│   ├── audit_logs.py
│   ├── automod.py
│   ├── backoff.py
│   ├── bin/
│   │   └── COPYING
│   ├── channel.py
│   ├── client.py
│   ├── colour.py
│   ├── components.py
│   ├── context_managers.py
│   ├── embeds.py
│   ├── emoji.py
│   ├── enums.py
│   ├── errors.py
│   ├── ext/
│   │   ├── commands/
│   │   │   ├── __init__.py
│   │   │   ├── _types.py
│   │   │   ├── bot.py
│   │   │   ├── cog.py
│   │   │   ├── context.py
│   │   │   ├── converter.py
│   │   │   ├── cooldowns.py
│   │   │   ├── core.py
│   │   │   ├── errors.py
│   │   │   ├── flags.py
│   │   │   ├── help.py
│   │   │   ├── hybrid.py
│   │   │   ├── parameters.py
│   │   │   └── view.py
│   │   └── tasks/
│   │       └── __init__.py
│   ├── file.py
│   ├── flags.py
│   ├── gateway.py
│   ├── guild.py
│   ├── http.py
│   ├── integrations.py
│   ├── interactions.py
│   ├── invite.py
│   ├── member.py
│   ├── mentions.py
│   ├── message.py
│   ├── mixins.py
│   ├── object.py
│   ├── oggparse.py
│   ├── opus.py
│   ├── partial_emoji.py
│   ├── permissions.py
│   ├── player.py
│   ├── poll.py
│   ├── py.typed
│   ├── raw_models.py
│   ├── reaction.py
│   ├── role.py
│   ├── scheduled_event.py
│   ├── shard.py
│   ├── sku.py
│   ├── stage_instance.py
│   ├── state.py
│   ├── sticker.py
│   ├── team.py
│   ├── template.py
│   ├── threads.py
│   ├── types/
│   │   ├── __init__.py
│   │   ├── activity.py
│   │   ├── appinfo.py
│   │   ├── audit_log.py
│   │   ├── automod.py
│   │   ├── channel.py
│   │   ├── command.py
│   │   ├── components.py
│   │   ├── embed.py
│   │   ├── emoji.py
│   │   ├── gateway.py
│   │   ├── guild.py
│   │   ├── integration.py
│   │   ├── interactions.py
│   │   ├── invite.py
│   │   ├── member.py
│   │   ├── message.py
│   │   ├── poll.py
│   │   ├── role.py
│   │   ├── scheduled_event.py
│   │   ├── sku.py
│   │   ├── snowflake.py
│   │   ├── sticker.py
│   │   ├── team.py
│   │   ├── template.py
│   │   ├── threads.py
│   │   ├── user.py
│   │   ├── voice.py
│   │   ├── webhook.py
│   │   ├── welcome_screen.py
│   │   └── widget.py
│   ├── ui/
│   │   ├── __init__.py
│   │   ├── button.py
│   │   ├── dynamic.py
│   │   ├── item.py
│   │   ├── modal.py
│   │   ├── select.py
│   │   ├── text_input.py
│   │   └── view.py
│   ├── user.py
│   ├── utils.py
│   ├── voice_client.py
│   ├── voice_state.py
│   ├── webhook/
│   │   ├── __init__.py
│   │   ├── async_.py
│   │   └── sync.py
│   ├── welcome_screen.py
│   └── widget.py
├── docs/
│   ├── Makefile
│   ├── _static/
│   │   ├── codeblocks.css
│   │   ├── copy.js
│   │   ├── custom.js
│   │   ├── icons.css
│   │   ├── scorer.js
│   │   ├── settings.js
│   │   ├── sidebar.js
│   │   └── style.css
│   ├── _templates/
│   │   ├── genindex.html
│   │   ├── gettext/
│   │   │   └── message.pot_t
│   │   ├── layout.html
│   │   └── relations.html
│   ├── api.rst
│   ├── conf.py
│   ├── crowdin.yml
│   ├── discord.rst
│   ├── ext/
│   │   ├── commands/
│   │   │   ├── api.rst
│   │   │   ├── cogs.rst
│   │   │   ├── commands.rst
│   │   │   ├── extensions.rst
│   │   │   └── index.rst
│   │   └── tasks/
│   │       └── index.rst
│   ├── extensions/
│   │   ├── attributetable.py
│   │   ├── builder.py
│   │   ├── colour_preview.py
│   │   ├── details.py
│   │   ├── exception_hierarchy.py
│   │   ├── nitpick_file_ignorer.py
│   │   └── resourcelinks.py
│   ├── faq.rst
│   ├── index.rst
│   ├── intents.rst
│   ├── interactions/
│   │   └── api.rst
│   ├── intro.rst
│   ├── locale/
│   │   └── ja/
│   │       └── LC_MESSAGES/
│   │           ├── api.po
│   │           ├── discord.po
│   │           ├── ext/
│   │           │   ├── commands/
│   │           │   │   ├── api.po
│   │           │   │   ├── cogs.po
│   │           │   │   ├── commands.po
│   │           │   │   ├── extensions.po
│   │           │   │   └── index.po
│   │           │   └── tasks/
│   │           │       └── index.po
│   │           ├── faq.po
│   │           ├── index.po
│   │           ├── intents.po
│   │           ├── interactions/
│   │           │   └── api.po
│   │           ├── intro.po
│   │           ├── logging.po
│   │           ├── migrating.po
│   │           ├── migrating_to_async.po
│   │           ├── migrating_to_v1.po
│   │           ├── quickstart.po
│   │           ├── sphinx.po
│   │           ├── version_guarantees.po
│   │           └── whats_new.po
│   ├── logging.rst
│   ├── make.bat
│   ├── migrating.rst
│   ├── migrating_to_async.rst
│   ├── migrating_to_v1.rst
│   ├── quickstart.rst
│   ├── version_guarantees.rst
│   └── whats_new.rst
├── examples/
│   ├── advanced_startup.py
│   ├── app_commands/
│   │   ├── basic.py
│   │   └── transformers.py
│   ├── background_task.py
│   ├── background_task_asyncio.py
│   ├── basic_bot.py
│   ├── basic_voice.py
│   ├── converters.py
│   ├── custom_context.py
│   ├── deleted.py
│   ├── edits.py
│   ├── guessing_game.py
│   ├── modals/
│   │   └── basic.py
│   ├── new_member.py
│   ├── reaction_roles.py
│   ├── reply.py
│   ├── secret.py
│   └── views/
│       ├── confirm.py
│       ├── counter.py
│       ├── dropdown.py
│       ├── dynamic_counter.py
│       ├── ephemeral.py
│       ├── link.py
│       ├── persistent.py
│       └── tic_tac_toe.py
├── pyproject.toml
├── requirements.txt
├── setup.py
└── tests/
    ├── test_annotated_annotation.py
    ├── test_app_commands_autocomplete.py
    ├── test_app_commands_description.py
    ├── test_app_commands_group.py
    ├── test_app_commands_invoke.py
    ├── test_colour.py
    ├── test_ext_commands_cog.py
    ├── test_ext_commands_description.py
    ├── test_ext_tasks.py
    ├── test_files.py
    ├── test_ui_selects.py
    └── test_utils.py
Download .txt
Showing preview only (393K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (4787 symbols across 167 files)

FILE: discord/__init__.py
  class VersionInfo (line 75) | class VersionInfo(NamedTuple):

FILE: discord/__main__.py
  function show_version (line 39) | def show_version() -> None:
  function core (line 56) | def core(parser: argparse.ArgumentParser, args: argparse.Namespace) -> N...
  function to_path (line 197) | def to_path(parser: argparse.ArgumentParser, name: str, *, replace_space...
  function newbot (line 235) | def newbot(parser: argparse.ArgumentParser, args: argparse.Namespace) ->...
  function newcog (line 277) | def newcog(parser: argparse.ArgumentParser, args: argparse.Namespace) ->...
  function add_newbot_args (line 311) | def add_newbot_args(subparser: argparse._SubParsersAction[argparse.Argum...
  function add_newcog_args (line 322) | def add_newcog_args(subparser: argparse._SubParsersAction[argparse.Argum...
  function parse_args (line 334) | def parse_args() -> Tuple[argparse.ArgumentParser, argparse.Namespace]:
  function main (line 345) | def main() -> None:

FILE: discord/abc.py
  class _Undefined (line 115) | class _Undefined:
    method __repr__ (line 116) | def __repr__(self) -> str:
  function _single_delete_strategy (line 123) | async def _single_delete_strategy(messages: Iterable[Message], *, reason...
  function _purge_helper (line 135) | async def _purge_helper(
  class Snowflake (line 194) | class Snowflake(Protocol):
  class User (line 213) | class User(Snowflake, Protocol):
    method display_name (line 245) | def display_name(self) -> str:
    method mention (line 250) | def mention(self) -> str:
    method avatar (line 255) | def avatar(self) -> Optional[Asset]:
    method avatar_decoration (line 260) | def avatar_decoration(self) -> Optional[Asset]:
    method avatar_decoration_sku_id (line 268) | def avatar_decoration_sku_id(self) -> Optional[int]:
    method default_avatar (line 276) | def default_avatar(self) -> Asset:
    method display_avatar (line 281) | def display_avatar(self) -> Asset:
    method mentioned_in (line 290) | def mentioned_in(self, message: Message) -> bool:
  class PrivateChannel (line 306) | class PrivateChannel:
  class _Overwrites (line 328) | class _Overwrites:
    method __init__ (line 334) | def __init__(self, data: PermissionOverwritePayload) -> None:
    method _asdict (line 340) | def _asdict(self) -> PermissionOverwritePayload:
    method is_role (line 348) | def is_role(self) -> bool:
    method is_member (line 351) | def is_member(self) -> bool:
  class GuildChannel (line 355) | class GuildChannel:
    method __init__ (line 392) | def __init__(self, *, state: ConnectionState, guild: Guild, data: Guil...
    method __str__ (line 395) | def __str__(self) -> str:
    method _sorting_bucket (line 399) | def _sorting_bucket(self) -> int:
    method _update (line 402) | def _update(self, guild: Guild, data: Dict[str, Any]) -> None:
    method _move (line 405) | async def _move(
    method _edit (line 442) | async def _edit(self, options: Dict[str, Any], reason: Optional[str]) ...
    method _fill_overwrites (line 537) | def _fill_overwrites(self, data: GuildChannelPayload) -> None:
    method changed_roles (line 563) | def changed_roles(self) -> List[Role]:
    method mention (line 579) | def mention(self) -> str:
    method jump_url (line 584) | def jump_url(self) -> str:
    method created_at (line 592) | def created_at(self) -> datetime:
    method overwrites_for (line 596) | def overwrites_for(self, obj: Union[Role, User, Object]) -> Permission...
    method overwrites (line 626) | def overwrites(self) -> Dict[Union[Role, Member, Object], PermissionOv...
    method category (line 661) | def category(self) -> Optional[CategoryChannel]:
    method permissions_synced (line 669) | def permissions_synced(self) -> bool:
    method _apply_implicit_permissions (line 683) | def _apply_implicit_permissions(self, base: Permissions) -> None:
    method permissions_for (line 697) | def permissions_for(self, obj: Union[Member, Role], /) -> Permissions:
    method delete (line 845) | async def delete(self, *, reason: Optional[str] = None) -> None:
    method set_permissions (line 870) | async def set_permissions(
    method set_permissions (line 880) | async def set_permissions(
    method set_permissions (line 889) | async def set_permissions(
    method _clone_impl (line 1003) | async def _clone_impl(
    method clone (line 1022) | async def clone(self, *, name: Optional[str] = None, reason: Optional[...
    method move (line 1055) | async def move(
    method move (line 1067) | async def move(
    method move (line 1079) | async def move(
    method move (line 1091) | async def move(
    method move (line 1102) | async def move(self, **kwargs: Any) -> None:
    method create_invite (line 1230) | async def create_invite(
    method invites (line 1309) | async def invites(self) -> List[Invite]:
  class Messageable (line 1335) | class Messageable:
    method _get_channel (line 1355) | async def _get_channel(self) -> MessageableChannel:
    method send (line 1359) | async def send(
    method send (line 1380) | async def send(
    method send (line 1401) | async def send(
    method send (line 1422) | async def send(
    method send (line 1442) | async def send(
    method typing (line 1631) | def typing(self) -> Typing:
    method fetch_message (line 1658) | async def fetch_message(self, id: int, /) -> Message:
    method pins (line 1687) | async def pins(self) -> List[Message]:
    method history (line 1716) | async def history(
  class Connectable (line 1881) | class Connectable(Protocol):
    method _get_voice_client_key (line 1894) | def _get_voice_client_key(self) -> Tuple[int, str]:
    method _get_voice_state_pair (line 1897) | def _get_voice_state_pair(self) -> Tuple[int, int]:
    method connect (line 1900) | async def connect(

FILE: discord/activity.py
  class BaseActivity (line 102) | class BaseActivity:
    method __init__ (line 123) | def __init__(self, **kwargs: Any) -> None:
    method created_at (line 127) | def created_at(self) -> Optional[datetime.datetime]:
    method to_dict (line 135) | def to_dict(self) -> ActivityPayload:
  class Activity (line 139) | class Activity(BaseActivity):
    method __init__ (line 218) | def __init__(self, **kwargs: Any) -> None:
    method __repr__ (line 242) | def __repr__(self) -> str:
    method to_dict (line 256) | def to_dict(self) -> Dict[str, Any]:
    method start (line 273) | def start(self) -> Optional[datetime.datetime]:
    method end (line 283) | def end(self) -> Optional[datetime.datetime]:
    method large_image_url (line 293) | def large_image_url(self) -> Optional[str]:
    method small_image_url (line 303) | def small_image_url(self) -> Optional[str]:
    method _image_url (line 312) | def _image_url(self, image: str) -> Optional[str]:
    method large_image_text (line 319) | def large_image_text(self) -> Optional[str]:
    method small_image_text (line 324) | def small_image_text(self) -> Optional[str]:
  class Game (line 329) | class Game(BaseActivity):
    method __init__ (line 380) | def __init__(self, name: str, **extra: Any) -> None:
    method type (line 396) | def type(self) -> ActivityType:
    method start (line 404) | def start(self) -> Optional[datetime.datetime]:
    method end (line 411) | def end(self) -> Optional[datetime.datetime]:
    method __str__ (line 417) | def __str__(self) -> str:
    method __repr__ (line 420) | def __repr__(self) -> str:
    method to_dict (line 423) | def to_dict(self) -> Dict[str, Any]:
    method __eq__ (line 439) | def __eq__(self, other: object) -> bool:
    method __ne__ (line 442) | def __ne__(self, other: object) -> bool:
    method __hash__ (line 445) | def __hash__(self) -> int:
  class Streaming (line 449) | class Streaming(BaseActivity):
    method __init__ (line 496) | def __init__(self, *, name: Optional[str], url: str, **extra: Any) -> ...
    method type (line 506) | def type(self) -> ActivityType:
    method __str__ (line 513) | def __str__(self) -> str:
    method __repr__ (line 516) | def __repr__(self) -> str:
    method twitch_name (line 520) | def twitch_name(self) -> Optional[str]:
    method to_dict (line 534) | def to_dict(self) -> Dict[str, Any]:
    method __eq__ (line 545) | def __eq__(self, other: object) -> bool:
    method __ne__ (line 548) | def __ne__(self, other: object) -> bool:
    method __hash__ (line 551) | def __hash__(self) -> int:
  class Spotify (line 555) | class Spotify:
    method __init__ (line 580) | def __init__(self, **data: Any) -> None:
    method type (line 591) | def type(self) -> ActivityType:
    method created_at (line 599) | def created_at(self) -> Optional[datetime.datetime]:
    method colour (line 608) | def colour(self) -> Colour:
    method color (line 615) | def color(self) -> Colour:
    method to_dict (line 621) | def to_dict(self) -> Dict[str, Any]:
    method name (line 635) | def name(self) -> str:
    method __eq__ (line 639) | def __eq__(self, other: object) -> bool:
    method __ne__ (line 647) | def __ne__(self, other: object) -> bool:
    method __hash__ (line 650) | def __hash__(self) -> int:
    method __str__ (line 653) | def __str__(self) -> str:
    method __repr__ (line 656) | def __repr__(self) -> str:
    method title (line 660) | def title(self) -> str:
    method artists (line 665) | def artists(self) -> List[str]:
    method artist (line 670) | def artist(self) -> str:
    method album (line 679) | def album(self) -> str:
    method album_cover_url (line 684) | def album_cover_url(self) -> str:
    method track_id (line 693) | def track_id(self) -> str:
    method track_url (line 698) | def track_url(self) -> str:
    method start (line 706) | def start(self) -> datetime.datetime:
    method end (line 712) | def end(self) -> datetime.datetime:
    method duration (line 718) | def duration(self) -> datetime.timedelta:
    method party_id (line 723) | def party_id(self) -> str:
  class CustomActivity (line 728) | class CustomActivity(BaseActivity):
    method __init__ (line 761) | def __init__(
    method type (line 783) | def type(self) -> ActivityType:
    method to_dict (line 790) | def to_dict(self) -> Dict[str, Any]:
    method __eq__ (line 807) | def __eq__(self, other: object) -> bool:
    method __ne__ (line 810) | def __ne__(self, other: object) -> bool:
    method __hash__ (line 813) | def __hash__(self) -> int:
    method __str__ (line 816) | def __str__(self) -> str:
    method __repr__ (line 824) | def __repr__(self) -> str:
  function create_activity (line 832) | def create_activity(data: ActivityPayload, state: ConnectionState) -> Ac...
  function create_activity (line 837) | def create_activity(data: None, state: ConnectionState) -> None:
  function create_activity (line 841) | def create_activity(data: Optional[ActivityPayload], state: ConnectionSt...

FILE: discord/app_commands/checks.py
  class Cooldown (line 76) | class Cooldown:
    method __init__ (line 91) | def __init__(self, rate: float, per: float) -> None:
    method get_tokens (line 98) | def get_tokens(self, current: Optional[float] = None) -> int:
    method get_retry_after (line 122) | def get_retry_after(self, current: Optional[float] = None) -> float:
    method update_rate_limit (line 144) | def update_rate_limit(self, current: Optional[float] = None, *, tokens...
    method reset (line 176) | def reset(self) -> None:
    method copy (line 181) | def copy(self) -> Self:
    method __repr__ (line 191) | def __repr__(self) -> str:
  function has_role (line 195) | def has_role(item: Union[int, str], /) -> Callable[[T], T]:
  function has_any_role (line 238) | def has_any_role(*items: Union[int, str]) -> Callable[[T], T]:
  function has_permissions (line 289) | def has_permissions(**perms: bool) -> Callable[[T], T]:
  function bot_has_permissions (line 344) | def bot_has_permissions(**perms: bool) -> Callable[[T], T]:
  function _create_cooldown_decorator (line 370) | def _create_cooldown_decorator(
  function cooldown (line 412) | def cooldown(
  function dynamic_cooldown (line 473) | def dynamic_cooldown(

FILE: discord/app_commands/commands.py
  function _parse_args_from_docstring (line 177) | def _parse_args_from_docstring(func: Callable[..., Any], params: Dict[st...
  function validate_name (line 198) | def validate_name(name: str) -> str:
  function validate_context_menu_name (line 214) | def validate_context_menu_name(name: str) -> str:
  function validate_auto_complete_callback (line 220) | def validate_auto_complete_callback(
  function _context_menu_annotation (line 244) | def _context_menu_annotation(annotation: Any, *, _none: type = NoneType)...
  function _populate_descriptions (line 269) | def _populate_descriptions(params: Dict[str, CommandParameter], descript...
  function _populate_renames (line 289) | def _populate_renames(params: Dict[str, CommandParameter], renames: Dict...
  function _populate_choices (line 317) | def _populate_choices(params: Dict[str, CommandParameter], all_choices: ...
  function _populate_autocomplete (line 342) | def _populate_autocomplete(params: Dict[str, CommandParameter], autocomp...
  function _extract_parameters_from_callback (line 366) | def _extract_parameters_from_callback(func: Callable[..., Any], globalns...
  function _get_context_menu_parameter (line 424) | def _get_context_menu_parameter(func: ContextMenuCallback) -> Tuple[str,...
  function mark_overrideable (line 454) | def mark_overrideable(func: F) -> F:
  class Parameter (line 459) | class Parameter:
    method __init__ (line 497) | def __init__(self, parent: CommandParameter, command: Command[Any, ......
    method command (line 502) | def command(self) -> Command[Any, ..., Any]:
    method name (line 506) | def name(self) -> str:
    method display_name (line 510) | def display_name(self) -> str:
    method required (line 514) | def required(self) -> bool:
    method description (line 518) | def description(self) -> str:
    method locale_name (line 522) | def locale_name(self) -> Optional[locale_str]:
    method locale_description (line 528) | def locale_description(self) -> Optional[locale_str]:
    method autocomplete (line 534) | def autocomplete(self) -> bool:
    method default (line 538) | def default(self) -> Any:
    method type (line 542) | def type(self) -> AppCommandOptionType:
    method choices (line 546) | def choices(self) -> List[Choice[Union[int, float, str]]]:
    method channel_types (line 553) | def channel_types(self) -> List[ChannelType]:
    method min_value (line 560) | def min_value(self) -> Optional[Union[int, float]]:
    method max_value (line 564) | def max_value(self) -> Optional[Union[int, float]]:
  class Command (line 568) | class Command(Generic[GroupT, P, T]):
    method __init__ (line 651) | def __init__(
    method _convert_to_locale_strings (line 712) | def _convert_to_locale_strings(self) -> None:
    method __set_name__ (line 721) | def __set_name__(self, owner: Type[Any], name: str) -> None:
    method callback (line 725) | def callback(self) -> CommandCallback[GroupT, P, T]:
    method _copy_with (line 729) | def _copy_with(
    method get_translated_payload (line 749) | async def get_translated_payload(self, tree: CommandTree[ClientT], tra...
    method to_dict (line 776) | def to_dict(self, tree: CommandTree[ClientT]) -> Dict[str, Any]:
    method _invoke_error_handlers (line 796) | async def _invoke_error_handlers(self, interaction: Interaction, error...
    method _has_any_error_handlers (line 815) | def _has_any_error_handlers(self) -> bool:
    method _transform_arguments (line 835) | async def _transform_arguments(self, interaction: Interaction, namespa...
    method _do_call (line 852) | async def _do_call(self, interaction: Interaction, params: Dict[str, A...
    method _invoke_with_namespace (line 878) | async def _invoke_with_namespace(self, interaction: Interaction, names...
    method _invoke_autocomplete (line 885) | async def _invoke_autocomplete(self, interaction: Interaction, name: s...
    method _get_internal_command (line 929) | def _get_internal_command(self, name: str) -> Optional[Union[Command, ...
    method parameters (line 933) | def parameters(self) -> List[Parameter]:
    method get_parameter (line 945) | def get_parameter(self, name: str) -> Optional[Parameter]:
    method root_parent (line 968) | def root_parent(self) -> Optional[Group]:
    method qualified_name (line 976) | def qualified_name(self) -> str:
    method _check_can_run (line 996) | async def _check_can_run(self, interaction: Interaction) -> bool:
    method error (line 1019) | def error(self, coro: Error[GroupT]) -> Error[GroupT]:
    method autocomplete (line 1045) | def autocomplete(
    method add_check (line 1121) | def add_check(self, func: Check, /) -> None:
    method remove_check (line 1134) | def remove_check(self, func: Check, /) -> None:
  class ContextMenu (line 1152) | class ContextMenu:
    method __init__ (line 1224) | def __init__(
    method callback (line 1273) | def callback(self) -> ContextMenuCallback:
    method qualified_name (line 1278) | def qualified_name(self) -> str:
    method get_translated_payload (line 1282) | async def get_translated_payload(self, tree: CommandTree[ClientT], tra...
    method to_dict (line 1295) | def to_dict(self, tree: CommandTree[ClientT]) -> Dict[str, Any]:
    method _check_can_run (line 1306) | async def _check_can_run(self, interaction: Interaction) -> bool:
    method _has_any_error_handlers (line 1313) | def _has_any_error_handlers(self) -> bool:
    method _invoke (line 1316) | async def _invoke(self, interaction: Interaction, arg: Any):
    method error (line 1327) | def error(self, coro: UnboundError) -> UnboundError:
    method add_check (line 1353) | def add_check(self, func: Check, /) -> None:
    method remove_check (line 1366) | def remove_check(self, func: Check, /) -> None:
  class Group (line 1384) | class Group:
    method __init_subclass__ (line 1495) | def __init_subclass__(
    method __init__ (line 1549) | def __init__(
    method _convert_to_locale_strings (line 1671) | def _convert_to_locale_strings(self) -> None:
    method __set_name__ (line 1679) | def __set_name__(self, owner: Type[Any], name: str) -> None:
    method _copy_with (line 1684) | def _copy_with(
    method get_translated_payload (line 1716) | async def get_translated_payload(self, tree: CommandTree[ClientT], tra...
    method to_dict (line 1740) | def to_dict(self, tree: CommandTree[ClientT]) -> Dict[str, Any]:
    method root_parent (line 1761) | def root_parent(self) -> Optional[Group]:
    method qualified_name (line 1766) | def qualified_name(self) -> str:
    method _get_internal_command (line 1777) | def _get_internal_command(self, name: str) -> Optional[Union[Command[A...
    method commands (line 1781) | def commands(self) -> List[Union[Command[Any, ..., Any], Group]]:
    method walk_commands (line 1785) | def walk_commands(self) -> Generator[Union[Command[Any, ..., Any], Gro...
    method on_error (line 1800) | async def on_error(self, interaction: Interaction, error: AppCommandEr...
    method error (line 1819) | def error(self, coro: ErrorFunc) -> ErrorFunc:
    method interaction_check (line 1848) | async def interaction_check(self, interaction: Interaction, /) -> bool:
    method add_command (line 1879) | def add_command(self, command: Union[Command[Any, ..., Any], Group], /...
    method remove_command (line 1921) | def remove_command(self, name: str, /) -> Optional[Union[Command[Any, ...
    method get_command (line 1938) | def get_command(self, name: str, /) -> Optional[Union[Command[Any, ......
    method command (line 1954) | def command(
  function command (line 2014) | def command(
  function context_menu (line 2073) | def context_menu(
  function describe (line 2136) | def describe(**parameters: Union[str, locale_str]) -> Callable[[T], T]:
  function rename (line 2191) | def rename(**parameters: Union[str, locale_str]) -> Callable[[T], T]:
  function choices (line 2234) | def choices(**parameters: List[Choice[ChoiceT]]) -> Callable[[T], T]:
  function autocomplete (line 2303) | def autocomplete(**parameters: AutocompleteCallback[GroupT, ChoiceT]) ->...
  function guilds (line 2362) | def guilds(*guild_ids: Union[Snowflake, int]) -> Callable[[T], T]:
  function check (line 2419) | def check(predicate: Check) -> Callable[[T], T]:
  function guild_only (line 2479) | def guild_only(func: None = ...) -> Callable[[T], T]:
  function guild_only (line 2484) | def guild_only(func: T) -> T:
  function guild_only (line 2488) | def guild_only(func: Optional[T] = None) -> Union[T, Callable[[T], T]]:
  function private_channel_only (line 2533) | def private_channel_only(func: None = ...) -> Callable[[T], T]:
  function private_channel_only (line 2538) | def private_channel_only(func: T) -> T:
  function private_channel_only (line 2542) | def private_channel_only(func: Optional[T] = None) -> Union[T, Callable[...
  function dm_only (line 2587) | def dm_only(func: None = ...) -> Callable[[T], T]:
  function dm_only (line 2592) | def dm_only(func: T) -> T:
  function dm_only (line 2596) | def dm_only(func: Optional[T] = None) -> Union[T, Callable[[T], T]]:
  function allowed_contexts (line 2637) | def allowed_contexts(guilds: bool = MISSING, dms: bool = MISSING, privat...
  function guild_install (line 2682) | def guild_install(func: None = ...) -> Callable[[T], T]:
  function guild_install (line 2687) | def guild_install(func: T) -> T:
  function guild_install (line 2691) | def guild_install(func: Optional[T] = None) -> Union[T, Callable[[T], T]]:
  function user_install (line 2732) | def user_install(func: None = ...) -> Callable[[T], T]:
  function user_install (line 2737) | def user_install(func: T) -> T:
  function user_install (line 2741) | def user_install(func: Optional[T] = None) -> Union[T, Callable[[T], T]]:
  function allowed_installs (line 2781) | def allowed_installs(
  function default_permissions (line 2824) | def default_permissions(**perms: bool) -> Callable[[T], T]:

FILE: discord/app_commands/errors.py
  class AppCommandError (line 68) | class AppCommandError(DiscordException):
  class CommandInvokeError (line 87) | class CommandInvokeError(AppCommandError):
    method __init__ (line 103) | def __init__(self, command: Union[Command[Any, ..., Any], ContextMenu]...
  class TransformerError (line 109) | class TransformerError(AppCommandError):
    method __init__ (line 133) | def __init__(self, value: Any, opt_type: AppCommandOptionType, transfo...
  class TranslationError (line 141) | class TranslationError(AppCommandError):
    method __init__ (line 163) | def __init__(
  class CheckFailure (line 185) | class CheckFailure(AppCommandError):
  class NoPrivateMessage (line 196) | class NoPrivateMessage(CheckFailure):
    method __init__ (line 204) | def __init__(self, message: Optional[str] = None) -> None:
  class MissingRole (line 208) | class MissingRole(CheckFailure):
    method __init__ (line 222) | def __init__(self, missing_role: Snowflake) -> None:
  class MissingAnyRole (line 228) | class MissingAnyRole(CheckFailure):
    method __init__ (line 243) | def __init__(self, missing_roles: SnowflakeList) -> None:
  class MissingPermissions (line 251) | class MissingPermissions(CheckFailure):
    method __init__ (line 265) | def __init__(self, missing_permissions: List[str], *args: Any) -> None:
  class BotMissingPermissions (line 274) | class BotMissingPermissions(CheckFailure):
    method __init__ (line 288) | def __init__(self, missing_permissions: List[str], *args: Any) -> None:
  class CommandOnCooldown (line 297) | class CommandOnCooldown(CheckFailure):
    method __init__ (line 312) | def __init__(self, cooldown: Cooldown, retry_after: float) -> None:
  class CommandAlreadyRegistered (line 318) | class CommandAlreadyRegistered(AppCommandError):
    method __init__ (line 334) | def __init__(self, name: str, guild_id: Optional[int]):
  class CommandNotFound (line 340) | class CommandNotFound(AppCommandError):
    method __init__ (line 358) | def __init__(self, name: str, parents: List[str], type: AppCommandType...
  class CommandLimitReached (line 365) | class CommandLimitReached(AppCommandError):
    method __init__ (line 383) | def __init__(self, guild_id: Optional[int], limit: int, type: AppComma...
  class CommandSignatureMismatch (line 398) | class CommandSignatureMismatch(AppCommandError):
    method __init__ (line 414) | def __init__(self, command: Union[Command[Any, ..., Any], ContextMenu,...
  class MissingApplicationID (line 425) | class MissingApplicationID(AppCommandError):
    method __init__ (line 434) | def __init__(self, message: Optional[str] = None):
  function _get_command_error (line 438) | def _get_command_error(
  class CommandSyncFailure (line 502) | class CommandSyncFailure(AppCommandError, HTTPException):
    method __init__ (line 513) | def __init__(self, child: HTTPException, commands: List[CommandTypes])...

FILE: discord/app_commands/installs.py
  class AppInstallationType (line 38) | class AppInstallationType:
    method __init__ (line 56) | def __init__(self, *, guild: Optional[bool] = None, user: Optional[boo...
    method guild (line 61) | def guild(self) -> bool:
    method guild (line 66) | def guild(self, value: bool) -> None:
    method user (line 70) | def user(self) -> bool:
    method user (line 75) | def user(self, value: bool) -> None:
    method merge (line 78) | def merge(self, other: AppInstallationType) -> AppInstallationType:
    method _is_unset (line 85) | def _is_unset(self) -> bool:
    method _merge_to_array (line 88) | def _merge_to_array(self, other: Optional[AppInstallationType]) -> Opt...
    method _from_value (line 95) | def _from_value(cls, value: Sequence[InteractionInstallationType]) -> ...
    method to_array (line 104) | def to_array(self) -> List[InteractionInstallationType]:
  class AppCommandContext (line 113) | class AppCommandContext:
    method __init__ (line 134) | def __init__(
    method guild (line 146) | def guild(self) -> bool:
    method guild (line 151) | def guild(self, value: bool) -> None:
    method dm_channel (line 155) | def dm_channel(self) -> bool:
    method dm_channel (line 160) | def dm_channel(self, value: bool) -> None:
    method private_channel (line 164) | def private_channel(self) -> bool:
    method private_channel (line 169) | def private_channel(self, value: bool) -> None:
    method merge (line 172) | def merge(self, other: AppCommandContext) -> AppCommandContext:
    method _is_unset (line 178) | def _is_unset(self) -> bool:
    method _merge_to_array (line 181) | def _merge_to_array(self, other: Optional[AppCommandContext]) -> Optio...
    method _from_value (line 188) | def _from_value(cls, value: Sequence[InteractionContextType]) -> Self:
    method to_array (line 199) | def to_array(self) -> List[InteractionContextType]:

FILE: discord/app_commands/models.py
  function is_app_command_argument_type (line 63) | def is_app_command_argument_type(value: int) -> bool:
  class AllChannels (line 94) | class AllChannels:
    method __init__ (line 107) | def __init__(self, guild: Guild):
    method id (line 111) | def id(self) -> int:
    method __repr__ (line 115) | def __repr__(self) -> str:
  function _to_locale_dict (line 119) | def _to_locale_dict(data: Dict[str, str]) -> Dict[Locale, str]:
  class AppCommand (line 123) | class AppCommand(Hashable):
    method __init__ (line 204) | def __init__(self, *, data: ApplicationCommandPayload, state: Connecti...
    method _from_data (line 208) | def _from_data(self, data: ApplicationCommandPayload) -> None:
    method to_dict (line 248) | def to_dict(self) -> ApplicationCommandPayload:
    method __str__ (line 262) | def __str__(self) -> str:
    method __repr__ (line 265) | def __repr__(self) -> str:
    method mention (line 269) | def mention(self) -> str:
    method guild (line 274) | def guild(self) -> Optional[Guild]:
    method delete (line 280) | async def delete(self) -> None:
    method edit (line 312) | async def edit(
    method fetch_permissions (line 397) | async def fetch_permissions(self, guild: Snowflake) -> GuildAppCommand...
  class Choice (line 437) | class Choice(Generic[ChoiceT]):
    method __init__ (line 470) | def __init__(self, *, name: Union[str, locale_str], value: ChoiceT):
    method from_dict (line 478) | def from_dict(cls, data: ApplicationCommandOptionChoice) -> Choice[Cho...
    method __eq__ (line 485) | def __eq__(self, o: object) -> bool:
    method __hash__ (line 488) | def __hash__(self) -> int:
    method __repr__ (line 491) | def __repr__(self) -> str:
    method _option_type (line 495) | def _option_type(self) -> AppCommandOptionType:
    method get_translated_payload (line 507) | async def get_translated_payload(self, translator: Translator) -> Dict...
    method get_translated_payload_for_locale (line 522) | async def get_translated_payload_for_locale(self, translator: Translat...
    method to_dict (line 532) | def to_dict(self) -> Dict[str, Any]:
  class AppCommandChannel (line 542) | class AppCommandChannel(Hashable):
    method __init__ (line 589) | def __init__(
    method __str__ (line 603) | def __str__(self) -> str:
    method __repr__ (line 606) | def __repr__(self) -> str:
    method guild (line 610) | def guild(self) -> Optional[Guild]:
    method resolve (line 614) | def resolve(self) -> Optional[GuildChannel]:
    method fetch (line 628) | async def fetch(self) -> GuildChannel:
    method mention (line 651) | def mention(self) -> str:
    method created_at (line 656) | def created_at(self) -> datetime:
  class AppCommandThread (line 661) | class AppCommandThread(Hashable):
    method __init__ (line 732) | def __init__(
    method __str__ (line 748) | def __str__(self) -> str:
    method __repr__ (line 751) | def __repr__(self) -> str:
    method guild (line 755) | def guild(self) -> Optional[Guild]:
    method _unroll_metadata (line 759) | def _unroll_metadata(self, data: ThreadMetadata) -> None:
    method parent (line 769) | def parent(self) -> Optional[TextChannel]:
    method mention (line 774) | def mention(self) -> str:
    method created_at (line 779) | def created_at(self) -> Optional[datetime]:
    method resolve (line 788) | def resolve(self) -> Optional[Thread]:
    method fetch (line 802) | async def fetch(self) -> Thread:
  class Argument (line 825) | class Argument:
    method __init__ (line 880) | def __init__(
    method __repr__ (line 887) | def __repr__(self) -> str:
    method _from_data (line 890) | def _from_data(self, data: ApplicationCommandOption) -> None:
    method to_dict (line 905) | def to_dict(self) -> ApplicationCommandOption:
  class AppCommandGroup (line 924) | class AppCommandGroup:
    method __init__ (line 958) | def __init__(
    method __repr__ (line 965) | def __repr__(self) -> str:
    method qualified_name (line 969) | def qualified_name(self) -> str:
    method mention (line 986) | def mention(self) -> str:
    method _from_data (line 994) | def _from_data(self, data: ApplicationCommandOption) -> None:
    method to_dict (line 1004) | def to_dict(self) -> 'ApplicationCommandOption':
  class AppCommandPermissions (line 1015) | class AppCommandPermissions:
    method __init__ (line 1038) | def __init__(self, *, data: ApplicationCommandPermissions, guild: Guil...
    method to_dict (line 1066) | def to_dict(self) -> ApplicationCommandPermissions:
  class GuildAppCommandPermissions (line 1074) | class GuildAppCommandPermissions:
    method __init__ (line 1097) | def __init__(self, *, data: GuildApplicationCommandPermissions, state:...
    method to_dict (line 1109) | def to_dict(self) -> Dict[str, Any]:
    method guild (line 1113) | def guild(self) -> Guild:
  function app_command_option_factory (line 1118) | def app_command_option_factory(

FILE: discord/app_commands/namespace.py
  class ResolveKey (line 43) | class ResolveKey(NamedTuple):
    method any_with (line 50) | def any_with(cls, id: str) -> ResolveKey:
    method __eq__ (line 53) | def __eq__(self, o: object) -> bool:
    method __hash__ (line 60) | def __hash__(self) -> int:
  class Namespace (line 66) | class Namespace:
    method __init__ (line 135) | def __init__(
    method _get_resolved_items (line 177) | def _get_resolved_items(cls, interaction: Interaction, resolved: Resol...
    method __repr__ (line 240) | def __repr__(self) -> str:
    method __eq__ (line 244) | def __eq__(self, other: object) -> bool:
    method __getitem__ (line 249) | def __getitem__(self, key: str) -> Any:
    method __contains__ (line 252) | def __contains__(self, key: str) -> Any:
    method __getattr__ (line 255) | def __getattr__(self, attr: str) -> Any:
    method __iter__ (line 258) | def __iter__(self) -> Iterator[Tuple[str, Any]]:
    method _update_with_defaults (line 261) | def _update_with_defaults(self, defaults: Iterable[Tuple[str, Any]]) -...

FILE: discord/app_commands/transformers.py
  class CommandParameter (line 77) | class CommandParameter:
    method get_translated_payload (line 93) | async def get_translated_payload(self, translator: Translator, data: P...
    method to_dict (line 128) | def to_dict(self) -> Dict[str, Any]:
    method _convert_to_locale_strings (line 153) | def _convert_to_locale_strings(self) -> None:
    method is_choice_annotation (line 167) | def is_choice_annotation(self) -> bool:
    method transform (line 170) | async def transform(self, interaction: Interaction, value: Any, /) -> ...
    method display_name (line 189) | def display_name(self) -> str:
  class Transformer (line 194) | class Transformer:
    method __call__ (line 232) | def __call__(self) -> None:
    method __or__ (line 235) | def __or__(self, rhs: Any) -> Any:
    method type (line 239) | def type(self) -> AppCommandOptionType:
    method channel_types (line 249) | def channel_types(self) -> List[ChannelType]:
    method min_value (line 261) | def min_value(self) -> Optional[Union[int, float]]:
    method max_value (line 274) | def max_value(self) -> Optional[Union[int, float]]:
    method choices (line 287) | def choices(self) -> Optional[List[Choice[Union[int, float, str]]]]:
    method _error_display_name (line 300) | def _error_display_name(self) -> str:
    method transform (line 307) | async def transform(self, interaction: Interaction, value: Any, /) -> ...
    method autocomplete (line 326) | async def autocomplete(
  class IdentityTransformer (line 355) | class IdentityTransformer(Transformer):
    method __init__ (line 356) | def __init__(self, type: AppCommandOptionType) -> None:
    method type (line 360) | def type(self) -> AppCommandOptionType:
    method transform (line 363) | async def transform(self, interaction: Interaction, value: Any, /) -> ...
  class RangeTransformer (line 367) | class RangeTransformer(IdentityTransformer):
    method __init__ (line 368) | def __init__(
    method min_value (line 383) | def min_value(self) -> Optional[Union[int, float]]:
    method max_value (line 387) | def max_value(self) -> Optional[Union[int, float]]:
  class LiteralTransformer (line 391) | class LiteralTransformer(IdentityTransformer):
    method __init__ (line 392) | def __init__(self, values: Tuple[Any, ...]) -> None:
    method choices (line 407) | def choices(self):
  class ChoiceTransformer (line 411) | class ChoiceTransformer(IdentityTransformer):
    method __init__ (line 414) | def __init__(self, inner_type: Any) -> None:
  class EnumValueTransformer (line 427) | class EnumValueTransformer(Transformer):
    method __init__ (line 428) | def __init__(self, enum: Any) -> None:
    method _error_display_name (line 450) | def _error_display_name(self) -> str:
    method type (line 454) | def type(self) -> AppCommandOptionType:
    method choices (line 458) | def choices(self):
    method transform (line 461) | async def transform(self, interaction: Interaction, value: Any, /) -> ...
  class EnumNameTransformer (line 465) | class EnumNameTransformer(Transformer):
    method __init__ (line 466) | def __init__(self, enum: Any) -> None:
    method _error_display_name (line 477) | def _error_display_name(self) -> str:
    method type (line 481) | def type(self) -> AppCommandOptionType:
    method choices (line 485) | def choices(self):
    method transform (line 488) | async def transform(self, interaction: Interaction, value: Any, /) -> ...
  class InlineTransformer (line 492) | class InlineTransformer(Transformer):
    method __init__ (line 493) | def __init__(self, annotation: Any) -> None:
    method _error_display_name (line 498) | def _error_display_name(self) -> str:
    method type (line 502) | def type(self) -> AppCommandOptionType:
    method transform (line 505) | async def transform(self, interaction: Interaction, value: Any, /) -> ...
  class Transform (line 514) | class Transform:
    method __class_getitem__ (line 528) | def __class_getitem__(cls, items) -> Transformer:
  class Range (line 546) | class Range:
    method __class_getitem__ (line 573) | def __class_getitem__(cls, obj) -> RangeTransformer:
  class MemberTransformer (line 614) | class MemberTransformer(Transformer):
    method type (line 616) | def type(self) -> AppCommandOptionType:
    method transform (line 619) | async def transform(self, interaction: Interaction, value: Any, /) -> ...
  class BaseChannelTransformer (line 625) | class BaseChannelTransformer(Transformer):
    method __init__ (line 626) | def __init__(self, *channel_types: Type[Any]) -> None:
    method _error_display_name (line 646) | def _error_display_name(self) -> str:
    method type (line 650) | def type(self) -> AppCommandOptionType:
    method channel_types (line 654) | def channel_types(self) -> List[ChannelType]:
    method transform (line 657) | async def transform(self, interaction: Interaction, value: Any, /):
  class RawChannelTransformer (line 664) | class RawChannelTransformer(BaseChannelTransformer):
    method transform (line 665) | async def transform(self, interaction: Interaction, value: Any, /):
  class UnionChannelTransformer (line 671) | class UnionChannelTransformer(BaseChannelTransformer):
    method transform (line 672) | async def transform(self, interaction: Interaction, value: Any, /):
  function get_supported_annotation (line 736) | def get_supported_annotation(
  function annotation_to_parameter (line 825) | def annotation_to_parameter(annotation: Any, parameter: inspect.Paramete...

FILE: discord/app_commands/translator.py
  class TranslationContextLocation (line 45) | class TranslationContextLocation(Enum):
  class TranslationContext (line 60) | class TranslationContext(Generic[_L, _D]):
    method __init__ (line 77) | def __init__(
    method __init__ (line 83) | def __init__(
    method __init__ (line 89) | def __init__(
    method __init__ (line 97) | def __init__(
    method __init__ (line 105) | def __init__(self, location: Literal[TranslationContextLocation.choice...
    method __init__ (line 109) | def __init__(self, location: Literal[TranslationContextLocation.other]...
    method __init__ (line 112) | def __init__(self, location: _L, data: _D) -> None:  # type: ignore # ...
  class Translator (line 149) | class Translator:
    method load (line 169) | async def load(self) -> None:
    method unload (line 180) | async def unload(self) -> None:
    method _checked_translate (line 192) | async def _checked_translate(
    method translate (line 202) | async def translate(self, string: locale_str, locale: Locale, context:...
  class locale_str (line 230) | class locale_str:
    method __init__ (line 284) | def __init__(self, message: str, /, **kwargs: Any) -> None:
    method message (line 289) | def message(self) -> str:
    method __str__ (line 292) | def __str__(self) -> str:
    method __repr__ (line 295) | def __repr__(self) -> str:
    method __eq__ (line 301) | def __eq__(self, obj: object) -> bool:
    method __hash__ (line 304) | def __hash__(self) -> int:

FILE: discord/app_commands/tree.py
  function _retrieve_guild_ids (line 85) | def _retrieve_guild_ids(
  class CommandTree (line 111) | class CommandTree(Generic[ClientT]):
    method __init__ (line 137) | def __init__(
    method fetch_command (line 164) | async def fetch_command(self, command_id: int, /, *, guild: Optional[S...
    method fetch_commands (line 203) | async def fetch_commands(self, *, guild: Optional[Snowflake] = None) -...
    method copy_global_to (line 243) | def copy_global_to(self, *, guild: Snowflake) -> None:
    method add_command (line 287) | def add_command(
    method remove_command (line 415) | def remove_command(
    method remove_command (line 426) | def remove_command(
    method remove_command (line 437) | def remove_command(
    method remove_command (line 447) | def remove_command(
    method clear_commands (line 493) | def clear_commands(self, *, guild: Optional[Snowflake], type: Optional...
    method get_command (line 535) | def get_command(
    method get_command (line 546) | def get_command(
    method get_command (line 557) | def get_command(
    method get_command (line 567) | def get_command(
    method get_commands (line 611) | def get_commands(
    method get_commands (line 620) | def get_commands(
    method get_commands (line 629) | def get_commands(
    method get_commands (line 638) | def get_commands(
    method get_commands (line 646) | def get_commands(
    method walk_commands (line 691) | def walk_commands(
    method walk_commands (line 700) | def walk_commands(
    method walk_commands (line 709) | def walk_commands(
    method walk_commands (line 717) | def walk_commands(
    method _get_all_commands (line 763) | def _get_all_commands(
    method _remove_with_module (line 782) | def _remove_with_module(self, name: str) -> None:
    method on_error (line 808) | async def on_error(self, interaction: Interaction[ClientT], error: App...
    method error (line 836) | def error(self, coro: ErrorFunc) -> ErrorFunc:
    method command (line 865) | def command(
    method context_menu (line 949) | def context_menu(
    method translator (line 1038) | def translator(self) -> Optional[Translator]:
    method set_translator (line 1045) | async def set_translator(self, translator: Optional[Translator]) -> None:
    method sync (line 1079) | async def sync(self, *, guild: Optional[Snowflake] = None) -> List[App...
    method _dispatch_error (line 1139) | async def _dispatch_error(self, interaction: Interaction[ClientT], err...
    method _from_interaction (line 1148) | def _from_interaction(self, interaction: Interaction[ClientT]) -> None:
    method _get_context_menu (line 1157) | def _get_context_menu(self, data: ApplicationCommandInteractionData) -...
    method _get_app_command_options (line 1166) | def _get_app_command_options(
    method _call_context_menu (line 1219) | async def _call_context_menu(
    method interaction_check (line 1260) | async def interaction_check(self, interaction: Interaction[ClientT], /...
    method _call (line 1271) | async def _call(self, interaction: Interaction[ClientT]) -> None:

FILE: discord/appinfo.py
  class AppInfo (line 55) | class AppInfo:
    method __init__ (line 180) | def __init__(self, state: ConnectionState, data: AppInfoPayload):
    method __repr__ (line 216) | def __repr__(self) -> str:
    method icon (line 224) | def icon(self) -> Optional[Asset]:
    method cover_image (line 231) | def cover_image(self) -> Optional[Asset]:
    method guild (line 241) | def guild(self) -> Optional[Guild]:
    method flags (line 250) | def flags(self) -> ApplicationFlags:
    method edit (line 257) | async def edit(
  class PartialAppInfo (line 390) | class PartialAppInfo:
    method __init__ (line 450) | def __init__(self, *, state: ConnectionState, data: PartialAppInfoPayl...
    method __repr__ (line 467) | def __repr__(self) -> str:
    method icon (line 471) | def icon(self) -> Optional[Asset]:
    method cover_image (line 478) | def cover_image(self) -> Optional[Asset]:
    method flags (line 490) | def flags(self) -> ApplicationFlags:
  class AppInstallParams (line 498) | class AppInstallParams:
    method __init__ (line 514) | def __init__(self, data: InstallParamsPayload) -> None:

FILE: discord/asset.py
  class AssetMixin (line 60) | class AssetMixin:
    method read (line 65) | async def read(self) -> bytes:
    method save (line 89) | async def save(self, fp: Union[str, bytes, os.PathLike[Any], io.Buffer...
    method to_file (line 129) | async def to_file(
  class Asset (line 177) | class Asset(AssetMixin):
    method __init__ (line 212) | def __init__(self, state: _State, *, url: str, key: str, animated: boo...
    method _from_default_avatar (line 219) | def _from_default_avatar(cls, state: _State, index: int) -> Self:
    method _from_avatar (line 228) | def _from_avatar(cls, state: _State, user_id: int, avatar: str) -> Self:
    method _from_guild_avatar (line 239) | def _from_guild_avatar(cls, state: _State, guild_id: int, member_id: i...
    method _from_guild_banner (line 250) | def _from_guild_banner(cls, state: _State, guild_id: int, member_id: i...
    method _from_avatar_decoration (line 261) | def _from_avatar_decoration(cls, state: _State, avatar_decoration: str...
    method _from_icon (line 270) | def _from_icon(cls, state: _State, object_id: int, icon_hash: str, pat...
    method _from_app_icon (line 279) | def _from_app_icon(
    method _from_cover_image (line 290) | def _from_cover_image(cls, state: _State, object_id: int, cover_image_...
    method _from_scheduled_event_cover_image (line 299) | def _from_scheduled_event_cover_image(cls, state: _State, scheduled_ev...
    method _from_guild_image (line 308) | def _from_guild_image(cls, state: _State, guild_id: int, image: str, p...
    method _from_guild_icon (line 319) | def _from_guild_icon(cls, state: _State, guild_id: int, icon_hash: str...
    method _from_sticker_banner (line 330) | def _from_sticker_banner(cls, state: _State, banner: int) -> Self:
    method _from_user_banner (line 339) | def _from_user_banner(cls, state: _State, user_id: int, banner_hash: s...
    method __str__ (line 349) | def __str__(self) -> str:
    method __len__ (line 352) | def __len__(self) -> int:
    method __repr__ (line 355) | def __repr__(self) -> str:
    method __eq__ (line 359) | def __eq__(self, other: object) -> bool:
    method __hash__ (line 362) | def __hash__(self) -> int:
    method url (line 366) | def url(self) -> str:
    method key (line 371) | def key(self) -> str:
    method is_animated (line 375) | def is_animated(self) -> bool:
    method replace (line 379) | def replace(
    method with_size (line 445) | def with_size(self, size: int, /) -> Self:
    method with_format (line 473) | def with_format(self, format: ValidAssetFormatTypes, /) -> Self:
    method with_static_format (line 508) | def with_static_format(self, format: ValidStaticFormatTypes, /) -> Self:

FILE: discord/audit_logs.py
  function _transform_timestamp (line 101) | def _transform_timestamp(entry: AuditLogEntry, data: Optional[str]) -> O...
  function _transform_color (line 105) | def _transform_color(entry: AuditLogEntry, data: int) -> Colour:
  function _transform_snowflake (line 109) | def _transform_snowflake(entry: AuditLogEntry, data: Snowflake) -> int:
  function _transform_channel (line 113) | def _transform_channel(entry: AuditLogEntry, data: Optional[Snowflake]) ...
  function _transform_channels_or_threads (line 119) | def _transform_channels_or_threads(
  function _transform_member_id (line 125) | def _transform_member_id(entry: AuditLogEntry, data: Optional[Snowflake]...
  function _transform_guild_id (line 131) | def _transform_guild_id(entry: AuditLogEntry, data: Optional[Snowflake])...
  function _transform_roles (line 137) | def _transform_roles(entry: AuditLogEntry, data: List[Snowflake]) -> Lis...
  function _transform_applied_forum_tags (line 141) | def _transform_applied_forum_tags(entry: AuditLogEntry, data: List[Snowf...
  function _transform_overloaded_flags (line 148) | def _transform_overloaded_flags(entry: AuditLogEntry, data: int) -> Unio...
  function _transform_forum_tags (line 166) | def _transform_forum_tags(entry: AuditLogEntry, data: List[ForumTagPaylo...
  function _transform_default_reaction (line 170) | def _transform_default_reaction(entry: AuditLogEntry, data: DefaultReact...
  function _transform_overwrites (line 179) | def _transform_overwrites(
  function _transform_icon (line 204) | def _transform_icon(entry: AuditLogEntry, data: Optional[str]) -> Option...
  function _transform_avatar (line 213) | def _transform_avatar(entry: AuditLogEntry, data: Optional[str]) -> Opti...
  function _transform_cover_image (line 219) | def _transform_cover_image(entry: AuditLogEntry, data: Optional[str]) ->...
  function _guild_hash_transformer (line 225) | def _guild_hash_transformer(path: str) -> Callable[[AuditLogEntry, Optio...
  function _transform_automod_actions (line 234) | def _transform_automod_actions(entry: AuditLogEntry, data: List[AutoMode...
  function _enum_transformer (line 241) | def _enum_transformer(enum: Type[E]) -> Callable[[AuditLogEntry, int], E]:
  function _flag_transformer (line 251) | def _flag_transformer(cls: Type[F]) -> Callable[[AuditLogEntry, Union[in...
  function _transform_type (line 258) | def _transform_type(
  class AuditLogDiff (line 271) | class AuditLogDiff:
    method __len__ (line 272) | def __len__(self) -> int:
    method __iter__ (line 275) | def __iter__(self) -> Generator[Tuple[str, Any], None, None]:
    method __repr__ (line 278) | def __repr__(self) -> str:
    method __getattr__ (line 284) | def __getattr__(self, item: str) -> Any:
    method __setattr__ (line 287) | def __setattr__(self, key: str, value: Any) -> Any:
  class AuditLogChanges (line 294) | class AuditLogChanges:
    method __init__ (line 347) | def __init__(self, entry: AuditLogEntry, data: List[AuditLogChangePayl...
    method __repr__ (line 435) | def __repr__(self) -> str:
    method _handle_role (line 438) | def _handle_role(self, first: AuditLogDiff, second: AuditLogDiff, entr...
    method _handle_app_command_permissions (line 457) | def _handle_app_command_permissions(
    method _handle_trigger_metadata (line 473) | def _handle_trigger_metadata(
    method _handle_trigger_attr_update (line 518) | def _handle_trigger_attr_update(
    method _create_trigger (line 529) | def _create_trigger(self, diff: AuditLogDiff, entry: AuditLogEntry) ->...
  class _AuditLogProxy (line 544) | class _AuditLogProxy:
    method __init__ (line 545) | def __init__(self, **kwargs: Any) -> None:
  class _AuditLogProxyMemberPrune (line 550) | class _AuditLogProxyMemberPrune(_AuditLogProxy):
  class _AuditLogProxyMemberMoveOrMessageDelete (line 555) | class _AuditLogProxyMemberMoveOrMessageDelete(_AuditLogProxy):
  class _AuditLogProxyMemberDisconnect (line 560) | class _AuditLogProxyMemberDisconnect(_AuditLogProxy):
  class _AuditLogProxyPinAction (line 564) | class _AuditLogProxyPinAction(_AuditLogProxy):
  class _AuditLogProxyStageInstanceAction (line 569) | class _AuditLogProxyStageInstanceAction(_AuditLogProxy):
  class _AuditLogProxyMessageBulkDelete (line 573) | class _AuditLogProxyMessageBulkDelete(_AuditLogProxy):
  class _AuditLogProxyAutoModAction (line 577) | class _AuditLogProxyAutoModAction(_AuditLogProxy):
  class _AuditLogProxyMemberKickOrMemberRoleUpdate (line 583) | class _AuditLogProxyMemberKickOrMemberRoleUpdate(_AuditLogProxy):
  class AuditLogEntry (line 587) | class AuditLogEntry(Hashable):
    method __init__ (line 636) | def __init__(
    method _from_data (line 656) | def _from_data(self, data: AuditLogEntryPayload) -> None:
    method _get_member (line 761) | def _get_member(self, user_id: Optional[int]) -> Union[Member, User, N...
    method _get_integration (line 767) | def _get_integration(self, integration_id: Optional[int]) -> Optional[...
    method _get_integration_by_app_id (line 773) | def _get_integration_by_app_id(self, application_id: Optional[int]) ->...
    method _get_app_command (line 780) | def _get_app_command(self, app_command_id: Optional[int]) -> Optional[...
    method __repr__ (line 786) | def __repr__(self) -> str:
    method created_at (line 790) | def created_at(self) -> datetime.datetime:
    method target (line 795) | def target(self) -> TargetType:
    method category (line 809) | def category(self) -> Optional[enums.AuditLogActionCategory]:
    method changes (line 814) | def changes(self) -> AuditLogChanges:
    method before (line 821) | def before(self) -> AuditLogDiff:
    method after (line 826) | def after(self) -> AuditLogDiff:
    method _convert_target_guild (line 830) | def _convert_target_guild(self, target_id: int) -> Guild:
    method _convert_target_channel (line 833) | def _convert_target_channel(self, target_id: int) -> Union[abc.GuildCh...
    method _convert_target_user (line 836) | def _convert_target_user(self, target_id: Optional[int]) -> Optional[U...
    method _convert_target_role (line 844) | def _convert_target_role(self, target_id: int) -> Union[Role, Object]:
    method _convert_target_invite (line 847) | def _convert_target_invite(self, target_id: None) -> Invite:
    method _convert_target_emoji (line 868) | def _convert_target_emoji(self, target_id: int) -> Union[Emoji, Object]:
    method _convert_target_message (line 871) | def _convert_target_message(self, target_id: int) -> Union[Member, Use...
    method _convert_target_stage_instance (line 874) | def _convert_target_stage_instance(self, target_id: int) -> Union[Stag...
    method _convert_target_sticker (line 877) | def _convert_target_sticker(self, target_id: int) -> Union[GuildSticke...
    method _convert_target_thread (line 880) | def _convert_target_thread(self, target_id: int) -> Union[Thread, Obje...
    method _convert_target_guild_scheduled_event (line 883) | def _convert_target_guild_scheduled_event(self, target_id: int) -> Uni...
    method _convert_target_integration (line 886) | def _convert_target_integration(self, target_id: int) -> Union[Partial...
    method _convert_target_app_command (line 889) | def _convert_target_app_command(self, target_id: int) -> Union[AppComm...
    method _convert_target_integration_or_app_command (line 899) | def _convert_target_integration_or_app_command(self, target_id: int) -...
    method _convert_target_auto_moderation (line 919) | def _convert_target_auto_moderation(self, target_id: int) -> Union[Aut...
    method _convert_target_webhook (line 922) | def _convert_target_webhook(self, target_id: int) -> Union[Webhook, Ob...

FILE: discord/automod.py
  class AutoModRuleAction (line 58) | class AutoModRuleAction:
    method __init__ (line 88) | def __init__(self, *, channel_id: int = ...) -> None:
    method __init__ (line 92) | def __init__(self, *, type: Literal[AutoModRuleActionType.send_alert_m...
    method __init__ (line 96) | def __init__(self, *, duration: datetime.timedelta = ...) -> None:
    method __init__ (line 100) | def __init__(self, *, type: Literal[AutoModRuleActionType.timeout], du...
    method __init__ (line 104) | def __init__(self, *, custom_message: str = ...) -> None:
    method __init__ (line 108) | def __init__(self, *, type: Literal[AutoModRuleActionType.block_messag...
    method __init__ (line 112) | def __init__(self, *, type: Literal[AutoModRuleActionType.block_messag...
    method __init__ (line 116) | def __init__(
    method __init__ (line 126) | def __init__(
    method __repr__ (line 164) | def __repr__(self) -> str:
    method from_data (line 168) | def from_data(cls, data: AutoModerationActionPayload) -> Self:
    method to_dict (line 181) | def to_dict(self) -> Dict[str, Any]:
  class AutoModTrigger (line 192) | class AutoModTrigger:
    method __init__ (line 257) | def __init__(
    method __repr__ (line 294) | def __repr__(self) -> str:
    method from_data (line 303) | def from_data(cls, type: int, data: Optional[AutoModerationTriggerMeta...
    method to_metadata_dict (line 327) | def to_metadata_dict(self) -> Optional[Dict[str, Any]]:
  class AutoModRule (line 343) | class AutoModRule:
    method __init__ (line 387) | def __init__(self, *, data: AutoModerationRulePayload, guild: Guild, s...
    method __repr__ (line 400) | def __repr__(self) -> str:
    method to_dict (line 403) | def to_dict(self) -> AutoModerationRulePayload:
    method creator (line 421) | def creator(self) -> Optional[Member]:
    method exempt_roles (line 426) | def exempt_roles(self) -> List[Role]:
    method exempt_channels (line 438) | def exempt_channels(self) -> List[Union[GuildChannel, Thread]]:
    method actions (line 444) | def actions(self) -> List[AutoModRuleAction]:
    method is_exempt (line 448) | def is_exempt(self, obj: Snowflake, /) -> bool:
    method edit (line 463) | async def edit(
    method delete (line 546) | async def delete(self, *, reason: str = MISSING) -> None:
  class AutoModAction (line 568) | class AutoModAction:
    method __init__ (line 617) | def __init__(self, *, data: AutoModerationActionExecutionPayload, stat...
    method __repr__ (line 631) | def __repr__(self) -> str:
    method guild (line 635) | def guild(self) -> Guild:
    method channel (line 640) | def channel(self) -> Optional[Union[GuildChannel, Thread]]:
    method member (line 647) | def member(self) -> Optional[Member]:
    method fetch_rule (line 651) | async def fetch_rule(self) -> AutoModRule:

FILE: discord/backoff.py
  class ExponentialBackoff (line 41) | class ExponentialBackoff(Generic[T]):
    method __init__ (line 63) | def __init__(self, base: int = 1, *, integral: T = False):
    method delay (line 78) | def delay(self: ExponentialBackoff[Literal[False]]) -> float:
    method delay (line 82) | def delay(self: ExponentialBackoff[Literal[True]]) -> int:
    method delay (line 86) | def delay(self: ExponentialBackoff[bool]) -> Union[int, float]:
    method delay (line 89) | def delay(self) -> Union[int, float]:

FILE: discord/channel.py
  class ThreadWithMessage (line 109) | class ThreadWithMessage(NamedTuple):
  class TextChannel (line 114) | class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Has...
    method __init__ (line 187) | def __init__(self, *, state: ConnectionState, guild: Guild, data: Unio...
    method __repr__ (line 193) | def __repr__(self) -> str:
    method _update (line 205) | def _update(self, guild: Guild, data: Union[TextChannelPayload, NewsCh...
    method _get_channel (line 220) | async def _get_channel(self) -> Self:
    method type (line 224) | def type(self) -> Literal[ChannelType.text, ChannelType.news]:
    method _sorting_bucket (line 231) | def _sorting_bucket(self) -> int:
    method _scheduled_event_entity_type (line 235) | def _scheduled_event_entity_type(self) -> Optional[EntityType]:
    method permissions_for (line 239) | def permissions_for(self, obj: Union[Member, Role], /) -> Permissions:
    method members (line 249) | def members(self) -> List[Member]:
    method threads (line 254) | def threads(self) -> List[Thread]:
    method is_nsfw (line 261) | def is_nsfw(self) -> bool:
    method is_news (line 265) | def is_news(self) -> bool:
    method last_message (line 270) | def last_message(self) -> Optional[Message]:
    method edit (line 291) | async def edit(self) -> Optional[TextChannel]:
    method edit (line 295) | async def edit(self, *, position: int, reason: Optional[str] = ...) ->...
    method edit (line 299) | async def edit(
    method edit (line 317) | async def edit(self, *, reason: Optional[str] = None, **options: Any) ...
    method clone (line 398) | async def clone(self, *, name: Optional[str] = None, reason: Optional[...
    method delete_messages (line 403) | async def delete_messages(self, messages: Iterable[Snowflake], *, reas...
    method purge (line 459) | async def purge(
    method webhooks (line 544) | async def webhooks(self) -> List[Webhook]:
    method create_webhook (line 567) | async def create_webhook(self, *, name: str, avatar: Optional[bytes] =...
    method follow (line 608) | async def follow(self, *, destination: TextChannel, reason: Optional[s...
    method get_partial_message (line 663) | def get_partial_message(self, message_id: int, /) -> PartialMessage:
    method get_thread (line 690) | def get_thread(self, thread_id: int, /) -> Optional[Thread]:
    method create_thread (line 712) | async def create_thread(
    method archived_threads (line 797) | async def archived_threads(
  class VocalGuildChannel (line 892) | class VocalGuildChannel(discord.abc.Messageable, discord.abc.Connectable...
    method __init__ (line 910) | def __init__(self, *, state: ConnectionState, guild: Guild, data: Unio...
    method _get_channel (line 915) | async def _get_channel(self) -> Self:
    method _get_voice_client_key (line 918) | def _get_voice_client_key(self) -> Tuple[int, str]:
    method _get_voice_state_pair (line 921) | def _get_voice_state_pair(self) -> Tuple[int, int]:
    method _update (line 924) | def _update(self, guild: Guild, data: Union[VoiceChannelPayload, Stage...
    method _sorting_bucket (line 939) | def _sorting_bucket(self) -> int:
    method is_nsfw (line 942) | def is_nsfw(self) -> bool:
    method members (line 950) | def members(self) -> List[Member]:
    method voice_states (line 961) | def voice_states(self) -> Dict[int, VoiceState]:
    method scheduled_events (line 985) | def scheduled_events(self) -> List[ScheduledEvent]:
    method permissions_for (line 993) | def permissions_for(self, obj: Union[Member, Role], /) -> Permissions:
    method last_message (line 1006) | def last_message(self) -> Optional[Message]:
    method get_partial_message (line 1028) | def get_partial_message(self, message_id: int, /) -> PartialMessage:
    method delete_messages (line 1051) | async def delete_messages(self, messages: Iterable[Snowflake], *, reas...
    method purge (line 1103) | async def purge(
    method webhooks (line 1187) | async def webhooks(self) -> List[Webhook]:
    method create_webhook (line 1212) | async def create_webhook(self, *, name: str, avatar: Optional[bytes] =...
  class VoiceChannel (line 1253) | class VoiceChannel(VocalGuildChannel):
    method __repr__ (line 1323) | def __repr__(self) -> str:
    method _scheduled_event_entity_type (line 1338) | def _scheduled_event_entity_type(self) -> Optional[EntityType]:
    method type (line 1342) | def type(self) -> Literal[ChannelType.voice]:
    method clone (line 1347) | async def clone(self, *, name: Optional[str] = None, reason: Optional[...
    method edit (line 1351) | async def edit(self) -> None:
    method edit (line 1355) | async def edit(self, *, position: int, reason: Optional[str] = ...) ->...
    method edit (line 1359) | async def edit(
    method edit (line 1378) | async def edit(self, *, reason: Optional[str] = None, **options: Any) ...
  class StageChannel (line 1460) | class StageChannel(VocalGuildChannel):
    method __repr__ (line 1529) | def __repr__(self) -> str:
    method _update (line 1544) | def _update(self, guild: Guild, data: StageChannelPayload) -> None:
    method _scheduled_event_entity_type (line 1549) | def _scheduled_event_entity_type(self) -> Optional[EntityType]:
    method requesting_to_speak (line 1553) | def requesting_to_speak(self) -> List[Member]:
    method speakers (line 1558) | def speakers(self) -> List[Member]:
    method listeners (line 1570) | def listeners(self) -> List[Member]:
    method moderators (line 1578) | def moderators(self) -> List[Member]:
    method type (line 1587) | def type(self) -> Literal[ChannelType.stage_voice]:
    method clone (line 1592) | async def clone(self, *, name: Optional[str] = None, reason: Optional[...
    method instance (line 1596) | def instance(self) -> Optional[StageInstance]:
    method create_instance (line 1603) | async def create_instance(
    method fetch_instance (line 1669) | async def fetch_instance(self) -> StageInstance:
    method edit (line 1692) | async def edit(self) -> None:
    method edit (line 1696) | async def edit(self, *, position: int, reason: Optional[str] = ...) ->...
    method edit (line 1700) | async def edit(
    method edit (line 1718) | async def edit(self, *, reason: Optional[str] = None, **options: Any) ...
  class CategoryChannel (line 1794) | class CategoryChannel(discord.abc.GuildChannel, Hashable):
    method __init__ (line 1838) | def __init__(self, *, state: ConnectionState, guild: Guild, data: Cate...
    method __repr__ (line 1843) | def __repr__(self) -> str:
    method _update (line 1846) | def _update(self, guild: Guild, data: CategoryChannelPayload) -> None:
    method _sorting_bucket (line 1855) | def _sorting_bucket(self) -> int:
    method _scheduled_event_entity_type (line 1859) | def _scheduled_event_entity_type(self) -> Optional[EntityType]:
    method type (line 1863) | def type(self) -> Literal[ChannelType.category]:
    method is_nsfw (line 1867) | def is_nsfw(self) -> bool:
    method clone (line 1872) | async def clone(self, *, name: Optional[str] = None, reason: Optional[...
    method edit (line 1876) | async def edit(self) -> None:
    method edit (line 1880) | async def edit(self, *, position: int, reason: Optional[str] = ...) ->...
    method edit (line 1884) | async def edit(
    method edit (line 1895) | async def edit(self, *, reason: Optional[str] = None, **options: Any) ...
    method move (line 1950) | async def move(self, **kwargs: Any) -> None:
    method channels (line 1955) | def channels(self) -> List[GuildChannelType]:
    method text_channels (line 1969) | def text_channels(self) -> List[TextChannel]:
    method voice_channels (line 1976) | def voice_channels(self) -> List[VoiceChannel]:
    method stage_channels (line 1983) | def stage_channels(self) -> List[StageChannel]:
    method forums (line 1993) | def forums(self) -> List[ForumChannel]:
    method create_text_channel (line 2002) | async def create_text_channel(self, name: str, **options: Any) -> Text...
    method create_voice_channel (line 2014) | async def create_voice_channel(self, name: str, **options: Any) -> Voi...
    method create_stage_channel (line 2026) | async def create_stage_channel(self, name: str, **options: Any) -> Sta...
    method create_forum (line 2040) | async def create_forum(self, name: str, **options: Any) -> ForumChannel:
  class ForumTag (line 2055) | class ForumTag(Hashable):
    method __init__ (line 2095) | def __init__(self, *, name: str, emoji: Optional[EmojiInputType] = Non...
    method from_data (line 2108) | def from_data(cls, *, state: ConnectionState, data: ForumTagPayload) -...
    method to_dict (line 2122) | def to_dict(self) -> Dict[str, Any]:
    method __repr__ (line 2137) | def __repr__(self) -> str:
    method __str__ (line 2140) | def __str__(self) -> str:
  class ForumChannel (line 2144) | class ForumChannel(discord.abc.GuildChannel, Hashable):
    method __init__ (line 2239) | def __init__(self, *, state: ConnectionState, guild: Guild, data: Unio...
    method __repr__ (line 2245) | def __repr__(self) -> str:
    method _update (line 2256) | def _update(self, guild: Guild, data: Union[ForumChannelPayload, Media...
    method type (line 2290) | def type(self) -> Literal[ChannelType.forum, ChannelType.media]:
    method _sorting_bucket (line 2297) | def _sorting_bucket(self) -> int:
    method _scheduled_event_entity_type (line 2301) | def _scheduled_event_entity_type(self) -> Optional[EntityType]:
    method permissions_for (line 2305) | def permissions_for(self, obj: Union[Member, Role], /) -> Permissions:
    method get_thread (line 2314) | def get_thread(self, thread_id: int, /) -> Optional[Thread]:
    method threads (line 2340) | def threads(self) -> List[Thread]:
    method flags (line 2345) | def flags(self) -> ChannelFlags:
    method available_tags (line 2353) | def available_tags(self) -> Sequence[ForumTag]:
    method get_tag (line 2360) | def get_tag(self, tag_id: int, /) -> Optional[ForumTag]:
    method is_nsfw (line 2377) | def is_nsfw(self) -> bool:
    method is_media (line 2381) | def is_media(self) -> bool:
    method clone (line 2389) | async def clone(self, *, name: Optional[str] = None, reason: Optional[...
    method edit (line 2395) | async def edit(self) -> None:
    method edit (line 2399) | async def edit(self, *, position: int, reason: Optional[str] = ...) ->...
    method edit (line 2403) | async def edit(
    method edit (line 2426) | async def edit(self, *, reason: Optional[str] = None, **options: Any) ...
    method create_tag (line 2566) | async def create_tag(
    method create_thread (line 2617) | async def create_thread(
    method webhooks (line 2766) | async def webhooks(self) -> List[Webhook]:
    method create_webhook (line 2789) | async def create_webhook(self, *, name: str, avatar: Optional[bytes] =...
    method archived_threads (line 2827) | async def archived_threads(
  class DMChannel (line 2895) | class DMChannel(discord.abc.Messageable, discord.abc.PrivateChannel, Has...
    method __init__ (line 2934) | def __init__(self, *, me: ClientUser, state: ConnectionState, data: DM...
    method _get_channel (line 2940) | async def _get_channel(self) -> Self:
    method __str__ (line 2943) | def __str__(self) -> str:
    method __repr__ (line 2948) | def __repr__(self) -> str:
    method _from_message (line 2952) | def _from_message(cls, state: ConnectionState, channel_id: int) -> Self:
    method recipient (line 2962) | def recipient(self) -> Optional[User]:
    method type (line 2968) | def type(self) -> Literal[ChannelType.private]:
    method guild (line 2973) | def guild(self) -> Optional[Guild]:
    method jump_url (line 2983) | def jump_url(self) -> str:
    method created_at (line 2991) | def created_at(self) -> datetime.datetime:
    method permissions_for (line 2995) | def permissions_for(self, obj: Any = None, /) -> Permissions:
    method get_partial_message (line 3032) | def get_partial_message(self, message_id: int, /) -> PartialMessage:
  class GroupChannel (line 3060) | class GroupChannel(discord.abc.Messageable, discord.abc.PrivateChannel, ...
    method __init__ (line 3101) | def __init__(self, *, me: ClientUser, state: ConnectionState, data: Gr...
    method _update_group (line 3107) | def _update_group(self, data: GroupChannelPayload) -> None:
    method _get_channel (line 3119) | async def _get_channel(self) -> Self:
    method __str__ (line 3122) | def __str__(self) -> str:
    method __repr__ (line 3131) | def __repr__(self) -> str:
    method type (line 3135) | def type(self) -> Literal[ChannelType.group]:
    method guild (line 3140) | def guild(self) -> Optional[Guild]:
    method icon (line 3150) | def icon(self) -> Optional[Asset]:
    method created_at (line 3157) | def created_at(self) -> datetime.datetime:
    method jump_url (line 3162) | def jump_url(self) -> str:
    method permissions_for (line 3169) | def permissions_for(self, obj: Snowflake, /) -> Permissions:
    method leave (line 3214) | async def leave(self) -> None:
  class PartialMessageable (line 3230) | class PartialMessageable(discord.abc.Messageable, Hashable):
    method __init__ (line 3264) | def __init__(self, state: ConnectionState, id: int, guild_id: Optional...
    method __repr__ (line 3270) | def __repr__(self) -> str:
    method _get_channel (line 3273) | async def _get_channel(self) -> PartialMessageable:
    method guild (line 3277) | def guild(self) -> Optional[Guild]:
    method jump_url (line 3282) | def jump_url(self) -> str:
    method created_at (line 3289) | def created_at(self) -> datetime.datetime:
    method permissions_for (line 3293) | def permissions_for(self, obj: Any = None, /) -> Permissions:
    method get_partial_message (line 3315) | def get_partial_message(self, message_id: int, /) -> PartialMessage:
  function _guild_channel_factory (line 3337) | def _guild_channel_factory(channel_type: int):
  function _channel_factory (line 3357) | def _channel_factory(channel_type: int):
  function _threaded_channel_factory (line 3367) | def _threaded_channel_factory(channel_type: int):
  function _threaded_guild_channel_factory (line 3374) | def _threaded_guild_channel_factory(channel_type: int):

FILE: discord/client.py
  class _LoopSentinel (line 136) | class _LoopSentinel:
    method __getattr__ (line 139) | def __getattr__(self, attr: str) -> None:
  class Client (line 151) | class Client:
    method __init__ (line 259) | def __init__(self, *, intents: Intents, **options: Any) -> None:
    method __aenter__ (line 302) | async def __aenter__(self) -> Self:
    method __aexit__ (line 306) | async def __aexit__(
    method _get_websocket (line 320) | def _get_websocket(self, guild_id: Optional[int] = None, *, shard_id: ...
    method _get_state (line 323) | def _get_state(self, **options: Any) -> ConnectionState[Self]:
    method _handle_ready (line 326) | def _handle_ready(self) -> None:
    method latency (line 330) | def latency(self) -> float:
    method is_ws_ratelimited (line 338) | def is_ws_ratelimited(self) -> bool:
    method user (line 351) | def user(self) -> Optional[ClientUser]:
    method guilds (line 356) | def guilds(self) -> Sequence[Guild]:
    method emojis (line 361) | def emojis(self) -> Sequence[Emoji]:
    method stickers (line 366) | def stickers(self) -> Sequence[GuildSticker]:
    method cached_messages (line 374) | def cached_messages(self) -> Sequence[Message]:
    method private_channels (line 382) | def private_channels(self) -> Sequence[PrivateChannel]:
    method voice_clients (line 393) | def voice_clients(self) -> List[VoiceProtocol]:
    method application_id (line 401) | def application_id(self) -> Optional[int]:
    method application_flags (line 414) | def application_flags(self) -> ApplicationFlags:
    method application (line 422) | def application(self) -> Optional[AppInfo]:
    method is_ready (line 437) | def is_ready(self) -> bool:
    method _run_event (line 441) | async def _run_event(
    method _schedule_event (line 458) | def _schedule_event(
    method dispatch (line 469) | def dispatch(self, event: str, /, *args: Any, **kwargs: Any) -> None:
    method on_error (line 509) | async def on_error(self, event_method: str, /, *args: Any, **kwargs: A...
    method _call_before_identify_hook (line 527) | async def _call_before_identify_hook(self, shard_id: Optional[int], *,...
    method before_identify_hook (line 533) | async def before_identify_hook(self, shard_id: Optional[int], *, initi...
    method _async_setup_hook (line 555) | async def _async_setup_hook(self) -> None:
    method setup_hook (line 564) | async def setup_hook(self) -> None:
    method login (line 588) | async def login(self, token: str) -> None:
    method connect (line 631) | async def connect(self, *, reconnect: bool = True) -> None:
    method close (line 729) | async def close(self) -> None:
    method clear (line 753) | def clear(self) -> None:
    method start (line 765) | async def start(self, token: str, *, reconnect: bool = True) -> None:
    method run (line 789) | def run(
    method is_closed (line 878) | def is_closed(self) -> bool:
    method activity (line 883) | def activity(self) -> Optional[ActivityTypes]:
    method activity (line 890) | def activity(self, value: Optional[ActivityTypes]) -> None:
    method status (line 900) | def status(self) -> Status:
    method status (line 911) | def status(self, value: Status) -> None:
    method allowed_mentions (line 920) | def allowed_mentions(self) -> Optional[AllowedMentions]:
    method allowed_mentions (line 928) | def allowed_mentions(self, value: Optional[AllowedMentions]) -> None:
    method intents (line 935) | def intents(self) -> Intents:
    method users (line 945) | def users(self) -> List[User]:
    method get_channel (line 949) | def get_channel(self, id: int, /) -> Optional[Union[GuildChannel, Thre...
    method get_partial_messageable (line 968) | def get_partial_messageable(
    method get_stage_instance (line 998) | def get_stage_instance(self, id: int, /) -> Optional[StageInstance]:
    method get_guild (line 1020) | def get_guild(self, id: int, /) -> Optional[Guild]:
    method get_user (line 1039) | def get_user(self, id: int, /) -> Optional[User]:
    method get_emoji (line 1058) | def get_emoji(self, id: int, /) -> Optional[Emoji]:
    method get_sticker (line 1077) | def get_sticker(self, id: int, /) -> Optional[GuildSticker]:
    method get_all_channels (line 1094) | def get_all_channels(self) -> Generator[GuildChannel, None, None]:
    method get_all_members (line 1118) | def get_all_members(self) -> Generator[Member, None, None]:
    method wait_until_ready (line 1137) | async def wait_until_ready(self) -> None:
    method wait_for (line 1157) | async def wait_for(
    method wait_for (line 1168) | async def wait_for(
    method wait_for (line 1181) | async def wait_for(
    method wait_for (line 1192) | async def wait_for(
    method wait_for (line 1205) | async def wait_for(
    method wait_for (line 1216) | async def wait_for(
    method wait_for (line 1227) | async def wait_for(
    method wait_for (line 1238) | async def wait_for(
    method wait_for (line 1249) | async def wait_for(
    method wait_for (line 1265) | async def wait_for(
    method wait_for (line 1276) | async def wait_for(
    method wait_for (line 1289) | async def wait_for(
    method wait_for (line 1300) | async def wait_for(
    method wait_for (line 1311) | async def wait_for(
    method wait_for (line 1322) | async def wait_for(
    method wait_for (line 1335) | async def wait_for(
    method wait_for (line 1351) | async def wait_for(
    method wait_for (line 1362) | async def wait_for(
    method wait_for (line 1373) | async def wait_for(
    method wait_for (line 1384) | async def wait_for(
    method wait_for (line 1395) | async def wait_for(
    method wait_for (line 1408) | async def wait_for(
    method wait_for (line 1419) | async def wait_for(
    method wait_for (line 1430) | async def wait_for(
    method wait_for (line 1441) | async def wait_for(
    method wait_for (line 1454) | async def wait_for(
    method wait_for (line 1467) | async def wait_for(
    method wait_for (line 1478) | async def wait_for(
    method wait_for (line 1489) | async def wait_for(
    method wait_for (line 1500) | async def wait_for(
    method wait_for (line 1511) | async def wait_for(
    method wait_for (line 1522) | async def wait_for(
    method wait_for (line 1535) | async def wait_for(
    method wait_for (line 1546) | async def wait_for(
    method wait_for (line 1557) | async def wait_for(
    method wait_for (line 1568) | async def wait_for(
    method wait_for (line 1579) | async def wait_for(
    method wait_for (line 1590) | async def wait_for(
    method wait_for (line 1603) | async def wait_for(
    method wait_for (line 1614) | async def wait_for(
    method wait_for (line 1625) | async def wait_for(
    method wait_for (line 1636) | async def wait_for(
    method wait_for (line 1647) | async def wait_for(
    method wait_for (line 1658) | async def wait_for(
    method wait_for (line 1671) | async def wait_for(
    method wait_for (line 1682) | async def wait_for(
    method wait_for (line 1695) | async def wait_for(
    method wait_for (line 1706) | async def wait_for(
    method wait_for (line 1719) | async def wait_for(
    method wait_for (line 1730) | async def wait_for(
    method wait_for (line 1742) | async def wait_for(
    method wait_for (line 1753) | async def wait_for(
    method wait_for (line 1764) | async def wait_for(
    method wait_for (line 1775) | async def wait_for(
    method wait_for (line 1786) | async def wait_for(
    method wait_for (line 1797) | async def wait_for(
    method wait_for (line 1810) | async def wait_for(
    method wait_for (line 1823) | async def wait_for(
    method wait_for (line 1834) | async def wait_for(
    method wait_for (line 1847) | async def wait_for(
    method wait_for (line 1858) | async def wait_for(
    method wait_for (line 1869) | async def wait_for(
    method wait_for (line 1879) | def wait_for(
    method event (line 1992) | def event(self, coro: CoroT, /) -> CoroT:
    method change_presence (line 2025) | async def change_presence(
    method fetch_guilds (line 2089) | async def fetch_guilds(
    method fetch_template (line 2219) | async def fetch_template(self, code: Union[Template, str]) -> Template:
    method fetch_guild (line 2245) | async def fetch_guild(self, guild_id: int, /, *, with_counts: bool = T...
    method create_guild (line 2290) | async def create_guild(
    method fetch_stage_instance (line 2346) | async def fetch_stage_instance(self, channel_id: int, /) -> StageInsta...
    method fetch_invite (line 2377) | async def fetch_invite(
    method delete_invite (line 2448) | async def delete_invite(self, invite: Union[Invite, str], /) -> None:
    method fetch_widget (line 2480) | async def fetch_widget(self, guild_id: int, /) -> Widget:
    method application_info (line 2514) | async def application_info(self) -> AppInfo:
    method fetch_user (line 2532) | async def fetch_user(self, user_id: int, /) -> User:
    method fetch_channel (line 2567) | async def fetch_channel(self, channel_id: int, /) -> Union[GuildChanne...
    method fetch_webhook (line 2616) | async def fetch_webhook(self, webhook_id: int, /) -> Webhook:
    method fetch_sticker (line 2642) | async def fetch_sticker(self, sticker_id: int, /) -> Union[StandardSti...
    method fetch_skus (line 2666) | async def fetch_skus(self) -> List[SKU]:
    method fetch_entitlement (line 2692) | async def fetch_entitlement(self, entitlement_id: int, /) -> Entitlement:
    method entitlements (line 2725) | async def entitlements(
    method create_entitlement (line 2866) | async def create_entitlement(
    method fetch_premium_sticker_packs (line 2902) | async def fetch_premium_sticker_packs(self) -> List[StickerPack]:
    method create_dm (line 2922) | async def create_dm(self, user: Snowflake) -> DMChannel:
    method add_dynamic_items (line 2950) | def add_dynamic_items(self, *items: Type[DynamicItem[Item[Any]]]) -> N...
    method remove_dynamic_items (line 2974) | def remove_dynamic_items(self, *items: Type[DynamicItem[Item[Any]]]) -...
    method add_view (line 2998) | def add_view(self, view: View, *, message_id: Optional[int] = None) ->...
    method persistent_views (line 3036) | def persistent_views(self) -> Sequence[View]:

FILE: discord/colour.py
  function parse_hex_number (line 43) | def parse_hex_number(argument: str) -> Colour:
  function parse_rgb_number (line 55) | def parse_rgb_number(number: str) -> int:
  function parse_rgb (line 68) | def parse_rgb(argument: str, *, regex: re.Pattern[str] = RGB_REGEX) -> C...
  class Colour (line 79) | class Colour:
    method __init__ (line 120) | def __init__(self, value: int):
    method _get_byte (line 126) | def _get_byte(self, byte: int) -> int:
    method __eq__ (line 129) | def __eq__(self, other: object) -> bool:
    method __ne__ (line 132) | def __ne__(self, other: object) -> bool:
    method __str__ (line 135) | def __str__(self) -> str:
    method __int__ (line 138) | def __int__(self) -> int:
    method __repr__ (line 141) | def __repr__(self) -> str:
    method __hash__ (line 144) | def __hash__(self) -> int:
    method r (line 148) | def r(self) -> int:
    method g (line 153) | def g(self) -> int:
    method b (line 158) | def b(self) -> int:
    method to_rgb (line 162) | def to_rgb(self) -> Tuple[int, int, int]:
    method from_rgb (line 167) | def from_rgb(cls, r: int, g: int, b: int) -> Self:
    method from_hsv (line 172) | def from_hsv(cls, h: float, s: float, v: float) -> Self:
    method from_str (line 178) | def from_str(cls, value: str) -> Colour:
    method default (line 219) | def default(cls) -> Self:
    method random (line 227) | def random(cls, *, seed: Optional[Union[int, str, float, bytes, bytear...
    method teal (line 248) | def teal(cls) -> Self:
    method dark_teal (line 256) | def dark_teal(cls) -> Self:
    method brand_green (line 264) | def brand_green(cls) -> Self:
    method green (line 275) | def green(cls) -> Self:
    method dark_green (line 283) | def dark_green(cls) -> Self:
    method blue (line 291) | def blue(cls) -> Self:
    method dark_blue (line 299) | def dark_blue(cls) -> Self:
    method purple (line 307) | def purple(cls) -> Self:
    method dark_purple (line 315) | def dark_purple(cls) -> Self:
    method magenta (line 323) | def magenta(cls) -> Self:
    method dark_magenta (line 331) | def dark_magenta(cls) -> Self:
    method gold (line 339) | def gold(cls) -> Self:
    method dark_gold (line 347) | def dark_gold(cls) -> Self:
    method orange (line 355) | def orange(cls) -> Self:
    method dark_orange (line 363) | def dark_orange(cls) -> Self:
    method brand_red (line 371) | def brand_red(cls) -> Self:
    method red (line 381) | def red(cls) -> Self:
    method dark_red (line 389) | def dark_red(cls) -> Self:
    method lighter_grey (line 397) | def lighter_grey(cls) -> Self:
    method dark_grey (line 407) | def dark_grey(cls) -> Self:
    method light_grey (line 417) | def light_grey(cls) -> Self:
    method darker_grey (line 427) | def darker_grey(cls) -> Self:
    method og_blurple (line 437) | def og_blurple(cls) -> Self:
    method blurple (line 445) | def blurple(cls) -> Self:
    method greyple (line 453) | def greyple(cls) -> Self:
    method dark_theme (line 461) | def dark_theme(cls) -> Self:
    method fuchsia (line 476) | def fuchsia(cls) -> Self:
    method yellow (line 486) | def yellow(cls) -> Self:
    method dark_embed (line 496) | def dark_embed(cls) -> Self:
    method light_embed (line 506) | def light_embed(cls) -> Self:
    method pink (line 516) | def pink(cls) -> Self:

FILE: discord/components.py
  class Component (line 62) | class Component:
    method __repr__ (line 81) | def __repr__(self) -> str:
    method type (line 86) | def type(self) -> ComponentType:
    method _raw_construct (line 91) | def _raw_construct(cls, **kwargs) -> Self:
    method to_dict (line 102) | def to_dict(self) -> ComponentPayload:
  class ActionRow (line 106) | class ActionRow(Component):
    method __init__ (line 125) | def __init__(self, data: ActionRowPayload, /) -> None:
    method type (line 135) | def type(self) -> Literal[ComponentType.action_row]:
    method to_dict (line 139) | def to_dict(self) -> ActionRowPayload:
  class Button (line 146) | class Button(Component):
    method __init__ (line 191) | def __init__(self, data: ButtonComponentPayload, /) -> None:
    method type (line 209) | def type(self) -> Literal[ComponentType.button]:
    method to_dict (line 213) | def to_dict(self) -> ButtonComponentPayload:
  class SelectMenu (line 238) | class SelectMenu(Component):
    method __init__ (line 287) | def __init__(self, data: SelectMenuPayload, /) -> None:
    method to_dict (line 300) | def to_dict(self) -> SelectMenuPayload:
  class SelectOption (line 320) | class SelectOption:
    method __init__ (line 366) | def __init__(
    method __repr__ (line 382) | def __repr__(self) -> str:
    method __str__ (line 388) | def __str__(self) -> str:
    method emoji (line 399) | def emoji(self) -> Optional[PartialEmoji]:
    method emoji (line 404) | def emoji(self, value: Optional[Union[str, Emoji, PartialEmoji]]) -> N...
    method from_dict (line 416) | def from_dict(cls, data: SelectOptionPayload) -> SelectOption:
    method to_dict (line 430) | def to_dict(self) -> SelectOptionPayload:
  class TextInput (line 446) | class TextInput(Component):
    method __init__ (line 488) | def __init__(self, data: TextInputPayload, /) -> None:
    method type (line 499) | def type(self) -> Literal[ComponentType.text_input]:
    method to_dict (line 503) | def to_dict(self) -> TextInputPayload:
    method default (line 527) | def default(self) -> Optional[str]:
  class SelectDefaultValue (line 535) | class SelectDefaultValue:
    method __init__ (line 550) | def __init__(
    method type (line 560) | def type(self) -> SelectDefaultValueType:
    method type (line 565) | def type(self, value: SelectDefaultValueType) -> None:
    method __repr__ (line 571) | def __repr__(self) -> str:
    method from_dict (line 575) | def from_dict(cls, data: SelectDefaultValuesPayload) -> SelectDefaultV...
    method to_dict (line 581) | def to_dict(self) -> SelectDefaultValuesPayload:
    method from_channel (line 588) | def from_channel(cls, channel: Snowflake, /) -> Self:
    method from_role (line 607) | def from_role(cls, role: Snowflake, /) -> Self:
    method from_user (line 626) | def from_user(cls, user: Snowflake, /) -> Self:
  function _component_factory (line 646) | def _component_factory(data: ActionRowChildComponentPayload) -> Optional...
  function _component_factory (line 651) | def _component_factory(data: ComponentPayload) -> Optional[Union[ActionR...
  function _component_factory (line 655) | def _component_factory(data: ComponentPayload) -> Optional[Union[ActionR...

FILE: discord/context_managers.py
  function _typing_done_callback (line 44) | def _typing_done_callback(fut: asyncio.Future) -> None:
  class Typing (line 52) | class Typing:
    method __init__ (line 53) | def __init__(self, messageable: Messageable) -> None:
    method _get_channel (line 58) | async def _get_channel(self) -> MessageableChannel:
    method wrapped_typer (line 65) | async def wrapped_typer(self) -> None:
    method __await__ (line 69) | def __await__(self) -> Generator[None, None, None]:
    method do_typing (line 72) | async def do_typing(self) -> None:
    method __aenter__ (line 80) | async def __aenter__(self) -> None:
    method __aexit__ (line 86) | async def __aexit__(

FILE: discord/embeds.py
  class EmbedProxy (line 40) | class EmbedProxy:
    method __init__ (line 41) | def __init__(self, layer: Dict[str, Any]):
    method __len__ (line 44) | def __len__(self) -> int:
    method __repr__ (line 47) | def __repr__(self) -> str:
    method __getattr__ (line 51) | def __getattr__(self, attr: str) -> None:
    method __eq__ (line 54) | def __eq__(self, other: object) -> bool:
  class _EmbedFooterProxy (line 65) | class _EmbedFooterProxy(Protocol):
  class _EmbedFieldProxy (line 69) | class _EmbedFieldProxy(Protocol):
  class _EmbedMediaProxy (line 74) | class _EmbedMediaProxy(Protocol):
  class _EmbedVideoProxy (line 80) | class _EmbedVideoProxy(Protocol):
  class _EmbedProviderProxy (line 85) | class _EmbedProviderProxy(Protocol):
  class _EmbedAuthorProxy (line 89) | class _EmbedAuthorProxy(Protocol):
  class Embed (line 96) | class Embed:
    method __init__ (line 167) | def __init__(
    method from_dict (line 198) | def from_dict(cls, data: Mapping[str, Any]) -> Self:
    method copy (line 250) | def copy(self) -> Self:
    method __len__ (line 254) | def __len__(self) -> int:
    method __bool__ (line 275) | def __bool__(self) -> bool:
    method __eq__ (line 293) | def __eq__(self, other: Embed) -> bool:
    method colour (line 311) | def colour(self) -> Optional[Colour]:
    method colour (line 315) | def colour(self, value: Optional[Union[int, Colour]]) -> None:
    method timestamp (line 328) | def timestamp(self) -> Optional[datetime.datetime]:
    method timestamp (line 332) | def timestamp(self, value: Optional[datetime.datetime]) -> None:
    method footer (line 343) | def footer(self) -> _EmbedFooterProxy:
    method set_footer (line 353) | def set_footer(self, *, text: Optional[Any] = None, icon_url: Optional...
    method remove_footer (line 377) | def remove_footer(self) -> Self:
    method image (line 393) | def image(self) -> _EmbedMediaProxy:
    method set_image (line 408) | def set_image(self, *, url: Optional[Any]) -> Self:
    method thumbnail (line 434) | def thumbnail(self) -> _EmbedMediaProxy:
    method set_thumbnail (line 449) | def set_thumbnail(self, *, url: Optional[Any]) -> Self:
    method video (line 478) | def video(self) -> _EmbedVideoProxy:
    method provider (line 493) | def provider(self) -> _EmbedProviderProxy:
    method author (line 504) | def author(self) -> _EmbedAuthorProxy:
    method set_author (line 514) | def set_author(self, *, name: Any, url: Optional[Any] = None, icon_url...
    method remove_author (line 543) | def remove_author(self) -> Self:
    method fields (line 559) | def fields(self) -> List[_EmbedFieldProxy]:
    method add_field (line 569) | def add_field(self, *, name: Any, value: Any, inline: bool = True) -> ...
    method insert_field_at (line 598) | def insert_field_at(self, index: int, *, name: Any, value: Any, inline...
    method clear_fields (line 631) | def clear_fields(self) -> Self:
    method remove_field (line 647) | def remove_field(self, index: int) -> Self:
    method set_field_at (line 676) | def set_field_at(self, index: int, *, name: Any, value: Any, inline: b...
    method to_dict (line 711) | def to_dict(self) -> EmbedData:

FILE: discord/emoji.py
  class Emoji (line 48) | class Emoji(_EmojiTag, AssetMixin):
    method __init__ (line 111) | def __init__(self, *, guild: Guild, state: ConnectionState, data: Emoj...
    method _from_data (line 116) | def _from_data(self, emoji: EmojiPayload) -> None:
    method _to_partial (line 127) | def _to_partial(self) -> PartialEmoji:
    method __iter__ (line 130) | def __iter__(self) -> Iterator[Tuple[str, Any]]:
    method __str__ (line 137) | def __str__(self) -> str:
    method __repr__ (line 142) | def __repr__(self) -> str:
    method __eq__ (line 145) | def __eq__(self, other: object) -> bool:
    method __ne__ (line 148) | def __ne__(self, other: object) -> bool:
    method __hash__ (line 151) | def __hash__(self) -> int:
    method created_at (line 155) | def created_at(self) -> datetime:
    method url (line 160) | def url(self) -> str:
    method roles (line 166) | def roles(self) -> List[Role]:
    method guild (line 178) | def guild(self) -> Optional[Guild]:
    method is_usable (line 182) | def is_usable(self) -> bool:
    method delete (line 194) | async def delete(self, *, reason: Optional[str] = None) -> None:
    method edit (line 216) | async def edit(

FILE: discord/enums.py
  function _create_value_cls (line 80) | def _create_value_cls(name: str, comparable: bool):
  function _is_descriptor (line 94) | def _is_descriptor(obj):
  class EnumMeta (line 98) | class EnumMeta(type):
    method __new__ (line 105) | def __new__(
    method __iter__ (line 150) | def __iter__(cls) -> Iterator[Any]:
    method __reversed__ (line 153) | def __reversed__(cls) -> Iterator[Any]:
    method __len__ (line 156) | def __len__(cls) -> int:
    method __repr__ (line 159) | def __repr__(cls) -> str:
    method __members__ (line 163) | def __members__(cls) -> Mapping[str, Any]:
    method __call__ (line 166) | def __call__(cls, value: str) -> Any:
    method __getitem__ (line 172) | def __getitem__(cls, key: str) -> Any:
    method __setattr__ (line 175) | def __setattr__(cls, name: str, value: Any) -> None:
    method __delattr__ (line 178) | def __delattr__(cls, attr: str) -> None:
    method __instancecheck__ (line 181) | def __instancecheck__(self, instance: Any) -> bool:
  class Enum (line 194) | class Enum(metaclass=EnumMeta):
    method try_value (line 196) | def try_value(cls, value):
  class ChannelType (line 203) | class ChannelType(Enum):
    method __str__ (line 217) | def __str__(self) -> str:
  class MessageType (line 221) | class MessageType(Enum):
  class SpeakingState (line 261) | class SpeakingState(Enum):
    method __str__ (line 267) | def __str__(self) -> str:
    method __int__ (line 270) | def __int__(self) -> int:
  class VerificationLevel (line 274) | class VerificationLevel(Enum, comparable=True):
    method __str__ (line 281) | def __str__(self) -> str:
  class ContentFilter (line 285) | class ContentFilter(Enum, comparable=True):
    method __str__ (line 290) | def __str__(self) -> str:
  class Status (line 294) | class Status(Enum):
    method __str__ (line 302) | def __str__(self) -> str:
  class DefaultAvatar (line 306) | class DefaultAvatar(Enum):
    method __str__ (line 315) | def __str__(self) -> str:
  class NotificationLevel (line 319) | class NotificationLevel(Enum, comparable=True):
  class AuditLogActionCategory (line 324) | class AuditLogActionCategory(Enum):
  class AuditLogAction (line 330) | class AuditLogAction(Enum):
    method category (line 391) | def category(self) -> Optional[AuditLogActionCategory]:
    method target_type (line 455) | def target_type(self) -> Optional[str]:
  class UserFlags (line 497) | class UserFlags(Enum):
  class ActivityType (line 520) | class ActivityType(Enum):
    method __int__ (line 529) | def __int__(self) -> int:
  class TeamMembershipState (line 533) | class TeamMembershipState(Enum):
  class TeamMemberRole (line 538) | class TeamMemberRole(Enum):
  class WebhookType (line 544) | class WebhookType(Enum):
  class ExpireBehaviour (line 550) | class ExpireBehaviour(Enum):
  class StickerType (line 558) | class StickerType(Enum):
  class StickerFormatType (line 563) | class StickerFormatType(Enum):
    method file_extension (line 570) | def file_extension(self) -> str:
  class InviteTarget (line 582) | class InviteTarget(Enum):
  class InteractionType (line 588) | class InteractionType(Enum):
  class InteractionResponseType (line 596) | class InteractionResponseType(Enum):
  class VideoQualityMode (line 609) | class VideoQualityMode(Enum):
    method __int__ (line 613) | def __int__(self) -> int:
  class ComponentType (line 617) | class ComponentType(Enum):
    method __int__ (line 628) | def __int__(self) -> int:
  class ButtonStyle (line 632) | class ButtonStyle(Enum):
    method __int__ (line 648) | def __int__(self) -> int:
  class TextStyle (line 652) | class TextStyle(Enum):
    method __int__ (line 659) | def __int__(self) -> int:
  class PrivacyLevel (line 663) | class PrivacyLevel(Enum):
  class NSFWLevel (line 667) | class NSFWLevel(Enum, comparable=True):
  class MFALevel (line 674) | class MFALevel(Enum, comparable=True):
  class Locale (line 679) | class Locale(Enum):
    method __str__ (line 713) | def __str__(self) -> str:
  class EntityType (line 720) | class EntityType(Enum):
  class EventStatus (line 726) | class EventStatus(Enum):
  class AppCommandOptionType (line 736) | class AppCommandOptionType(Enum):
  class AppCommandType (line 750) | class AppCommandType(Enum):
  class AppCommandPermissionType (line 756) | class AppCommandPermissionType(Enum):
  class AutoModRuleTriggerType (line 762) | class AutoModRuleTriggerType(Enum):
  class AutoModRuleEventType (line 771) | class AutoModRuleEventType(Enum):
  class AutoModRuleActionType (line 776) | class AutoModRuleActionType(Enum):
  class ForumLayoutType (line 783) | class ForumLayoutType(Enum):
  class ForumOrderType (line 789) | class ForumOrderType(Enum):
  class SelectDefaultValueType (line 794) | class SelectDefaultValueType(Enum):
  class SKUType (line 800) | class SKUType(Enum):
  class EntitlementType (line 807) | class EntitlementType(Enum):
  class EntitlementOwnerType (line 818) | class EntitlementOwnerType(Enum):
  class PollLayoutType (line 823) | class PollLayoutType(Enum):
  class InviteType (line 827) | class InviteType(Enum):
  class ReactionType (line 833) | class ReactionType(Enum):
  function create_unknown_value (line 838) | def create_unknown_value(cls: Type[E], val: Any) -> E:
  function try_enum (line 844) | def try_enum(cls: Type[E], val: Any) -> E:

FILE: discord/errors.py
  class DiscordException (line 53) | class DiscordException(Exception):
  class ClientException (line 62) | class ClientException(DiscordException):
  class GatewayNotFound (line 71) | class GatewayNotFound(DiscordException):
    method __init__ (line 74) | def __init__(self):
  function _flatten_error_dict (line 79) | def _flatten_error_dict(d: Dict[str, Any], key: str = '') -> Dict[str, s...
  class HTTPException (line 97) | class HTTPException(DiscordException):
    method __init__ (line 115) | def __init__(self, response: _ResponseType, message: Optional[Union[st...
  class RateLimited (line 142) | class RateLimited(DiscordException):
    method __init__ (line 161) | def __init__(self, retry_after: float):
  class Forbidden (line 166) | class Forbidden(HTTPException):
  class NotFound (line 175) | class NotFound(HTTPException):
  class DiscordServerError (line 184) | class DiscordServerError(HTTPException):
  class InvalidData (line 195) | class InvalidData(ClientException):
  class LoginFailure (line 203) | class LoginFailure(ClientException):
  class ConnectionClosed (line 212) | class ConnectionClosed(ClientException):
    method __init__ (line 226) | def __init__(self, socket: ClientWebSocketResponse, *, shard_id: Optio...
  class PrivilegedIntentsRequired (line 236) | class PrivilegedIntentsRequired(ClientException):
    method __init__ (line 253) | def __init__(self, shard_id: Optional[int]):
  class InteractionResponded (line 264) | class InteractionResponded(ClientException):
    method __init__ (line 278) | def __init__(self, interaction: Interaction):

FILE: discord/ext/commands/_types.py
  class Check (line 62) | class Check(Protocol[ContextT_co]):  # type: ignore # TypeVar is expecte...
    method __call__ (line 66) | def __call__(self, coro_or_commands: T) -> T:
  class _BaseCommand (line 72) | class _BaseCommand:

FILE: discord/ext/commands/bot.py
  function when_mentioned (line 102) | def when_mentioned(bot: _Bot, msg: Message, /) -> List[str]:
  function when_mentioned_or (line 115) | def when_mentioned_or(*prefixes: str) -> Callable[[_Bot, Message], List[...
  class _DefaultRepr (line 153) | class _DefaultRepr:
    method __repr__ (line 154) | def __repr__(self):
  class BotBase (line 161) | class BotBase(GroupMixin[None]):
    method __init__ (line 162) | def __init__(
    method _async_setup_hook (line 209) | async def _async_setup_hook(self) -> None:
    method dispatch (line 226) | def dispatch(self, event_name: str, /, *args: Any, **kwargs: Any) -> N...
    method close (line 234) | async def close(self) -> None:
    method add_command (line 252) | def add_command(self, command: Command[Any, ..., Any], /) -> None:
    method remove_command (line 263) | def remove_command(self, name: str, /) -> Optional[Command[Any, ..., A...
    method hybrid_command (line 279) | def hybrid_command(
    method hybrid_group (line 303) | def hybrid_group(
    method on_command_error (line 329) | async def on_command_error(self, context: Context[BotT], exception: er...
    method check (line 359) | def check(self, func: T, /) -> T:
    method add_check (line 391) | def add_check(self, func: UserCheck[ContextT], /, *, call_once: bool =...
    method remove_check (line 417) | def remove_check(self, func: UserCheck[ContextT], /, *, call_once: boo...
    method check_once (line 442) | def check_once(self, func: CFT, /) -> CFT:
    method can_run (line 484) | async def can_run(self, ctx: Context[BotT], /, *, call_once: bool = Fa...
    method is_owner (line 492) | async def is_owner(self, user: User, /) -> bool:
    method before_invoke (line 543) | def before_invoke(self, coro: CFT, /) -> CFT:
    method after_invoke (line 579) | def after_invoke(self, coro: CFT, /) -> CFT:
    method add_listener (line 618) | def add_listener(self, func: CoroFunc, /, name: str = MISSING) -> None:
    method remove_listener (line 654) | def remove_listener(self, func: CoroFunc, /, name: str = MISSING) -> N...
    method listen (line 678) | def listen(self, name: str = MISSING) -> Callable[[CFT], CFT]:
    method add_cog (line 716) | async def add_cog(
    method get_cog (line 802) | def get_cog(self, name: str, /) -> Optional[Cog]:
    method remove_cog (line 825) | async def remove_cog(
    method cogs (line 895) | def cogs(self) -> Mapping[str, Cog]:
    method _remove_module_references (line 901) | async def _remove_module_references(self, name: str) -> None:
    method _call_module_finalizers (line 928) | async def _call_module_finalizers(self, lib: types.ModuleType, key: st...
    method _load_from_module_spec (line 946) | async def _load_from_module_spec(self, spec: importlib.machinery.Modul...
    method _resolve_name (line 972) | def _resolve_name(self, name: str, package: Optional[str]) -> str:
    method load_extension (line 978) | async def load_extension(self, name: str, *, package: Optional[str] = ...
    method unload_extension (line 1031) | async def unload_extension(self, name: str, *, package: Optional[str] ...
    method reload_extension (line 1078) | async def reload_extension(self, name: str, *, package: Optional[str] ...
    method extensions (line 1146) | def extensions(self) -> Mapping[str, types.ModuleType]:
    method help_command (line 1153) | def help_command(self) -> Optional[HelpCommand]:
    method help_command (line 1157) | def help_command(self, value: Optional[HelpCommand]) -> None:
    method tree (line 1177) | def tree(self) -> app_commands.CommandTree[Self]:  # type: ignore
    method get_prefix (line 1187) | async def get_prefix(self, message: Message, /) -> Union[List[str], str]:
    method get_context (line 1231) | async def get_context(
    method get_context (line 1239) | async def get_context(
    method get_context (line 1248) | async def get_context(
    method invoke (line 1347) | async def invoke(self, ctx: Context[BotT], /) -> None:
    method process_commands (line 1377) | async def process_commands(self, message: Message, /) -> None:
    method on_message (line 1410) | async def on_message(self, message: Message, /) -> None:
  class Bot (line 1414) | class Bot(BotBase, discord.Client):
  class AutoShardedBot (line 1517) | class AutoShardedBot(BotBase, discord.AutoShardedClient):

FILE: discord/ext/commands/cog.py
  class CogMeta (line 72) | class CogMeta(type):
    method __new__ (line 172) | def __new__(cls, *args: Any, **kwargs: Any) -> CogMeta:
    method __init__ (line 257) | def __init__(self, *args: Any, **kwargs: Any) -> None:
    method qualified_name (line 261) | def qualified_name(cls) -> str:
  function _cog_special_method (line 265) | def _cog_special_method(func: FuncT) -> FuncT:
  class Cog (line 270) | class Cog(metaclass=CogMeta):
    method __new__ (line 295) | def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    method get_commands (line 406) | def get_commands(self) -> List[Command[Self, ..., Any]]:
    method get_app_commands (line 420) | def get_app_commands(self) -> List[Union[app_commands.Command[Self, .....
    method qualified_name (line 432) | def qualified_name(self) -> str:
    method description (line 437) | def description(self) -> str:
    method description (line 442) | def description(self, description: str) -> None:
    method walk_commands (line 445) | def walk_commands(self) -> Generator[Command[Self, ..., Any], None, No...
    method walk_app_commands (line 461) | def walk_app_commands(self) -> Generator[Union[app_commands.Command[Se...
    method app_command (line 475) | def app_command(self) -> Optional[app_commands.Group]:
    method get_listeners (line 482) | def get_listeners(self) -> List[Tuple[str, Callable[..., Any]]]:
    method _get_overridden_method (line 493) | def _get_overridden_method(cls, method: FuncT) -> Optional[FuncT]:
    method listener (line 498) | def listener(cls, name: str = MISSING) -> Callable[[FuncT], FuncT]:
    method has_error_handler (line 539) | def has_error_handler(self) -> bool:
    method has_app_command_error_handler (line 546) | def has_app_command_error_handler(self) -> bool:
    method cog_load (line 554) | async def cog_load(self) -> None:
    method cog_unload (line 568) | async def cog_unload(self) -> None:
    method bot_check_once (line 584) | def bot_check_once(self, ctx: Context[BotT]) -> bool:
    method bot_check (line 594) | def bot_check(self, ctx: Context[BotT]) -> bool:
    method cog_check (line 604) | def cog_check(self, ctx: Context[BotT]) -> bool:
    method interaction_check (line 614) | def interaction_check(self, interaction: discord.Interaction[ClientT],...
    method cog_command_error (line 626) | async def cog_command_error(self, ctx: Context[BotT], error: Exception...
    method cog_app_command_error (line 647) | async def cog_app_command_error(self, interaction: discord.Interaction...
    method cog_before_invoke (line 668) | async def cog_before_invoke(self, ctx: Context[BotT]) -> None:
    method cog_after_invoke (line 685) | async def cog_after_invoke(self, ctx: Context[BotT]) -> None:
    method _inject (line 701) | async def _inject(self, bot: BotBase, override: bool, guild: Optional[...
    method _eject (line 749) | async def _eject(self, bot: BotBase, guild_ids: Optional[Iterable[int]...
  class GroupCog (line 781) | class GroupCog(Cog):

FILE: discord/ext/commands/context.py
  function is_cog (line 81) | def is_cog(obj: Any) -> TypeGuard[Cog]:
  class DeferTyping (line 85) | class DeferTyping:
    method __init__ (line 86) | def __init__(self, ctx: Context[BotT], *, ephemeral: bool):
    method __await__ (line 90) | def __await__(self) -> Generator[Any, None, None]:
    method __aenter__ (line 93) | async def __aenter__(self) -> None:
    method __aexit__ (line 96) | async def __aexit__(
  class Context (line 105) | class Context(discord.abc.Messageable, Generic[BotT]):
    method __init__ (line 177) | def __init__(
    method from_interaction (line 214) | async def from_interaction(cls, interaction: Interaction[BotT], /) -> ...
    method invoke (line 302) | async def invoke(self, command: Command[CogT, P, T], /, *args: P.args,...
    method reinvoke (line 339) | async def reinvoke(self, *, call_hooks: bool = False, restart: bool = ...
    method valid (line 402) | def valid(self) -> bool:
    method _get_channel (line 406) | async def _get_channel(self) -> discord.abc.Messageable:
    method clean_prefix (line 410) | def clean_prefix(self) -> str:
    method cog (line 427) | def cog(self) -> Optional[Cog]:
    method filesize_limit (line 435) | def filesize_limit(self) -> int:
    method guild (line 443) | def guild(self) -> Optional[Guild]:
    method channel (line 448) | def channel(self) -> MessageableChannel:
    method author (line 455) | def author(self) -> Union[User, Member]:
    method me (line 462) | def me(self) -> Union[Member, ClientUser]:
    method permissions (line 470) | def permissions(self) -> Permissions:
    method bot_permissions (line 496) | def bot_permissions(self) -> Permissions:
    method voice_client (line 540) | def voice_client(self) -> Optional[VoiceProtocol]:
    method send_help (line 545) | async def send_help(self, *args: Any) -> Any:
    method reply (line 628) | async def reply(
    method reply (line 650) | async def reply(
    method reply (line 672) | async def reply(
    method reply (line 694) | async def reply(
    method reply (line 715) | async def reply(self, content: Optional[str] = None, **kwargs: Any) ->...
    method typing (line 750) | def typing(self, *, ephemeral: bool = False) -> Union[Typing, DeferTyp...
    method defer (line 790) | async def defer(self, *, ephemeral: bool = False) -> None:
    method send (line 817) | async def send(
    method send (line 839) | async def send(
    method send (line 861) | async def send(
    method send (line 883) | async def send(
    method send (line 904) | async def send(

FILE: discord/ext/commands/converter.py
  function _get_from_guilds (line 92) | def _get_from_guilds(bot: _Bot, getter: str, argument: Any) -> Any:
  class Converter (line 109) | class Converter(Protocol[T_co]):
    method convert (line 120) | async def convert(self, ctx: Context[BotT], argument: str) -> T_co:
  class IDConverter (line 153) | class IDConverter(Converter[T_co]):
    method _get_id_match (line 155) | def _get_id_match(argument):
  class ObjectConverter (line 159) | class ObjectConverter(IDConverter[discord.Object]):
    method convert (line 172) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class MemberConverter (line 183) | class MemberConverter(IDConverter[discord.Member]):
    method query_member_named (line 211) | async def query_member_named(self, guild: discord.Guild, argument: str...
    method query_member_by_id (line 229) | async def query_member_by_id(self, bot: _Bot, guild: discord.Guild, us...
    method convert (line 250) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class UserConverter (line 285) | class UserConverter(IDConverter[discord.User]):
    method convert (line 311) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class PartialMessageConverter (line 345) | class PartialMessageConverter(Converter[discord.PartialMessage]):
    method _get_id_matches (line 358) | def _get_id_matches(ctx: Context[BotT], argument: str) -> Tuple[Option...
    method _resolve_channel (line 381) | def _resolve_channel(
    method convert (line 396) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class MessageConverter (line 404) | class MessageConverter(IDConverter[discord.Message]):
    method convert (line 419) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class GuildChannelConverter (line 435) | class GuildChannelConverter(IDConverter[discord.abc.GuildChannel]):
    method convert (line 454) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
    method _parse_from_url (line 458) | def _parse_from_url(argument: str) -> Optional[re.Match[str]]:
    method _resolve_channel (line 467) | def _resolve_channel(ctx: Context[BotT], argument: str, attribute: str...
    method _resolve_thread (line 503) | def _resolve_thread(ctx: Context[BotT], argument: str, attribute: str,...
  class TextChannelConverter (line 528) | class TextChannelConverter(IDConverter[discord.TextChannel]):
    method convert (line 548) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class VoiceChannelConverter (line 552) | class VoiceChannelConverter(IDConverter[discord.VoiceChannel]):
    method convert (line 572) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class StageChannelConverter (line 576) | class StageChannelConverter(IDConverter[discord.StageChannel]):
    method convert (line 595) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class CategoryChannelConverter (line 599) | class CategoryChannelConverter(IDConverter[discord.CategoryChannel]):
    method convert (line 619) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class ThreadConverter (line 623) | class ThreadConverter(IDConverter[discord.Thread]):
    method convert (line 641) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class ForumChannelConverter (line 645) | class ForumChannelConverter(IDConverter[discord.ForumChannel]):
    method convert (line 664) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class ColourConverter (line 668) | class ColourConverter(Converter[discord.Colour]):
    method convert (line 694) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class RoleConverter (line 708) | class RoleConverter(IDConverter[discord.Role]):
    method convert (line 724) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class GameConverter (line 740) | class GameConverter(Converter[discord.Game]):
    method convert (line 743) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class InviteConverter (line 747) | class InviteConverter(Converter[discord.Invite]):
    method convert (line 756) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class GuildConverter (line 764) | class GuildConverter(IDConverter[discord.Guild]):
    method convert (line 775) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class EmojiConverter (line 791) | class EmojiConverter(IDConverter[discord.Emoji]):
    method convert (line 807) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class PartialEmojiConverter (line 832) | class PartialEmojiConverter(Converter[discord.PartialEmoji]):
    method convert (line 841) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class GuildStickerConverter (line 856) | class GuildStickerConverter(IDConverter[discord.GuildSticker]):
    method convert (line 870) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class ScheduledEventConverter (line 895) | class ScheduledEventConverter(IDConverter[discord.ScheduledEvent]):
    method convert (line 910) | async def convert(self, ctx: Context[BotT], argument: str) -> discord....
  class clean_content (line 954) | class clean_content(Converter[str]):
    method __init__ (line 974) | def __init__(
    method convert (line 987) | async def convert(self, ctx: Context[BotT], argument: str) -> str:
  class Greedy (line 1043) | class Greedy(List[T]):
    method __init__ (line 1073) | def __init__(self, *, converter: T) -> None:
    method __repr__ (line 1076) | def __repr__(self) -> str:
    method __class_getitem__ (line 1080) | def __class_getitem__(cls, params: Union[Tuple[T], T]) -> Greedy[T]:
    method constructed_converter (line 1105) | def constructed_converter(self) -> Any:
  class Range (line 1120) | class Range:
    method __init__ (line 1153) | def __init__(
    method convert (line 1167) | async def convert(self, ctx: Context[BotT], value: str) -> Union[int, ...
    method __call__ (line 1183) | def __call__(self) -> None:
    method __or__ (line 1187) | def __or__(self, rhs) -> Any:
    method __repr__ (line 1190) | def __repr__(self) -> str:
    method __class_getitem__ (line 1193) | def __class_getitem__(cls, obj) -> Range:
  function _convert_to_bool (line 1227) | def _convert_to_bool(argument: str) -> bool:
  function is_generic_type (line 1240) | def is_generic_type(tp: Any, *, _GenericAlias: type = _GenericAlias) -> ...
  function _actual_conversion (line 1269) | async def _actual_conversion(ctx: Context[BotT], converter: Any, argumen...
  function run_converters (line 1308) | async def run_converters(
  function run_converters (line 1315) | async def run_converters(ctx: Context[BotT], converter: Any, argument: s...
  function run_converters (line 1319) | async def run_converters(ctx: Context[BotT], converter: Any, argument: s...

FILE: discord/ext/commands/cooldowns.py
  class BucketType (line 55) | class BucketType(Enum):
    method get_key (line 64) | def get_key(self, msg: Union[Message, Context[Any]]) -> Any:
    method __call__ (line 82) | def __call__(self, msg: Union[Message, Context[Any]]) -> Any:
  class CooldownMapping (line 86) | class CooldownMapping(Generic[T_contra]):
    method __init__ (line 87) | def __init__(
    method copy (line 99) | def copy(self) -> CooldownMapping[T_contra]:
    method valid (line 105) | def valid(self) -> bool:
    method type (line 109) | def type(self) -> Callable[[T_contra], Any]:
    method from_cooldown (line 113) | def from_cooldown(cls, rate: float, per: float, type: Callable[[T_cont...
    method _bucket_key (line 116) | def _bucket_key(self, msg: T_contra) -> Any:
    method _verify_cache_integrity (line 119) | def _verify_cache_integrity(self, current: Optional[float] = None) -> ...
    method create_bucket (line 128) | def create_bucket(self, message: T_contra) -> Cooldown:
    method get_bucket (line 131) | def get_bucket(self, message: T_contra, current: Optional[float] = Non...
    method update_rate_limit (line 146) | def update_rate_limit(self, message: T_contra, current: Optional[float...
  class DynamicCooldownMapping (line 153) | class DynamicCooldownMapping(CooldownMapping[T_contra]):
    method __init__ (line 154) | def __init__(
    method copy (line 162) | def copy(self) -> DynamicCooldownMapping[T_contra]:
    method valid (line 168) | def valid(self) -> bool:
    method create_bucket (line 171) | def create_bucket(self, message: T_contra) -> Optional[Cooldown]:
  class _Semaphore (line 175) | class _Semaphore:
    method __init__ (line 190) | def __init__(self, number: int) -> None:
    method __repr__ (line 195) | def __repr__(self) -> str:
    method locked (line 198) | def locked(self) -> bool:
    method is_active (line 201) | def is_active(self) -> bool:
    method wake_up (line 204) | def wake_up(self) -> None:
    method acquire (line 211) | async def acquire(self, *, wait: bool = False) -> bool:
    method release (line 230) | def release(self) -> None:
  class MaxConcurrency (line 235) | class MaxConcurrency:
    method __init__ (line 238) | def __init__(self, number: int, *, per: BucketType, wait: bool) -> None:
    method copy (line 250) | def copy(self) -> Self:
    method __repr__ (line 253) | def __repr__(self) -> str:
    method get_key (line 256) | def get_key(self, message: Union[Message, Context[Any]]) -> Any:
    method acquire (line 259) | async def acquire(self, message: Union[Message, Context[Any]]) -> None:
    method release (line 271) | async def release(self, message: Union[Message, Context[Any]]) -> None:

FILE: discord/ext/commands/core.py
  function unwrap_function (line 106) | def unwrap_function(function: Callable[..., Any], /) -> Callable[..., Any]:
  function get_signature_parameters (line 117) | def get_signature_parameters(
  function _fold_text (line 174) | def _fold_text(input: str) -> str:
  function extract_descriptions_from_docstring (line 185) | def extract_descriptions_from_docstring(function: Callable[..., Any], pa...
  function wrap_callback (line 213) | def wrap_callback(coro: Callable[P, Coro[T]], /) -> Callable[P, Coro[Opt...
  function hooked_wrapped_callback (line 229) | def hooked_wrapped_callback(
  class _CaseInsensitiveDict (line 255) | class _CaseInsensitiveDict(dict):
    method __contains__ (line 256) | def __contains__(self, k):
    method __delitem__ (line 259) | def __delitem__(self, k):
    method __getitem__ (line 262) | def __getitem__(self, k):
    method get (line 265) | def get(self, k, default=None):
    method pop (line 268) | def pop(self, k, default=None):
    method __setitem__ (line 271) | def __setitem__(self, k, v):
  class _AttachmentIterator (line 275) | class _AttachmentIterator:
    method __init__ (line 276) | def __init__(self, data: List[discord.Attachment]):
    method __iter__ (line 280) | def __iter__(self) -> Self:
    method __next__ (line 283) | def __next__(self) -> discord.Attachment:
    method is_empty (line 292) | def is_empty(self) -> bool:
  class Command (line 296) | class Command(_BaseCommand, Generic[CogT, P, T]):
    method __new__ (line 373) | def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    method __init__ (line 389) | def __init__(
    method cog (line 483) | def cog(self) -> CogT:
    method cog (line 487) | def cog(self, value: CogT) -> None:
    method callback (line 491) | def callback(
    method callback (line 497) | def callback(
    method add_check (line 515) | def add_check(self, func: UserCheck[Context[Any]], /) -> None:
    method remove_check (line 536) | def remove_check(self, func: UserCheck[Context[Any]], /) -> None:
    method update (line 559) | def update(self, **kwargs: Any) -> None:
    method __call__ (line 570) | async def __call__(self, context: Context[BotT], /, *args: P.args, **k...
    method _ensure_assignment_on_copy (line 592) | def _ensure_assignment_on_copy(self, other: Self) -> Self:
    method copy (line 609) | def copy(self) -> Self:
    method _update_copy (line 620) | def _update_copy(self, kwargs: Dict[str, Any]) -> Self:
    method dispatch_error (line 629) | async def dispatch_error(self, ctx: Context[BotT], error: CommandError...
    method transform (line 652) | async def transform(self, ctx: Context[BotT], param: Parameter, attach...
    method _transform_greedy_pos (line 717) | async def _transform_greedy_pos(self, ctx: Context[BotT], param: Param...
    method _transform_greedy_var_pos (line 738) | async def _transform_greedy_var_pos(self, ctx: Context[BotT], param: P...
    method clean_params (line 751) | def clean_params(self) -> Dict[str, Parameter]:
    method cooldown (line 760) | def cooldown(self) -> Optional[Cooldown]:
    method full_parent_name (line 769) | def full_parent_name(self) -> str:
    method parents (line 785) | def parents(self) -> List[Group[Any, ..., Any]]:
    method root_parent (line 803) | def root_parent(self) -> Optional[Group[Any, ..., Any]]:
    method qualified_name (line 815) | def qualified_name(self) -> str:
    method __str__ (line 829) | def __str__(self) -> str:
    method _parse_arguments (line 832) | async def _parse_arguments(self, ctx: Context[BotT]) -> None:
    method call_before_hooks (line 868) | async def call_before_hooks(self, ctx: Context[BotT], /) -> None:
    method call_after_hooks (line 893) | async def call_after_hooks(self, ctx: Context[BotT], /) -> None:
    method _prepare_cooldowns (line 912) | def _prepare_cooldowns(self, ctx: Context[BotT]) -> None:
    method prepare (line 922) | async def prepare(self, ctx: Context[BotT], /) -> None:
    method is_on_cooldown (line 946) | def is_on_cooldown(self, ctx: Context[BotT], /) -> bool:
    method reset_cooldown (line 973) | def reset_cooldown(self, ctx: Context[BotT], /) -> None:
    method get_cooldown_retry_after (line 990) | def get_cooldown_retry_after(self, ctx: Context[BotT], /) -> float:
    method invoke (line 1020) | async def invoke(self, ctx: Context[BotT], /) -> None:
    method reinvoke (line 1031) | async def reinvoke(self, ctx: Context[BotT], /, *, call_hooks: bool = ...
    method error (line 1048) | def error(self, coro: Error[CogT, ContextT], /) -> Error[CogT, ContextT]:
    method has_error_handler (line 1076) | def has_error_handler(self) -> bool:
    method before_invoke (line 1083) | def before_invoke(self, coro: Hook[CogT, ContextT], /) -> Hook[CogT, C...
    method after_invoke (line 1114) | def after_invoke(self, coro: Hook[CogT, ContextT], /) -> Hook[CogT, Co...
    method cog_name (line 1146) | def cog_name(self) -> Optional[str]:
    method short_doc (line 1151) | def short_doc(self) -> str:
    method _is_typing_optional (line 1164) | def _is_typing_optional(self, annotation: Union[T, Optional[T]]) -> bool:
    method signature (line 1168) | def signature(self) -> str:
    method can_run (line 1234) | async def can_run(self, ctx: Context[BotT], /) -> bool:
  class GroupMixin (line 1293) | class GroupMixin(Generic[CogT]):
    method __init__ (line 1306) | def __init__(self, *args: Any, **kwargs: Any) -> None:
    method commands (line 1313) | def commands(self) -> Set[Command[CogT, ..., Any]]:
    method recursively_remove_all_commands (line 1317) | def recursively_remove_all_commands(self) -> None:
    method add_command (line 1323) | def add_command(self, command: Command[CogT, ..., Any], /) -> None:
    method remove_command (line 1365) | def remove_command(self, name: str, /) -> Optional[Command[CogT, ..., ...
    method walk_commands (line 1406) | def walk_commands(self) -> Generator[Command[CogT, ..., Any], None, No...
    method get_command (line 1422) | def get_command(self, name: str, /) -> Optional[Command[CogT, ..., Any]]:
    method command (line 1467) | def command(
    method command (line 1484) | def command(
    method command (line 1501) | def command(
    method group (line 1527) | def group(
    method group (line 1544) | def group(
    method group (line 1561) | def group(
  class Group (line 1586) | class Group(GroupMixin[CogT], Command[CogT, P, T]):
    method __init__ (line 1609) | def __init__(self, *args: Any, **attrs: Any) -> None:
    method copy (line 1613) | def copy(self) -> Self:
    method invoke (line 1626) | async def invoke(self, ctx: Context[BotT], /) -> None:
    method reinvoke (line 1657) | async def reinvoke(self, ctx: Context[BotT], /, *, call_hooks: bool = ...
  class _CommandDecorator (line 1703) | class _CommandDecorator:
    method __call__ (line 1705) | def __call__(self, func: Callable[Concatenate[CogT, ContextT, P], Coro...
    method __call__ (line 1709) | def __call__(self, func: Callable[Concatenate[ContextT, P], Coro[T]], ...
    method __call__ (line 1712) | def __call__(self, func: Callable[..., Coro[T]], /) -> Any:
  class _GroupDecorator (line 1715) | class _GroupDecorator:
    method __call__ (line 1717) | def __call__(self, func: Callable[Concatenate[CogT, ContextT, P], Coro...
    method __call__ (line 1721) | def __call__(self, func: Callable[Concatenate[ContextT, P], Coro[T]], ...
    method __call__ (line 1724) | def __call__(self, func: Callable[..., Coro[T]], /) -> Any:
  function command (line 1729) | def command(
  function command (line 1737) | def command(
  function command (line 1753) | def command(
  function group (line 1799) | def group(
  function group (line 1807) | def group(
  function group (line 1823) | def group(
  function check (line 1842) | def check(predicate: UserCheck[ContextT], /) -> Check[ContextT]:
  function check_any (line 1941) | def check_any(*checks: Check[ContextT]) -> Check[ContextT]:
  function has_role (line 2010) | def has_role(item: Union[int, str], /) -> Check[Any]:
  function has_any_role (line 2057) | def has_any_role(*items: Union[int, str]) -> Callable[[T], T]:
  function bot_has_role (line 2106) | def bot_has_role(item: int, /) -> Callable[[T], T]:
  function bot_has_any_role (line 2139) | def bot_has_any_role(*items: int) -> Callable[[T], T]:
  function has_permissions (line 2168) | def has_permissions(**perms: bool) -> Check[Any]:
  function bot_has_permissions (line 2215) | def bot_has_permissions(**perms: bool) -> Check[Any]:
  function has_guild_permissions (line 2240) | def has_guild_permissions(**perms: bool) -> Check[Any]:
  function bot_has_guild_permissions (line 2269) | def bot_has_guild_permissions(**perms: bool) -> Check[Any]:
  function dm_only (line 2295) | def dm_only() -> Check[Any]:
  function guild_only (line 2314) | def guild_only() -> Check[Any]:
  function is_owner (line 2365) | def is_owner() -> Check[Any]:
  function is_nsfw (line 2383) | def is_nsfw() -> Check[Any]:
  function cooldown (line 2440) | def cooldown(
  function dynamic_cooldown (line 2485) | def dynamic_cooldown(
  function max_concurrency (line 2533) | def max_concurrency(number: int, per: BucketType = BucketType.default, *...
  function before_invoke (line 2568) | def before_invoke(coro: Hook[CogT, ContextT], /) -> Callable[[T], T]:
  function after_invoke (line 2620) | def after_invoke(coro: Hook[CogT, ContextT], /) -> Callable[[T], T]:

FILE: discord/ext/commands/errors.py
  class CommandError (line 111) | class CommandError(DiscordException):
    method __init__ (line 121) | def __init__(self, message: Optional[str] = None, *args: Any) -> None:
  class ConversionError (line 130) | class ConversionError(CommandError):
    method __init__ (line 144) | def __init__(self, converter: Converter[Any], original: Exception) -> ...
  class UserInputError (line 149) | class UserInputError(CommandError):
  class CommandNotFound (line 159) | class CommandNotFound(CommandError):
  class MissingRequiredArgument (line 172) | class MissingRequiredArgument(UserInputError):
    method __init__ (line 184) | def __init__(self, param: Parameter) -> None:
  class MissingRequiredAttachment (line 189) | class MissingRequiredAttachment(UserInputError):
    method __init__ (line 203) | def __init__(self, param: Parameter) -> None:
  class TooManyArguments (line 208) | class TooManyArguments(UserInputError):
  class BadArgument (line 218) | class BadArgument(UserInputError):
  class CheckFailure (line 228) | class CheckFailure(CommandError):
  class CheckAnyFailure (line 237) | class CheckAnyFailure(CheckFailure):
    method __init__ (line 252) | def __init__(self, checks: List[Callable[[Context[BotT]], bool]], erro...
  class PrivateMessageOnly (line 258) | class PrivateMessageOnly(CheckFailure):
    method __init__ (line 265) | def __init__(self, message: Optional[str] = None) -> None:
  class NoPrivateMessage (line 269) | class NoPrivateMessage(CheckFailure):
    method __init__ (line 276) | def __init__(self, message: Optional[str] = None) -> None:
  class NotOwner (line 280) | class NotOwner(CheckFailure):
  class ObjectNotFound (line 289) | class ObjectNotFound(BadArgument):
    method __init__ (line 303) | def __init__(self, argument: str) -> None:
  class MemberNotFound (line 308) | class MemberNotFound(BadArgument):
    method __init__ (line 322) | def __init__(self, argument: str) -> None:
  class GuildNotFound (line 327) | class GuildNotFound(BadArgument):
    method __init__ (line 340) | def __init__(self, argument: str) -> None:
  class UserNotFound (line 345) | class UserNotFound(BadArgument):
    method __init__ (line 359) | def __init__(self, argument: str) -> None:
  class MessageNotFound (line 364) | class MessageNotFound(BadArgument):
    method __init__ (line 377) | def __init__(self, argument: str) -> None:
  class ChannelNotReadable (line 382) | class ChannelNotReadable(BadArgument):
    method __init__ (line 396) | def __init__(self, argument: Union[GuildChannel, Thread]) -> None:
  class ChannelNotFound (line 401) | class ChannelNotFound(BadArgument):
    method __init__ (line 414) | def __init__(self, argument: Union[int, str]) -> None:
  class ThreadNotFound (line 419) | class ThreadNotFound(BadArgument):
    method __init__ (line 432) | def __init__(self, argument: str) -> None:
  class BadColourArgument (line 437) | class BadColourArgument(BadArgument):
    method __init__ (line 450) | def __init__(self, argument: str) -> None:
  class RoleNotFound (line 458) | class RoleNotFound(BadArgument):
    method __init__ (line 471) | def __init__(self, argument: str) -> None:
  class BadInviteArgument (line 476) | class BadInviteArgument(BadArgument):
    method __init__ (line 489) | def __init__(self, argument: str) -> None:
  class EmojiNotFound (line 494) | class EmojiNotFound(BadArgument):
    method __init__ (line 507) | def __init__(self, argument: str) -> None:
  class PartialEmojiConversionFailure (line 512) | class PartialEmojiConversionFailure(BadArgument):
    method __init__ (line 526) | def __init__(self, argument: str) -> None:
  class GuildStickerNotFound (line 531) | class GuildStickerNotFound(BadArgument):
    method __init__ (line 544) | def __init__(self, argument: str) -> None:
  class ScheduledEventNotFound (line 549) | class ScheduledEventNotFound(BadArgument):
    method __init__ (line 562) | def __init__(self, argument: str) -> None:
  class BadBoolArgument (line 567) | class BadBoolArgument(BadArgument):
    method __init__ (line 580) | def __init__(self, argument: str) -> None:
  class RangeError (line 585) | class RangeError(BadArgument):
    method __init__ (line 602) | def __init__(
  class DisabledCommand (line 631) | class DisabledCommand(CommandError):
  class CommandInvokeError (line 640) | class CommandInvokeError(CommandError):
    method __init__ (line 652) | def __init__(self, e: Exception) -> None:
  class CommandOnCooldown (line 657) | class CommandOnCooldown(CommandError):
    method __init__ (line 673) | def __init__(self, cooldown: Cooldown, retry_after: float, type: Bucke...
  class MaxConcurrencyReached (line 680) | class MaxConcurrencyReached(CommandError):
    method __init__ (line 693) | def __init__(self, number: int, per: BucketType) -> None:
  class MissingRole (line 703) | class MissingRole(CheckFailure):
    method __init__ (line 717) | def __init__(self, missing_role: Snowflake) -> None:
  class BotMissingRole (line 723) | class BotMissingRole(CheckFailure):
    method __init__ (line 737) | def __init__(self, missing_role: Snowflake) -> None:
  class MissingAnyRole (line 743) | class MissingAnyRole(CheckFailure):
    method __init__ (line 758) | def __init__(self, missing_roles: SnowflakeList) -> None:
  class BotMissingAnyRole (line 767) | class BotMissingAnyRole(CheckFailure):
    method __init__ (line 783) | def __init__(self, missing_roles: SnowflakeList) -> None:
  class NSFWChannelRequired (line 792) | class NSFWChannelRequired(CheckFailure):
    method __init__ (line 805) | def __init__(self, channel: Union[GuildChannel, Thread]) -> None:
  class MissingPermissions (line 810) | class MissingPermissions(CheckFailure):
    method __init__ (line 822) | def __init__(self, missing_permissions: List[str], *args: Any) -> None:
  class BotMissingPermissions (line 831) | class BotMissingPermissions(CheckFailure):
    method __init__ (line 843) | def __init__(self, missing_permissions: List[str], *args: Any) -> None:
  class BadUnionArgument (line 852) | class BadUnionArgument(UserInputError):
    method __init__ (line 868) | def __init__(self, param: Parameter, converters: Tuple[type, ...], err...
  class BadLiteralArgument (line 886) | class BadLiteralArgument(UserInputError):
    method __init__ (line 908) | def __init__(self, param: Parameter, literals: Tuple[Any, ...], errors...
  class ArgumentParsingError (line 919) | class ArgumentParsingError(UserInputError):
  class UnexpectedQuoteError (line 931) | class UnexpectedQuoteError(ArgumentParsingError):
    method __init__ (line 942) | def __init__(self, quote: str) -> None:
  class InvalidEndOfQuotedStringError (line 947) | class InvalidEndOfQuotedStringError(ArgumentParsingError):
    method __init__ (line 959) | def __init__(self, char: str) -> None:
  class ExpectedClosingQuoteError (line 964) | class ExpectedClosingQuoteError(ArgumentParsingError):
    method __init__ (line 975) | def __init__(self, close_quote: str) -> None:
  class ExtensionError (line 980) | class ExtensionError(DiscordException):
    method __init__ (line 991) | def __init__(self, message: Optional[str] = None, *args: Any, name: st...
  class ExtensionAlreadyLoaded (line 999) | class ExtensionAlreadyLoaded(ExtensionError):
    method __init__ (line 1005) | def __init__(self, name: str) -> None:
  class ExtensionNotLoaded (line 1009) | class ExtensionNotLoaded(ExtensionError):
    method __init__ (line 1015) | def __init__(self, name: str) -> None:
  class NoEntryPointError (line 1019) | class NoEntryPointError(ExtensionError):
    method __init__ (line 1025) | def __init__(self, name: str) -> None:
  class ExtensionFailed (line 1029) | class ExtensionFailed(ExtensionError):
    method __init__ (line 1043) | def __init__(self, name: str, original: Exception) -> None:
  class ExtensionNotFound (line 1049) | class ExtensionNotFound(ExtensionError):
    method __init__ (line 1063) | def __init__(self, name: str) -> None:
  class CommandRegistrationError (line 1068) | class CommandRegistrationError(ClientException):
    method __init__ (line 1084) | def __init__(self, name: str, *, alias_conflict: bool = False) -> None:
  class FlagError (line 1091) | class FlagError(BadArgument):
  class TooManyFlags (line 1102) | class TooManyFlags(FlagError):
    method __init__ (line 1117) | def __init__(self, flag: Flag, values: List[str]) -> None:
  class BadFlagArgument (line 1123) | class BadFlagArgument(FlagError):
    method __init__ (line 1141) | def __init__(self, flag: Flag, argument: str, original: Exception) -> ...
  class MissingRequiredFlag (line 1154) | class MissingRequiredFlag(FlagError):
    method __init__ (line 1167) | def __init__(self, flag: Flag) -> None:
  class MissingFlagArgument (line 1172) | class MissingFlagArgument(FlagError):
    method __init__ (line 1185) | def __init__(self, flag: Flag) -> None:
  class HybridCommandError (line 1190) | class HybridCommandError(CommandError):
    method __init__ (line 1204) | def __init__(self, original: AppCommandError) -> None:

FILE: discord/ext/commands/flags.py
  class Flag (line 55) | class Flag:
    method required (line 100) | def required(self) -> bool:
  function flag (line 108) | def flag(
  function is_flag (line 162) | def is_flag(obj: Any) -> TypeGuard[Type[FlagConverter]]:
  function validate_flag_name (line 166) | def validate_flag_name(name: str, forbidden: Set[str]) -> None:
  function get_flags (line 179) | def get_flags(namespace: Dict[str, Any], globals: Dict[str, Any], locals...
  class FlagsMeta (line 281) | class FlagsMeta(type):
    method __new__ (line 292) | def __new__(
  function tuple_convert_all (line 378) | async def tuple_convert_all(ctx: Context[BotT], argument: str, flag: Fla...
  function tuple_convert_flag (line 401) | async def tuple_convert_flag(ctx: Context[BotT], argument: str, flag: Fl...
  function convert_flag (line 427) | async def convert_flag(ctx: Context[BotT], argument: str, flag: Flag, an...
  class FlagConverter (line 458) | class FlagConverter(metaclass=FlagsMeta):
    method get_flags (line 491) | def get_flags(cls) -> Dict[str, Flag]:
    method _can_be_constructible (line 496) | def _can_be_constructible(cls) -> bool:
    method __iter__ (line 499) | def __iter__(self) -> Iterator[Tuple[str, Any]]:
    method _construct_default (line 504) | async def _construct_default(cls, ctx: Context[BotT]) -> Self:
    method __repr__ (line 516) | def __repr__(self) -> str:
    method parse_flags (line 521) | def parse_flags(cls, argument: str, *, ignore_extra: bool = True) -> D...
    method convert (line 595) | async def convert(cls, ctx: Context[BotT], argument: str) -> Self:

FILE: discord/ext/commands/help.py
  class Paginator (line 101) | class Paginator:
    method __init__ (line 123) | def __init__(
    method clear (line 132) | def clear(self) -> None:
    method _prefix_len (line 143) | def _prefix_len(self) -> int:
    method _suffix_len (line 147) | def _suffix_len(self) -> int:
    method _linesep_len (line 151) | def _linesep_len(self) -> int:
    method add_line (line 154) | def add_line(self, line: str = '', *, empty: bool = False) -> None:
    method close_page (line 186) | def close_page(self) -> None:
    method __len__ (line 199) | def __len__(self) -> int:
    method pages (line 204) | def pages(self) -> List[str]:
    method __repr__ (line 216) | def __repr__(self) -> str:
  function _not_overridden (line 221) | def _not_overridden(f: FuncT) -> FuncT:
  class _HelpCommandImpl (line 226) | class _HelpCommandImpl(Command):
    method __init__ (line 227) | def __init__(self, inject: HelpCommand, *args: Any, **kwargs: Any) -> ...
    method prepare (line 233) | async def prepare(self, ctx: Context[Any]) -> None:
    method _parse_arguments (line 248) | async def _parse_arguments(self, ctx: Context[BotT]) -> None:
    method _on_error_cog_implementation (line 258) | async def _on_error_cog_implementation(self, _, ctx: Context[BotT], er...
    method _inject_into_cog (line 261) | def _inject_into_cog(self, cog: Cog) -> None:
    method _eject_cog (line 287) | def _eject_cog(self) -> None:
    method update (line 300) | def update(self, **kwargs: Any) -> None:
  class HelpCommand (line 306) | class HelpCommand:
    method __new__ (line 353) | def __new__(cls, *args: Any, **kwargs: Any) -> Self:
    method __init__ (line 369) | def __init__(self, **options: Any) -> None:
    method copy (line 379) | def copy(self) -> Self:
    method _add_to_bot (line 384) | def _add_to_bot(self, bot: BotBase) -> None:
    method _remove_from_bot (line 388) | def _remove_from_bot(self, bot: BotBase) -> None:
    method add_check (line 392) | def add_check(self, func: UserCheck[Context[Any]], /) -> None:
    method remove_check (line 412) | def remove_check(self, func: UserCheck[Context[Any]], /) -> None:
    method get_bot_mapping (line 433) | def get_bot_mapping(self) -> Dict[Optional[Cog], List[Command[Any, ......
    method invoked_with (line 441) | def invoked_with(self) -> Optional[str]:
    method get_command_signature (line 461) | def get_command_signature(self, command: Command[Any, ..., Any], /) ->...
    method remove_mentions (line 499) | def remove_mentions(self, string: str, /) -> str:
    method cog (line 520) | def cog(self) -> Optional[Cog]:
    method cog (line 537) | def cog(self, cog: Optional[Cog]) -> None:
    method command_not_found (line 545) | def command_not_found(self, string: str, /) -> str:
    method subcommand_not_found (line 570) | def subcommand_not_found(self, command: Command[Any, ..., Any], string...
    method filter_commands (line 604) | async def filter_commands(
    method get_max_size (line 671) | def get_max_size(self, commands: Sequence[Command[Any, ..., Any]], /) ...
    method get_destination (line 692) | def get_destination(self) -> discord.abc.MessageableChannel:
    method send_error_message (line 706) | async def send_error_message(self, error: str, /) -> None:
    method on_help_command_error (line 735) | async def on_help_command_error(self, ctx: Context[BotT], error: Comma...
    method send_bot_help (line 759) | async def send_bot_help(self, mapping: Mapping[Optional[Cog], List[Com...
    method send_cog_help (line 792) | async def send_cog_help(self, cog: Cog, /) -> None:
    method send_group_help (line 824) | async def send_group_help(self, group: Group[Any, ..., Any], /) -> None:
    method send_command_help (line 856) | async def send_command_help(self, command: Command[Any, ..., Any], /) ...
    method prepare_help_command (line 898) | async def prepare_help_command(self, ctx: Context[BotT], command: Opti...
    method command_callback (line 926) | async def command_callback(self, ctx: Context[BotT], /, *, command: Op...
  class DefaultHelpCommand (line 992) | class DefaultHelpCommand(HelpCommand):
    method __init__ (line 1044) | def __init__(self, **options: Any) -> None:
    method shorten_text (line 1062) | def shorten_text(self, text: str, /) -> str:
    method get_ending_note (line 1073) | def get_ending_note(self) -> str:
    method get_command_signature (line 1081) | def get_command_signature(self, command: Command[Any, ..., Any], /) ->...
    method add_indented_commands (line 1109) | def add_indented_commands(
    method add_command_arguments (line 1150) | def add_command_arguments(self, command: Command[Any, ..., Any], /) ->...
    method send_pages (line 1186) | async def send_pages(self) -> None:
    method add_command_formatting (line 1195) | def add_command_formatting(self, command: Command[Any, ..., Any], /) -...
    method get_destination (line 1228) | def get_destination(self) -> discord.abc.Messageable:
    method prepare_help_command (line 1237) | async def prepare_help_command(self, ctx: Context[BotT], command: Opti...
    method send_bot_help (line 1241) | async def send_bot_help(self, mapping: Mapping[Optional[Cog], List[Com...
    method send_command_help (line 1271) | async def send_command_help(self, command: Command[Any, ..., Any], /) ...
    method send_group_help (line 1276) | async def send_group_help(self, group: Group[Any, ..., Any], /) -> None:
    method send_cog_help (line 1290) | async def send_cog_help(self, cog: Cog, /) -> None:
  class MinimalHelpCommand (line 1305) | class MinimalHelpCommand(HelpCommand):
    method __init__ (line 1337) | def __init__(self, **options: Any) -> None:
    method send_pages (line 1351) | async def send_pages(self) -> None:
    method get_opening_note (line 1360) | def get_opening_note(self) -> str:
    method get_command_signature (line 1379) | def get_command_signature(self, command: Command[Any, ..., Any], /) ->...
    method get_ending_note (line 1382) | def get_ending_note(self) -> str:
    method add_bot_commands_formatting (line 1394) | def add_bot_commands_formatting(self, commands: Sequence[Command[Any, ...
    method add_subcommand_formatting (line 1419) | def add_subcommand_formatting(self, command: Command[Any, ..., Any], /...
    method add_aliases_formatting (line 1439) | def add_aliases_formatting(self, aliases: Sequence[str], /) -> None:
    method add_command_formatting (line 1460) | def add_command_formatting(self, command: Command[Any, ..., Any], /) -...
    method get_destination (line 1491) | def get_destination(self) -> discord.abc.Messageable:
    method prepare_help_command (line 1500) | async def prepare_help_command(self, ctx: Context[BotT], command: Opti...
    method send_bot_help (line 1504) | async def send_bot_help(self, mapping: Mapping[Optional[Cog], List[Com...
    method send_cog_help (line 1535) | async def send_cog_help(self, cog: Cog, /) -> None:
    method send_group_help (line 1560) | async def send_group_help(self, group: Group[Any, ..., Any], /) -> None:
    method send_command_help (line 1580) | async def send_command_help(self, command: Command[Any, ..., Any], /) ...

FILE: discord/ext/commands/hybrid.py
  class _CallableDefault (line 93) | class _CallableDefault:
    method __init__ (line 96) | def __init__(self, func: Callable[[Context], Any]) -> None:
    method __class__ (line 100) | def __class__(self) -> Any:
  function is_converter (line 104) | def is_converter(converter: Any) -> bool:
  function is_transformer (line 108) | def is_transformer(converter: Any) -> bool:
  function required_pos_arguments (line 114) | def required_pos_arguments(func: Callable[..., Any]) -> int:
  class ConverterTransformer (line 119) | class ConverterTransformer(app_commands.Transformer):
    method __init__ (line 120) | def __init__(self, converter: Any, parameter: Parameter) -> None:
    method transform (line 133) | async def transform(self, interaction: discord.Interaction, value: str...
  class CallableTransformer (line 152) | class CallableTransformer(app_commands.Transformer):
    method __init__ (line 153) | def __init__(self, func: Callable[[str], Any]) -> None:
    method transform (line 157) | async def transform(self, interaction: discord.Interaction, value: str...
  class GreedyTransformer (line 166) | class GreedyTransformer(app_commands.Transformer):
    method __init__ (line 167) | def __init__(self, converter: Any, parameter: Parameter) -> None:
    method transform (line 172) | async def transform(self, interaction: discord.Interaction, value: str...
  function replace_parameter (line 192) | def replace_parameter(
  function replace_parameters (line 269) | def replace_parameters(
  class HybridAppCommand (line 299) | class HybridAppCommand(discord.app_commands.Command[CogT, P, T]):
    method __init__ (line 302) | def __init__(
    method _copy_with (line 329) | def _copy_with(self, **kwargs) -> Self:
    method copy (line 335) | def copy(self) -> Self:
    method _transform_arguments (line 341) | async def _transform_arguments(
    method _check_can_run (line 376) | async def _check_can_run(self, interaction: discord.Interaction) -> bool:
    method _invoke_with_namespace (line 429) | async def _invoke_with_namespace(self, interaction: discord.Interactio...
  class HybridCommand (line 475) | class HybridCommand(Command[CogT, P, T]):
    method __init__ (line 491) | def __init__(
    method cog (line 519) | def cog(self) -> CogT:
    method cog (line 523) | def cog(self, value: CogT) -> None:
    method can_run (line 528) | async def can_run(self, ctx: Context[BotT], /) -> bool:
    method _parse_arguments (line 534) | async def _parse_arguments(self, ctx: Context[BotT]) -> None:
    method _ensure_assignment_on_copy (line 541) | def _ensure_assignment_on_copy(self, other: Self) -> Self:
    method autocomplete (line 550) | def autocomplete(
  class HybridGroup (line 581) | class HybridGroup(Group[CogT, P, T]):
    method __init__ (line 609) | def __init__(
    method _fallback_command (line 678) | def _fallback_command(self) -> Optional[HybridAppCommand[CogT, ..., T]]:
    method cog (line 684) | def cog(self) -> CogT:
    method cog (line 688) | def cog(self, value: CogT) -> None:
    method can_run (line 694) | async def can_run(self, ctx: Context[BotT], /) -> bool:
    method _parse_arguments (line 701) | async def _parse_arguments(self, ctx: Context[BotT]) -> None:
    method _ensure_assignment_on_copy (line 709) | def _ensure_assignment_on_copy(self, other: Self) -> Self:
    method _update_copy (line 714) | def _update_copy(self, kwargs: Dict[str, Any]) -> Self:
    method autocomplete (line 732) | def autocomplete(
    method add_command (line 768) | def add_command(self, command: Union[HybridGroup[CogT, ..., Any], Hybr...
    method remove_command (line 808) | def remove_command(self, name: str, /) -> Optional[Command[CogT, ..., ...
    method command (line 814) | def command(
    method group (line 838) | def group(
  function hybrid_command (line 863) | def hybrid_command(
  function hybrid_group (line 914) | def hybrid_group(

FILE: discord/ext/commands/parameters.py
  function _gen_property (line 73) | def _gen_property(name: str) -> property:
  class Parameter (line 82) | class Parameter(inspect.Parameter):
    method __init__ (line 92) | def __init__(
    method replace (line 112) | def replace(
    method required (line 155) | def required(self) -> bool:
    method converter (line 160) | def converter(self) -> Any:
    method description (line 168) | def description(self) -> Optional[str]:
    method displayed_default (line 173) | def displayed_default(self) -> Optional[str]:
    method displayed_name (line 187) | def displayed_name(self) -> Optional[str]:
    method get_default (line 194) | async def get_default(self, ctx: Context[Any]) -> Any:
  function parameter (line 210) | def parameter(
  class ParameterAlias (line 261) | class ParameterAlias(Protocol):
    method __call__ (line 262) | def __call__(
  function default_guild (line 298) | def default_guild(ctx: Context[Any]) -> Guild:
  class Signature (line 312) | class Signature(inspect.Signature):

FILE: discord/ext/commands/view.py
  class StringView (line 54) | class StringView:
    method __init__ (line 55) | def __init__(self, buffer: str) -> None:
    method current (line 62) | def current(self) -> Optional[str]:
    method eof (line 66) | def eof(self) -> bool:
    method undo (line 69) | def undo(self) -> None:
    method skip_ws (line 72) | def skip_ws(self) -> bool:
    method skip_string (line 87) | def skip_string(self, string: str) -> bool:
    method read_rest (line 95) | def read_rest(self) -> str:
    method read (line 101) | def read(self, n: int) -> str:
    method get (line 107) | def get(self) -> Optional[str]:
    method get_word (line 117) | def get_word(self) -> str:
    method get_quoted_word (line 132) | def get_quoted_word(self) -> Optional[str]:
    method __repr__ (line 195) | def __repr__(self) -> str:

FILE: discord/ext/tasks/__init__.py
  function is_ambiguous (line 65) | def is_ambiguous(dt: datetime.datetime) -> bool:
  function is_imaginary (line 78) | def is_imaginary(dt: datetime.datetime) -> bool:
  function resolve_datetime (line 89) | def resolve_datetime(dt: datetime.datetime) -> datetime.datetime:
  class SleepHandle (line 107) | class SleepHandle:
    method __init__ (line 110) | def __init__(self, dt: datetime.datetime, *, loop: asyncio.AbstractEve...
    method recalculate (line 116) | def recalculate(self, dt: datetime.datetime) -> None:
    method wait (line 121) | def wait(self) -> asyncio.Future[Any]:
    method done (line 124) | def done(self) -> bool:
    method cancel (line 127) | def cancel(self) -> None:
  class Loop (line 132) | class Loop(Generic[LF]):
    method __init__ (line 138) | def __init__(
    method _call_loop_function (line 182) | async def _call_loop_function(self, name: str, *args: Any, **kwargs: A...
    method _try_sleep_until (line 192) | def _try_sleep_until(self, dt: datetime.datetime):
    method _is_relative_time (line 196) | def _is_relative_time(self) -> bool:
    method _is_explicit_time (line 199) | def _is_explicit_time(self) -> bool:
    method _loop (line 202) | async def _loop(self, *args: Any, **kwargs: Any) -> None:
    method __get__ (line 275) | def __get__(self, obj: T, objtype: Type[T]) -> Loop[LF]:
    method seconds (line 297) | def seconds(self) -> Optional[float]:
    method minutes (line 307) | def minutes(self) -> Optional[float]:
    method hours (line 317) | def hours(self) -> Optional[float]:
    method time (line 327) | def time(self) -> Optional[List[datetime.time]]:
    method current_loop (line 337) | def current_loop(self) -> int:
    method next_iteration (line 342) | def next_iteration(self) -> Optional[datetime.datetime]:
    method __call__ (line 353) | async def __call__(self, *args: Any, **kwargs: Any) -> Any:
    method start (line 373) | def start(self, *args: Any, **kwargs: Any) -> asyncio.Task[None]:
    method stop (line 404) | def stop(self) -> None:
    method _can_be_cancelled (line 428) | def _can_be_cancelled(self) -> bool:
    method cancel (line 431) | def cancel(self) -> None:
    method restart (line 436) | def restart(self, *args: Any, **kwargs: Any) -> None:
    method add_exception_type (line 461) | def add_exception_type(self, *exceptions: Type[BaseException]) -> None:
    method clear_exception_types (line 490) | def clear_exception_types(self) -> None:
    method remove_exception_type (line 499) | def remove_exception_type(self, *exceptions: Type[BaseException]) -> b...
    method get_task (line 516) | def get_task(self) -> Optional[asyncio.Task[None]]:
    method is_being_cancelled (line 520) | def is_being_cancelled(self) -> bool:
    method failed (line 524) | def failed(self) -> bool:
    method is_running (line 531) | def is_running(self) -> bool:
    method _error (line 538) | async def _error(self, *args: Any) -> None:
    method before_loop (line 542) | def before_loop(self, coro: FT) -> FT:
    method after_loop (line 570) | def after_loop(self, coro: FT) -> FT:
    method error (line 598) | def error(self, coro: ET) -> ET:
    method _get_next_sleep_time (line 628) | def _get_next_sleep_time(self, now: datetime.datetime = MISSING) -> da...
    method _start_time_relative_to (line 648) | def _start_time_relative_to(self, now: datetime.datetime) -> Optional[...
    method _get_time_parameter (line 673) | def _get_time_parameter(
    method change_interval (line 701) | def change_interval(
  function loop (line 768) | def loop(

FILE: discord/file.py
  function _strip_spoiler (line 40) | def _strip_spoiler(filename: str) -> Tuple[str, bool]:
  class File (line 48) | class File:
    method __init__ (line 82) | def __init__(
    method filename (line 122) | def filename(self) -> str:
    method filename (line 130) | def filename(self, value: str) -> None:
    method reset (line 133) | def reset(self, *, seek: Union[int, bool] = True) -> None:
    method close (line 145) | def close(self) -> None:
    method to_dict (line 150) | def to_dict(self, index: int) -> Dict[str, Any]:

FILE: discord/flags.py
  class flag_value (line 71) | class flag_value:
    method __init__ (line 72) | def __init__(self, func: Callable[[Any], int]):
    method __get__ (line 77) | def __get__(self, instance: None, owner: Type[BF]) -> Self:
    method __get__ (line 81) | def __get__(self, instance: BF, owner: Type[BF]) -> bool:
    method __get__ (line 84) | def __get__(self, instance: Optional[BF], owner: Type[BF]) -> Any:
    method __set__ (line 89) | def __set__(self, instance: BaseFlags, value: bool) -> None:
    method __repr__ (line 92) | def __repr__(self) -> str:
  class alias_flag_value (line 96) | class alias_flag_value(flag_value):
  function fill_with_flags (line 100) | def fill_with_flags(*, inverted: bool = False) -> Callable[[Type[BF]], T...
  class BaseFlags (line 122) | class BaseFlags:
    method __init__ (line 130) | def __init__(self, **kwargs: bool):
    method _from_value (line 138) | def _from_value(cls, value):
    method __or__ (line 143) | def __or__(self, other: Self) -> Self:
    method __and__ (line 146) | def __and__(self, other: Self) -> Self:
    method __xor__ (line 149) | def __xor__(self, other: Self) -> Self:
    method __ior__ (line 152) | def __ior__(self, other: Self) -> Self:
    method __iand__ (line 156) | def __iand__(self, other: Self) -> Self:
    method __ixor__ (line 160) | def __ixor__(self, other: Self) -> Self:
    method __invert__ (line 164) | def __invert__(self) -> Self:
    method __bool__ (line 169) | def __bool__(self) -> bool:
    method __eq__ (line 172) | def __eq__(self, other: object) -> bool:
    method __ne__ (line 175) | def __ne__(self, other: object) -> bool:
    method __hash__ (line 178) | def __hash__(self) -> int:
    method __repr__ (line 181) | def __repr__(self) -> str:
    method __iter__ (line 184) | def __iter__(self) -> Iterator[Tuple[str, bool]]:
    method _has_flag (line 192) | def _has_flag(self, o: int) -> bool:
    method _set_flag (line 195) | def _set_flag(self, o: int, toggle: bool) -> None:
  class SystemChannelFlags (line 205) | class SystemChannelFlags(BaseFlags):
    method _has_flag (line 282) | def _has_flag(self, o: int) -> bool:
    method _set_flag (line 285) | def _set_flag(self, o: int, toggle: bool) -> None:
    method join_notifications (line 294) | def join_notifications(self):
    method premium_subscriptions (line 299) | def premium_subscriptions(self):
    method guild_reminder_notifications (line 304) | def guild_reminder_notifications(self):
    method join_notification_replies (line 312) | def join_notification_replies(self):
    method role_subscription_purchase_notifications (line 321) | def role_subscription_purchase_notifications(self):
    method role_subscription_purchase_notification_replies (line 330) | def role_subscription_purchase_notification_replies(self):
  class MessageFlags (line 340) | class MessageFlags(BaseFlags):
    method crossposted (line 408) | def crossposted(self):
    method is_crossposted (line 413) | def is_crossposted(self):
    method suppress_embeds (line 418) | def suppress_embeds(self):
    method source_message_deleted (line 423) | def source_message_deleted(self):
    method urgent (line 428) | def urgent(self):
    method has_thread (line 436) | def has_thread(self):
    method ephemeral (line 444) | def ephemeral(self):
    method loading (line 452) | def loading(self):
    method failed_to_mention_some_roles_in_thread (line 461) | def failed_to_mention_some_roles_in_thread(self):
    method suppress_notifications (line 470) | def suppress_notifications(self):
    method silent (line 478) | def silent(self):
    method voice (line 486) | def voice(self):
  class PublicUserFlags (line 495) | class PublicUserFlags(BaseFlags):
    method staff (line 562) | def staff(self):
    method partner (line 567) | def partner(self):
    method hypesquad (line 572) | def hypesquad(self):
    method bug_hunter (line 577) | def bug_hunter(self):
    method hypesquad_bravery (line 582) | def hypesquad_bravery(self):
    method hypesquad_brilliance (line 587) | def hypesquad_brilliance(self):
    method hypesquad_balance (line 592) | def hypesquad_balance(self):
    method early_supporter (line 597) | def early_supporter(self):
    method team_user (line 602) | def team_user(self):
    method system (line 607) | def system(self):
    method bug_hunter_level_2 (line 612) | def bug_hunter_level_2(self):
    method verified_bot (line 617) | def verified_bot(self):
    method verified_bot_developer (line 622) | def verified_bot_developer(self):
    method early_verified_bot_developer (line 627) | def early_verified_bot_developer(self):
    method discord_certified_moderator (line 635) | def discord_certified_moderator(self):
    method bot_http_interactions (line 643) | def bot_http_interactions(self):
    method spammer (line 652) | def spammer(self):
    method active_developer (line 660) | def active_developer(self):
    method all (line 667) | def all(self) -> List[UserFlags]:
  class Intents (line 673) | class Intents(BaseFlags):
    method __init__ (line 748) | def __init__(self, value: int = 0, **kwargs: bool) -> None:
    method all (line 756) | def all(cls: Type[Intents]) -> Intents:
    method none (line 764) | def none(cls: Type[Intents]) -> Intents:
    method default (line 771) | def default(cls: Type[Intents]) -> Intents:
    method guilds (line 782) | def guilds(self):
    method members (line 812) | def members(self):
    method moderation (line 850) | def moderation(self):
    method bans (line 864) | def bans(self):
    method emojis (line 873) | def emojis(self):
    method emojis_and_stickers (line 882) | def emojis_and_stickers(self):
    method integrations (line 906) | def integrations(self):
    method webhooks (line 921) | def webhooks(self):
    method invites (line 933) | def invites(self):
    method voice_states (line 946) | def voice_states(self):
    method presences (line 966) | def presences(self):
    method messages (line 989) | def messages(self):
    method guild_messages (line 1016) | def guild_messages(self):
    method dm_messages (line 1043) | def dm_messages(self):
    method reactions (line 1070) | def reactions(self):
    method guild_reactions (line 1091) | def guild_reactions(self):
    method dm_reactions (line 1112) | def dm_reactions(self):
    method typing (line 1133) | def typing(self):
    method guild_typing (line 1147) | def guild_typing(self):
    method dm_typing (line 1161) | def dm_typing(self):
    method message_content (line 1175) | def message_content(self):
    method guild_scheduled_events (line 1202) | def guild_scheduled_events(self):
    method auto_moderation (line 1218) | def auto_moderation(self):
    method auto_moderation_configuration (line 1236) | def auto_moderation_configuration(self):
    method auto_moderation_execution (line 1250) | def auto_moderation_execution(self):
    method polls (line 1261) | def polls(self):
    method guild_polls (line 1278) | def guild_polls(self):
    method dm_polls (line 1295) | def dm_polls(self):
  class MemberCacheFlags (line 1313) | class MemberCacheFlags(BaseFlags):
    method __init__ (line 1391) | def __init__(self, **kwargs: bool):
    method all (line 1400) | def all(cls: Type[MemberCacheFlags]) -> MemberCacheFlags:
    method none (line 1409) | def none(cls: Type[MemberCacheFlags]) -> MemberCacheFlags:
    method _empty (line 1416) | def _empty(self):
    method voice (line 1420) | def voice(self):
    method joined (line 1430) | def joined(self):
    method from_intents (line 1441) | def from_intents(cls: Type[MemberCacheFlags], intents: Intents) -> Mem...
    method _verify_intents (line 1464) | def _verify_intents(self, intents: Intents):
    method _voice_only (line 1472) | def _voice_only(self):
  class ApplicationFlags (line 1477) | class ApplicationFlags(BaseFlags):
    method auto_mod_badge (line 1539) | def auto_mod_badge(self):
    method gateway_presence (line 1548) | def gateway_presence(self):
    method gateway_presence_limited (line 1555) | def gateway_presence_limited(self):
    method gateway_guild_members (line 1562) | def gateway_guild_members(self):
    method gateway_guild_members_limited (line 1569) | def gateway_guild_members_limited(self):
    method verification_pending_guild_limit (line 1576) | def verification_pending_guild_limit(self):
    method embedded (line 1583) | def embedded(self):
    method gateway_message_content (line 1588) | def gateway_message_content(self):
    method gateway_message_content_limited (line 1594) | def gateway_message_content_limited(self):
    method app_commands_badge (line 1600) | def app_commands_badge(self):
    method active (line 1606) | def active(self):
  class ChannelFlags (line 1616) | class ChannelFlags(BaseFlags):
    method pinned (line 1678) | def pinned(self):
    method require_tag (line 1683) | def require_tag(self):
    method hide_media_download_options (line 1692) | def hide_media_download_options(self):
  class ArrayFlags (line 1701) | class ArrayFlags(BaseFlags):
    method _from_value (line 1703) | def _from_value(cls: Type[Self], value: Sequence[int]) -> Self:
    method to_array (line 1716) | def to_array(self, *, offset: int = 0) -> List[int]:
    method all (line 1720) | def all(cls: Type[Self]) -> Self:
    method none (line 1729) | def none(cls: Type[Self]) -> Self:
  class AutoModPresets (line 1737) | class AutoModPresets(ArrayFlags):
    method to_array (line 1800) | def to_array(self) -> List[int]:
    method profanity (line 1804) | def profanity(self):
    method sexual_content (line 1809) | def sexual_content(self):
    method slurs (line 1814) | def slurs(self):
  class AppCommandContext (line 1820) | class AppCommandContext(ArrayFlags):
    method guild (line 1877) | def guild(self):
    method dm_channel (line 1882) | def dm_channel(self):
    method private_channel (line 1887) | def private_channel(self):
  class AppInstallationType (line 1893) | class AppInstallationType(ArrayFlags):
    method guild (line 1948) | def guild(self):
    method user (line 1953) | def user(self):
  class MemberFlags (line 1959) | class MemberFlags(BaseFlags):
    method did_rejoin (line 2016) | def did_rejoin(self):
    method completed_onboarding (line 2021) | def completed_onboarding(self):
    method bypasses_verification (line 2026) | def bypasses_verification(self):
    method started_onboarding (line 2031) | def started_onboarding(self):
  class AttachmentFlags (line 2037) | class AttachmentFlags(BaseFlags):
    method clip (line 2094) | def clip(self):
    method thumbnail (line 2099) | def thumbnail(self):
    method remix (line 2104) | def remix(self):
  class RoleFlags (line 2110) | class RoleFlags(BaseFlags):
    method in_prompt (line 2167) | def in_prompt(self):
  class SKUFlags (line 2173) | class SKUFlags(BaseFlags):
    method available (line 2230) | def available(self):
    method guild_subscription (line 2235) | def guild_subscription(self):
    method user_subscription (line 2240) | def user_subscription(self):

FILE: discord/gateway.py
  class ReconnectWebSocket (line 65) | class ReconnectWebSocket(Exception):
    method __init__ (line 68) | def __init__(self, shard_id: Optional[int], *, resume: bool = True) ->...
  class WebSocketClosure (line 74) | class WebSocketClosure(Exception):
  class EventListener (line 80) | class EventListener(NamedTuple):
  class GatewayRatelimiter (line 87) | class GatewayRatelimiter:
    method __init__ (line 88) | def __init__(self, count: int = 110, per: float = 60.0) -> None:
    method is_ratelimited (line 97) | def is_ratelimited(self) -> bool:
    method get_delay (line 103) | def get_delay(self) -> float:
    method block (line 118) | async def block(self) -> None:
  class KeepAliveHandler (line 126) | class KeepAliveHandler(threading.Thread):
    method __init__ (line 127) | def __init__(
    method run (line 152) | def run(self) -> None:
    method get_payload (line 194) | def get_payload(self) -> Dict[str, Any]:
    method stop (line 200) | def stop(self) -> None:
    method tick (line 203) | def tick(self) -> None:
    method ack (line 206) | def ack(self) -> None:
  class VoiceKeepAliveHandler (line 214) | class VoiceKeepAliveHandler(KeepAliveHandler):
    method __init__ (line 215) | def __init__(self, *args: Any, **kwargs: Any) -> None:
    method get_payload (line 223) | def get_payload(self) -> Dict[str, Any]:
    method ack (line 229) | def ack(self) -> None:
  class DiscordClientWebSocketResponse (line 237) | class DiscordClientWebSocketResponse(aiohttp.ClientWebSocketResponse):
    method close (line 238) | async def close(self, *, code: int = 4000, message: bytes = b'') -> bool:
  class DiscordWebSocket (line 245) | class DiscordWebSocket:
    method __init__ (line 313) | def __init__(self, socket: aiohttp.ClientWebSocketResponse, *, loop: a...
    method open (line 334) | def open(self) -> bool:
    method is_ratelimited (line 337) | def is_ratelimited(self) -> bool:
    method debug_log_receive (line 340) | def debug_log_receive(self, data: Dict[str, Any], /) -> None:
    method log_receive (line 343) | def log_receive(self, _: Dict[str, Any], /) -> None:
    method from_client (line 347) | async def from_client(
    method wait_for (line 410) | def wait_for(
    method identify (line 440) | async def identify(self) -> None:
    method resume (line 475) | async def resume(self) -> None:
    method received_message (line 489) | async def received_message(self, msg: Any, /) -> None:
    method latency (line 603) | def latency(self) -> float:
    method _can_handle_close (line 608) | def _can_handle_close(self) -> bool:
    method poll_event (line 612) | async def poll_event(self) -> None:
    method debug_send (line 650) | async def debug_send(self, data: str, /) -> None:
    method send (line 655) | async def send(self, data: str, /) -> None:
    method send_as_json (line 659) | async def send_as_json(self, data: Any) -> None:
    method send_heartbeat (line 666) | async def send_heartbeat(self, data: Any) -> None:
    method change_presence (line 674) | async def change_presence(
    method request_chunks (line 705) | async def request_chunks(
    method voice_state (line 735) | async def voice_state(
    method close (line 755) | async def close(self, code: int = 4000) -> None:
  class DiscordVoiceWebSocket (line 767) | class DiscordVoiceWebSocket:
    method __init__ (line 819) | def __init__(
    method _hook (line 834) | async def _hook(self, *args: Any) -> None:
    method send_as_json (line 837) | async def send_as_json(self, data: Any) -> None:
    method resume (line 843) | async def resume(self) -> None:
    method identify (line 855) | async def identify(self) -> None:
    method from_connection_state (line 869) | async def from_connection_state(
    method select_protocol (line 894) | async def select_protocol(self, ip: str, port: int, mode: int) -> None:
    method client_connect (line 909) | async def client_connect(self) -> None:
    method speak (line 919) | async def speak(self, state: SpeakingState = SpeakingState.voice) -> N...
    method received_message (line 931) | async def received_message(self, msg: Dict[str, Any]) -> None:
    method initial_connection (line 953) | async def initial_connection(self, data: Dict[str, Any]) -> None:
    method discover_ip (line 971) | async def discover_ip(self) -> Tuple[str, int]:
    method latency (line 1004) | def latency(self) -> float:
    method average_latency (line 1010) | def average_latency(self) -> float:
    method load_secret_key (line 1018) | async def load_secret_key(self, data: Dict[str, Any]) -> None:
    method poll_event (line 1027) | async def poll_event(self) -> None:
    method close (line 1039) | async def close(self, code: int = 1000) -> None:

FILE: discord/guild.py
  class BanEntry (line 145) | class BanEntry(NamedTuple):
  class BulkBanResult (line 150) | class BulkBanResult(NamedTuple):
  class _GuildLimit (line 155) | class _GuildLimit(NamedTuple):
  class Guild (line 162) | class Guild(Hashable):
    method __init__ (line 341) | def __init__(self, *, data: GuildPayload, state: ConnectionState) -> N...
    method _add_channel (line 352) | def _add_channel(self, channel: GuildChannel, /) -> None:
    method _remove_channel (line 355) | def _remove_channel(self, channel: Snowflake, /) -> None:
    method _voice_state_for (line 358) | def _voice_state_for(self, user_id: int, /) -> Optional[VoiceState]:
    method _add_member (line 361) | def _add_member(self, member: Member, /) -> None:
    method _store_thread (line 364) | def _store_thread(self, payload: ThreadPayload, /) -> Thread:
    method _remove_member (line 369) | def _remove_member(self, member: Snowflake, /) -> None:
    method _add_thread (line 372) | def _add_thread(self, thread: Thread, /) -> None:
    method _remove_thread (line 375) | def _remove_thread(self, thread: Snowflake, /) -> None:
    method _clear_threads (line 378) | def _clear_threads(self) -> None:
    method _remove_threads_by_channel (line 381) | def _remove_threads_by_channel(self, channel_id: int) -> List[Thread]:
    method _filter_threads (line 387) | def _filter_threads(self, channel_ids: Set[int]) -> Dict[int, Thread]:
    method __str__ (line 393) | def __str__(self) -> str:
    method __repr__ (line 396) | def __repr__(self) -> str:
    method _update_voice_state (line 407) | def _update_voice_state(self, data: GuildVoiceState, channel_id: int) ...
    method _add_role (line 434) | def _add_role(self, role: Role, /) -> None:
    method _remove_role (line 437) | def _remove_role(self, role_id: int, /) -> Role:
    method _create_unavailable (line 442) | def _create_unavailable(cls, *, state: ConnectionState, guild_id: int,...
    method _from_data (line 448) | def _from_data(self, guild: GuildPayload) -> None:
    method channels (line 551) | def channels(self) -> Sequence[GuildChannel]:
    method threads (line 556) | def threads(self) -> Sequence[Thread]:
    method large (line 564) | def large(self) -> bool:
    method voice_channels (line 577) | def voice_channels(self) -> List[VoiceChannel]:
    method stage_channels (line 587) | def stage_channels(self) -> List[StageChannel]:
    method me (line 599) | def me(self) -> Member:
    method voice_client (line 608) | def voice_client(self) -> Optional[VoiceProtocol]:
    method text_channels (line 613) | def text_channels(self) -> List[TextChannel]:
    method categories (line 623) | def categories(self) -> List[CategoryChannel]:
    method forums (line 633) | def forums(self) -> List[ForumChannel]:
    method by_category (line 642) | def by_category(self) -> List[ByCategoryItem]:
    method _resolve_channel (line 677) | def _resolve_channel(self, id: Optional[int], /) -> Optional[Union[Gui...
    method get_channel_or_thread (line 683) | def get_channel_or_thread(self, channel_id: int, /) -> Optional[Union[...
    method get_channel (line 700) | def get_channel(self, channel_id: int, /) -> Optional[GuildChannel]:
    method get_thread (line 723) | def get_thread(self, thread_id: int, /) -> Optional[Thread]:
    method get_emoji (line 745) | def get_emoji(self, emoji_id: int, /) -> Optional[Emoji]:
    method afk_channel (line 766) | def afk_channel(self) -> Optional[VocalGuildChannel]:
    method system_channel (line 774) | def system_channel(self) -> Optional[TextChannel]:
    method system_channel_flags (line 783) | def system_channel_flags(self) -> SystemChannelFlags:
    method rules_channel (line 788) | def rules_channel(self) -> Optional[TextChannel]:
    method public_updates_channel (line 800) | def public_updates_channel(self) -> Optional[TextChannel]:
    method safety_alerts_channel (line 813) | def safety_alerts_channel(self) -> Optional[TextChannel]:
    method widget_channel (line 824) | def widget_channel(self) -> Optional[Union[TextChannel, ForumChannel, ...
    method emoji_limit (line 836) | def emoji_limit(self) -> int:
    method sticker_limit (line 842) | def sticker_limit(self) -> int:
    method bitrate_limit (line 851) | def bitrate_limit(self) -> float:
    method filesize_limit (line 857) | def filesize_limit(self) -> int:
    method members (line 862) | def members(self) -> Sequence[Member]:
    method get_member (line 866) | def get_member(self, user_id: int, /) -> Optional[Member]:
    method premium_subscribers (line 886) | def premium_subscribers(self) -> List[Member]:
    method roles (line 891) | def roles(self) -> Sequence[Role]:
    method get_role (line 899) | def get_role(self, role_id: int, /) -> Optional[Role]:
    method default_role (line 919) | def default_role(self) -> Role:
    method premium_subscriber_role (line 925) | def premium_subscriber_role(self) -> Optional[Role]:
    method self_role (line 936) | def self_role(self) -> Optional[Role]:
    method stage_instances (line 949) | def stage_instances(self) -> Sequence[StageInstance]:
    method get_stage_instance (line 957) | def get_stage_instance(self, stage_instance_id: int, /) -> Optional[St...
    method scheduled_events (line 975) | def scheduled_events(self) -> Sequence[ScheduledEvent]:
    method get_scheduled_event (line 982) | def get_scheduled_event(self, scheduled_event_id: int, /) -> Optional[...
    method owner (line 1000) | def owner(self) -> Optional[Member]:
    method icon (line 1005) | def icon(self) -> Optional[Asset]:
    method banner (line 1012) | def banner(self) -> Optional[Asset]:
    method splash (line 1019) | def splash(self) -> Optional[Asset]:
    method discovery_splash (line 1026) | def discovery_splash(self) -> Optional[Asset]:
    method member_count (line 1033) | def member_count(self) -> Optional[int]:
    method chunked (line 1048) | def chunked(self) -> bool:
    method shard_id (line 1063) | def shard_id(self) -> int:
    method created_at (line 1071) | def created_at(self) -> datetime.datetime:
    method get_member_named (line 1075) | def get_member_named(self, name: str, /) -> Optional[Member]:
    method _create_channel (line 1125) | def _create_channel(
    method _create_channel (line 1136) | def _create_channel(
    method _create_channel (line 1147) | def _create_channel(
    method _create_channel (line 1158) | def _create_channel(
    method _create_channel (line 1169) | def _create_channel(
    method _create_channel (line 1180) | def _create_channel(
    method _create_channel (line 1191) | def _create_channel(
    method _create_channel (line 1202) | def _create_channel(
    method _create_channel (line 1212) | def _create_channel(
    method create_text_channel (line 1245) | async def create_text_channel(
    method create_voice_channel (line 1387) | async def create_voice_channel(
    method create_stage_channel (line 1480) | async def create_stage_channel(
    method create_category (line 1580) | async def create_category(
    method create_forum (line 1630) | async def create_forum(
    method leave (line 1779) | async def leave(self) -> None:
    method delete (line 1796) | async def delete(self) -> None:
    method edit (line 1812) | async def edit(
    method fetch_channels (line 2198) | async def fetch_channels(self) -> Sequence[GuildChannel]:
    method active_threads (line 2233) | async def active_threads(self) -> List[Thread]:
    method fetch_members (line 2262) | async def fetch_members(self, *, limit: Optional[int] = 1000, after: S...
    method fetch_member (line 2333) | async def fetch_member(self, member_id: int, /) -> Member:
    method fetch_ban (line 2368) | async def fetch_ban(self, user: Snowflake) -> BanEntry:
    method fetch_channel (line 2397) | async def fetch_channel(self, channel_id: int, /) -> Union[GuildChanne...
    method bans (line 2442) | async def bans(
    method prune_members (line 2547) | async def prune_members(
    method templates (line 2620) | async def templates(self) -> List[Template]:
    method webhooks (line 2644) | async def webhooks(self) -> List[Webhook]:
    method estimate_pruned_members (line 2667) | async def estimate_pruned_members(self, *, days: int, roles: Collectio...
    method invites (line 2717) | async def invites(self) -> List[Invite]:
    method create_template (line 2745) | async def create_template(self, *, name: str, description: str = MISSI...
    method create_integration (line 2772) | async def create_integration(self, *, type: IntegrationType, id: int) ...
    method integrations (line 2797) | async def integrations(self) -> List[Integration]:
    method fetch_stickers (line 2828) | async def fetch_stickers(self) -> List[GuildSticker]:
    method fetch_sticker (line 2852) | async def fetch_sticker(self, sticker_id: int, /) -> GuildSticker:
    method create_sticker (line 2884) | async def create_sticker(
    method delete_sticker (line 2947) | async def delete_sticker(self, sticker: Snowflake, /, *, reason: Optio...
    method fetch_scheduled_events (line 2972) | async def fetch_scheduled_events(self, *, with_counts: bool = True) ->...
    method fetch_scheduled_event (line 2998) | async def fetch_scheduled_event(self, scheduled_event_id: int, /, *, w...
    method create_scheduled_event (line 3029) | async def create_scheduled_event(
    method create_scheduled_event (line 3045) | async def create_scheduled_event(
    method create_scheduled_event (line 3061) | async def create_scheduled_event(
    method create_scheduled_event (line 3076) | async def create_scheduled_event(
    method create_scheduled_event (line 3090) | async def create_scheduled_event(
    method fetch_emojis (line 3249) | async def fetch_emojis(self) -> List[Emoji]:
    method fetch_emoji (line 3271) | async def fetch_emoji(self, emoji_id: int, /) -> Emoji:
    method create_custom_emoji (line 3305) | async def create_custom_emoji(
    method delete_emoji (line 3359) | async def delete_emoji(self, emoji: Snowflake, /, *, reason: Optional[...
    method fetch_roles (line 3387) | async def fetch_roles(self) -> List[Role]:
    method create_role (line 3412) | async def create_role(
    method create_role (line 3426) | async def create_role(
    method create_role (line 3439) | async def create_role(
    method edit_role_positions (line 3538) | async def edit_role_positions(self, positions: Mapping[Snowflake, int]...
    method welcome_screen (line 3604) | async def welcome_screen(self) -> WelcomeScreen:
    method edit_welcome_screen (line 3630) | async def edit_welcome_screen(
    method kick (line 3673) | async def kick(self, user: Snowflake, *, reason: Optional[str] = None)...
    method ban (line 3698) | async def ban(
    method unban (line 3759) | async def unban(self, user: Snowflake, *, reason: Optional[str] = None...
    method bulk_ban (line 3786) | async def bulk_ban(
    method vanity_url (line 3839) | def vanity_url(self) -> Optional[str]:
    method vanity_invite (line 3848) | async def vanity_invite(self) -> Optional[Invite]:
    method audit_logs (line 3888) | async def audit_logs(
    method widget (line 4068) | async def widget(self) -> Widget:
    method edit_widget (line 4093) | async def edit_widget(
    method chunk (line 4133) | async def chunk(self, *, cache: bool = True) -> List[Member]:
    method query_members (line 4167) | async def query_members(
    method change_voice_state (line 4240) | async def change_voice_state(
    method fetch_automod_rule (line 4262) | async def fetch_automod_rule(self, automod_rule_id: int, /) -> AutoMod...
    method fetch_automod_rules (line 4291) | async def fetch_automod_rules(self) -> List[AutoModRule]:
    method create_automod_rule (line 4316) | async def create_automod_rule(
    method invites_paused_until (line 4384) | def invites_paused_until(self) -> Optional[datetime.datetime]:
    method dms_paused_until (line 4396) | def dms_paused_until(self) -> Optional[datetime.datetime]:
    method invites_paused (line 4407) | def invites_paused(self) -> bool:
    method dms_paused (line 4417) | def dms_paused(self) -> bool:

FILE: discord/http.py
  function json_or_text (line 106) | async def json_or_text(response: aiohttp.ClientResponse) -> Union[Dict[s...
  class MultipartParameters (line 118) | class MultipartParameters(NamedTuple):
    method __enter__ (line 123) | def __enter__(self) -> Self:
    method __exit__ (line 126) | def __exit__(
  function handle_message_parameters (line 137) | def handle_message_parameters(
  function _set_api_version (line 285) | def _set_api_version(value: int):
  class Route (line 298) | class Route:
    method __init__ (line 301) | def __init__(self, method: str, path: str, *, metadata: Optional[str] ...
    method key (line 319) | def key(self) -> str:
    method major_parameters (line 326) | def major_parameters(self) -> str:
  class Ratelimit (line 336) | class Ratelimit:
    method __init__ (line 359) | def __init__(self, max_ratelimit_timeout: Optional[float]) -> None:
    method __repr__ (line 375) | def __repr__(self) -> str:
    method reset (line 380) | def reset(self):
    method update (line 386) | def update(self, response: aiohttp.ClientResponse, *, use_clock: bool ...
    method _wake_next (line 407) | def _wake_next(self) -> None:
    method _wake (line 414) | def _wake(self, count: int = 1, *, exception: Optional[RateLimited] = ...
    method _refresh (line 428) | async def _refresh(self) -> None:
    method is_expired (line 438) | def is_expired(self) -> bool:
    method is_inactive (line 441) | def is_inactive(self) -> bool:
    method acquire (line 445) | async def acquire(self) -> None:
    method __aenter__ (line 470) | async def __aenter__(self) -> Self:
    method __aexit__ (line 474) | async def __aexit__(self, type: Type[BE], value: BE, traceback: Traceb...
  class HTTPClient (line 496) | class HTTPClient:
    method __init__ (line 499) | def __init__(
    method clear (line 533) | def clear(self) -> None:
    method ws_connect (line 537) | async def ws_connect(self, url: str, *, compress: int = 0) -> aiohttp....
    method _try_clear_expired_ratelimits (line 552) | def _try_clear_expired_ratelimits(self) -> None:
    method get_ratelimit (line 560) | def get_ratelimit(self, key: str) -> Ratelimit:
    method request (line 568) | async def request(
    method get_from_cdn (line 777) | async def get_from_cdn(self, url: str) -> bytes:
    method close (line 792) | async def close(self) -> None:
    method static_login (line 798) | async def static_login(self, token: str) -> user.User:
    method logout (line 825) | def logout(self) -> Response[None]:
    method start_group (line 830) | def start_group(self, user_id: Snowflake, recipients: List[int]) -> Re...
    method leave_group (line 837) | def leave_group(self, channel_id: Snowflake) -> Response[None]:
    method start_private_message (line 842) | def start_private_message(self, user_id: Snowflake) -> Response[channe...
    method send_message (line 849) | def send_message(
    method send_typing (line 861) | def send_typing(self, channel_id: Snowflake) -> Response[None]:
    method delete_message (line 864) | def delete_message(
    method delete_messages (line 885) | def delete_messages(
    method edit_message (line 895) | def edit_message(
    method add_reaction (line 904) | def add_reaction(self, channel_id: Snowflake, message_id: Snowflake, e...
    method remove_reaction (line 914) | def remove_reaction(
    method remove_own_reaction (line 927) | def remove_own_reaction(self, channel_id: Snowflake, message_id: Snowf...
    method get_reaction_users (line 937) | def get_reaction_users(
    method clear_reactions (line 965) | def clear_reactions(self, channel_id: Snowflake, message_id: Snowflake...
    method clear_single_reaction (line 975) | def clear_single_reaction(self, channel_id: Snowflake, message_id: Sno...
    method get_message (line 985) | def get_message(self, channel_id: Snowflake, message_id: Snowflake) ->...
    method get_channel (line 989) | def get_channel(self, channel_id: Snowflake) -> Response[channel.Chann...
    method logs_from (line 993) | def logs_from(
    method publish_message (line 1014) | def publish_message(self, channel_id: Snowflake, message_id: Snowflake...
    method pin_message (line 1024) | def pin_message(self, channel_id: Snowflake, message_id: Snowflake, re...
    method unpin_message (line 1033) | def unpin_message(self, channel_id: Snowflake, message_id: Snowflake, ...
    method pins_from (line 1042) | def pins_from(self, channel_id: Snowflake) -> Response[List[message.Me...
    method kick (line 1047) | def kick(self, user_id: Snowflake, guild_id: Snowflake, reason: Option...
    method ban (line 1051) | def ban(
    method unban (line 1065) | def unban(self, user_id: Snowflake, guild_id: Snowflake, *, reason: Op...
    method bulk_ban (line 1069) | def bulk_ban(
    method guild_voice_state (line 1083) | def guild_voice_state(
    method edit_profile (line 1102) | def edit_profile(self, payload: Dict[str, Any]) -> Response[user.User]:
    method change_my_nickname (line 1105) | def change_my_nickname(
    method change_nickname (line 1118) | def change_nickname(
    method edit_my_voice_state (line 1132) | def edit_my_voice_state(self, guild_id: Snowflake, payload: Dict[str, ...
    method edit_voice_state (line 1136) | def edit_voice_state(self, guild_id: Snowflake, user_id: Snowflake, pa...
    method edit_member (line 1140) | def edit_member(
    method edit_channel (line 1153) | def edit_channel(
    method edit_voice_channel_status (line 1191) | def edit_voice_channel_status(
    method bulk_channel_update (line 1198) | def bulk_channel_update(
    method create_channel (line 1208) | def create_channel(
    method delete_channel (line 1243) | def delete_channel(
    method start_thread_with_message (line 1253) | def start_thread_with_message(
    method start_thread_without_message (line 1274) | def start_thread_without_message(
    method start_thread_in_forum (line 1296) | def start_thread_in_forum(
    method join_thread (line 1310) | def join_thread(self, channel_id: Snowflake) -> Response[None]:
    method add_user_to_thread (line 1313) | def add_user_to_thread(self, channel_id: Snowflake, user_id: Snowflake...
    method leave_thread (line 1318) | def leave_thread(self, channel_id: Snowflake) -> Response[None]:
    method remove_user_from_thread (line 1321) | def remove_user_from_thread(self, channel_id: Snowflake, user_id: Snow...
    method get_public_archived_threads (line 1325) | def get_public_archived_threads(
    method get_private_archived_threads (line 1336) | def get_private_archived_threads(
    method get_joined_private_archived_threads (line 1347) | def get_joined_private_archived_threads(
    method get_active_threads (line 1357) | def get_active_threads(self, guild_id: Snowflake) -> Response[threads....
    method get_thread_member (line 1361) | def get_thread_member(self, channel_id: Snowflake, user_id: Snowflake)...
    method get_thread_members (line 1365) | def get_thread_members(self, channel_id: Snowflake) -> Response[List[t...
    method create_webhook (line 1371) | def create_webhook(
    method channel_webhooks (line 1388) | def channel_webhooks(self, channel_id: Snowflake) -> Response[List[web...
    method guild_webhooks (line 1391) | def guild_webhooks(self, guild_id: Snowflake) -> Response[List[webhook...
    method get_webhook (line 1394) | def get_webhook(self, webhook_id: Snowflake) -> Response[webhook.Webho...
    method follow_webhook (line 1397) | def follow_webhook(
    method get_guilds (line 1412) | def get_guilds(
    method leave_guild (line 1431) | def leave_guild(self, guild_id: Snowflake) -> Response[None]:
    method get_guild (line 1434) | def get_guild(self, guild_id: Snowflake, *, with_counts: bool = True) ...
    method delete_guild (line 1438) | def delete_guild(self, guild_id: Snowflake) -> Response[None]:
    method create_guild (line 1441) | def create_guild(self, name: str, icon: Optional[str]) -> Response[gui...
    method edit_guild (line 1450) | def edit_guild(self, guild_id: Snowflake, *, reason: Optional[str] = N...
    method edit_guild_mfa_level (line 1479) | def edit_guild_mfa_level(
    method get_template (line 1485) | def get_template(self, code: str) -> Response[template.Template]:
    method guild_templates (line 1488) | def guild_templates(self, guild_id: Snowflake) -> Response[List[templa...
    method create_template (line 1491) | def create_template(self, guild_id: Snowflake, payload: Dict[str, Any]...
    method sync_template (line 1494) | def sync_template(self, guild_id: Snowflake, code: str) -> Response[te...
    method edit_template (line 1497) | def edit_template(self, guild_id: Snowflake, code: str, payload: Dict[...
    method delete_template (line 1507) | def delete_template(self, guild_id: Snowflake, code: str) -> Response[...
    method create_from_template (line 1510) | def create_from_template(self, code: str, name: str, icon: Optional[st...
    method get_bans (line 1518) | def get_bans(
    method get_welcome_screen (line 1535) | def get_welcome_screen(self, guild_id: Snowflake) -> Response[welcome_...
    method edit_welcome_screen (line 1538) | def edit_welcome_screen(
    method get_ban (line 1551) | def get_ban(self, user_id: Snowflake, guild_id: Snowflake) -> Response...
    method get_vanity_code (line 1554) | def get_vanity_code(self, guild_id: Snowflake) -> Response[invite.Vani...
    method change_vanity_code (line 1557) | def change_vanity_code(self, guild_id: Snowflake, code: str, *, reason...
    method get_all_guild_channels (line 1561) | def get_all_guild_channels(self, guild_id: Snowflake) -> Response[List...
    method get_members (line 1564) | def get_members(
    method get_member (line 1576) | def get_member(self, guild_id: Snowflake, member_id: Snowflake) -> Res...
    method prune_members (line 1579) | def prune_members(
    method estimate_pruned_members (line 1597) | def estimate_pruned_members(
    method get_sticker (line 1611) | def get_sticker(self, sticker_id: Snowflake) -> Response[sticker.Stick...
    method list_premium_sticker_packs (line 1614) | def list_premium_sticker_packs(self) -> Response[sticker.ListPremiumSt...
    method get_all_guild_stickers (line 1617) | def get_all_guild_stickers(self, guild_id: Snowflake) -> Response[List...
    method get_guild_sticker (line 1620) | def get_guild_sticker(self, guild_id: Snowflake, sticker_id: Snowflake...
    method create_guild_sticker (line 1625) | def create_guild_sticker(
    method modify_guild_sticker (line 1661) | def modify_guild_sticker(
    method delete_guild_sticker (line 1674) | def delete_guild_sticker(self, guild_id: Snowflake, sticker_id: Snowfl...
    method get_all_custom_emojis (line 1680) | def get_all_custom_emojis(self, guild_id: Snowflake) -> Response[List[...
    method get_custom_emoji (line 1683) | def get_custom_emoji(self, guild_id: Snowflake, emoji_id: Snowflake) -...
    method create_custom_emoji (line 1686) | def create_custom_emoji(
    method delete_custom_emoji (line 1704) | def delete_custom_emoji(
    method edit_custom_emoji (line 1714) | def edit_custom_emoji(
    method get_all_integrations (line 1725) | def get_all_integrations(self, guild_id: Snowflake) -> Response[List[i...
    method create_integration (line 1730) | def create_integration(self, guild_id: Snowflake, type: integration.In...
    method edit_integration (line 1739) | def edit_integration(self, guild_id: Snowflake, integration_id: Snowfl...
    method sync_integration (line 1746) | def sync_integration(self, guild_id: Snowflake, integration_id: Snowfl...
    method delete_integration (line 1753) | def delete_integration(
    method get_audit_logs (line 1762) | def get_audit_logs(
    method get_widget (line 1784) | def get_widget(self, guild_id: Snowflake) -> Response[widget.Widget]:
    method edit_widget (line 1787) | def edit_widget(
    method edit_incident_actions (line 1792) | def edit_incident_actions(self, guild_id: Snowflake, payload: guild.In...
    method create_invite (line 1797) | def create_invite(
    method get_invite (line 1829) | def get_invite(
    method invites_from (line 1847) | def invites_from(self, guild_id: Snowflake) -> Response[List[invite.In...
    method invites_from_channel (line 1850) | def invites_from_channel(self, channel_id: Snowflake) -> Response[List...
    method delete_invite (line 1853) | def delete_invite(self, invite_id: str, *, reason: Optional[str] = Non...
    method get_roles (line 1858) | def get_roles(self, guild_id: Snowflake) -> Response[List[role.Role]]:
    method edit_role (line 1861) | def edit_role(
    method delete_role (line 1869) | def delete_role(self, guild_id: Snowflake, role_id: Snowflake, *, reas...
    method replace_roles (line 1873) | def replace_roles(
    method create_role (line 1883) | def create_role(self, guild_id: Snowflake, *, reason: Optional[str] = ...
    method move_role_position (line 1887) | def move_role_position(
    method add_role (line 1897) | def add_role(
    method remove_role (line 1909) | def remove_role(
    method edit_channel_permissions (line 1921) | def edit_channel_permissions(
    method delete_channel_permissions (line 1935) | def delete_channel_permissions(
    method move_member (line 1943) | def move_member(
    meth
Condensed preview — 247 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (6,576K chars).
[
  {
    "path": ".github/CONTRIBUTING.md",
    "chars": 3470,
    "preview": "## Contributing to discord.py\n\nFirst off, thanks for taking the time to contribute. It makes the library substantially b"
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 27,
    "preview": "open_collective: discordpy\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.yml",
    "chars": 2372,
    "preview": "name: Bug Report\ndescription: Report broken or incorrect behaviour\nlabels: unconfirmed bug\nbody:\n  - type: markdown\n    "
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 339,
    "preview": "blank_issues_enabled: false\ncontact_links:\n  - name: Ask a question\n    about: Ask questions and discuss with other user"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.yml",
    "chars": 1341,
    "preview": "name: Feature Request\ndescription: Suggest a feature for this library\nlabels: feature request\nbody:\n  - type: input\n    "
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "chars": 523,
    "preview": "## Summary\n\n<!-- What is this pull request for? Does it fix any issues? -->\n\n## Checklist\n\n<!-- Put an x inside [ ] to c"
  },
  {
    "path": ".github/workflows/build.yml",
    "chars": 1528,
    "preview": "name: build\n\non:\n  push:\n  pull_request:\n    types: [ opened, reopened, synchronize ]\n\njobs:\n  dists-and-docs:\n    runs-"
  },
  {
    "path": ".github/workflows/crowdin_download.yml",
    "chars": 2442,
    "preview": "name: crowdin download\n\non:\n  schedule:\n    - cron: '0 18 * * 1'\n  workflow_dispatch:\n\njobs:\n  check-environment:\n    ru"
  },
  {
    "path": ".github/workflows/crowdin_upload.yml",
    "chars": 1105,
    "preview": "name: crowdin upload\n\non:\n  workflow_dispatch:\n\njobs:\n  upload:\n    runs-on: ubuntu-latest\n    environment: Crowdin\n    "
  },
  {
    "path": ".github/workflows/lint.yml",
    "chars": 1181,
    "preview": "name: lint\n\non:\n  push:\n  pull_request:\n    types: [ opened, reopened, synchronize ]\n\njobs:\n  check:\n    runs-on: ubuntu"
  },
  {
    "path": ".github/workflows/scripts/close_and_reopen_pr.js",
    "chars": 677,
    "preview": "module.exports = (async function ({github, context}) {\n    const pr_number = process.env.PR_NUMBER;\n    const pr_operati"
  },
  {
    "path": ".github/workflows/test.yml",
    "chars": 766,
    "preview": "name: test\n\non:\n  push:\n  pull_request:\n    types: [ opened, reopened, synchronize ]\n\njobs:\n  pytest:\n    runs-on: ubunt"
  },
  {
    "path": ".gitignore",
    "chars": 146,
    "preview": "*.json\n*.py[cod]\n*.log\n*.egg-info\nvenv\n.venv\ndocs/_build\ndocs/crowdin.py\n*.buildinfo\n*.mp3\n*.m4a\n*.wav\n*.png\n*.jpg\n*.fla"
  },
  {
    "path": ".readthedocs.yml",
    "chars": 252,
    "preview": "version: 2\nformats: []\n\nbuild:\n  os: \"ubuntu-22.04\"\n  tools:\n    python: \"3.8\"\n\nsphinx:\n  configuration: docs/conf.py\n  "
  },
  {
    "path": "LICENSE",
    "chars": 1081,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any person ob"
  },
  {
    "path": "MANIFEST.in",
    "chars": 111,
    "preview": "include README.rst\ninclude LICENSE\ninclude requirements.txt\ninclude discord/bin/*.dll\ninclude discord/py.typed\n"
  },
  {
    "path": "README.ja.rst",
    "chars": 2508,
    "preview": "discord.py\n==========\n\n.. image:: https://discord.com/api/guilds/336642139381301249/embed.png\n   :target: https://discor"
  },
  {
    "path": "README.rst",
    "chars": 2945,
    "preview": "discord.py\n==========\n\n.. image:: https://discord.com/api/guilds/336642139381301249/embed.png\n   :target: https://discor"
  },
  {
    "path": "discord/__init__.py",
    "chars": 1926,
    "preview": "\"\"\"\nDiscord API Wrapper\n~~~~~~~~~~~~~~~~~~~\n\nA basic wrapper for the Discord API.\n\n:copyright: (c) 2015-present Rapptz\n:"
  },
  {
    "path": "discord/__main__.py",
    "chars": 11043,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/_types.py",
    "chars": 1410,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/abc.py",
    "chars": 67989,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/activity.py",
    "chars": 28070,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/app_commands/__init__.py",
    "chars": 448,
    "preview": "\"\"\"\ndiscord.app_commands\n~~~~~~~~~~~~~~~~~~~~~\n\nApplication commands support for the Discord API\n\n:copyright: (c) 2015-p"
  },
  {
    "path": "discord/app_commands/checks.py",
    "chars": 18083,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/app_commands/commands.py",
    "chars": 108811,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/app_commands/errors.py",
    "chars": 19214,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/app_commands/installs.py",
    "chars": 7142,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/app_commands/models.py",
    "chars": 39804,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/app_commands/namespace.py",
    "chars": 13049,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/app_commands/transformers.py",
    "chars": 32349,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/app_commands/translator.py",
    "chars": 10739,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/app_commands/tree.py",
    "chars": 50679,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/appinfo.py",
    "chars": 19666,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/asset.py",
    "chars": 16581,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/audit_logs.py",
    "chars": 38829,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/automod.py",
    "chars": 26966,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/backoff.py",
    "chars": 3751,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/bin/COPYING",
    "chars": 1487,
    "preview": "Copyright (c) 1994-2013 Xiph.Org Foundation and contributors\n\nRedistribution and use in source and binary forms, with or"
  },
  {
    "path": "discord/channel.py",
    "chars": 118610,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/client.py",
    "chars": 96092,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/colour.py",
    "chars": 14488,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/components.py",
    "chars": 20691,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/context_managers.py",
    "chars": 3032,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/embeds.py",
    "chars": 22722,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/emoji.py",
    "chars": 8574,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/enums.py",
    "chars": 25525,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/errors.py",
    "chars": 8952,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/__init__.py",
    "chars": 437,
    "preview": "\"\"\"\ndiscord.ext.commands\n~~~~~~~~~~~~~~~~~~~~~\n\nAn extension module to facilitate creation of bot commands.\n\n:copyright:"
  },
  {
    "path": "discord/ext/commands/_types.py",
    "chars": 2638,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/bot.py",
    "chars": 53045,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/cog.py",
    "chars": 31753,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/context.py",
    "chars": 40536,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/converter.py",
    "chars": 48031,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/cooldowns.py",
    "chars": 9721,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/core.py",
    "chars": 89554,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/errors.py",
    "chars": 35758,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/flags.py",
    "chars": 24350,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/help.py",
    "chars": 58014,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/hybrid.py",
    "chars": 37412,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/parameters.py",
    "chars": 9279,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/commands/view.py",
    "chars": 6185,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ext/tasks/__init__.py",
    "chars": 29643,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/file.py",
    "chars": 5442,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/flags.py",
    "chars": 65432,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/gateway.py",
    "chars": 36168,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/guild.py",
    "chars": 155790,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/http.py",
    "chars": 96364,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/integrations.py",
    "chars": 13334,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/interactions.py",
    "chars": 48325,
    "preview": "# -*- coding: utf-8 -*-\n\n\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, fre"
  },
  {
    "path": "discord/invite.py",
    "chars": 20857,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/member.py",
    "chars": 43292,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/mentions.py",
    "chars": 5592,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/message.py",
    "chars": 95454,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/mixins.py",
    "chars": 1485,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/object.py",
    "chars": 3720,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/oggparse.py",
    "chars": 3654,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/opus.py",
    "chars": 16376,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/partial_emoji.py",
    "chars": 7954,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/permissions.py",
    "chars": 33311,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/player.py",
    "chars": 29618,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/poll.py",
    "chars": 17714,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/py.typed",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "discord/raw_models.py",
    "chars": 19877,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/reaction.py",
    "chars": 9611,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/role.py",
    "chars": 18200,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/scheduled_event.py",
    "chars": 23629,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/shard.py",
    "chars": 20866,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/sku.py",
    "chars": 7385,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/stage_instance.py",
    "chars": 6498,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/state.py",
    "chars": 77408,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/sticker.py",
    "chars": 16189,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/team.py",
    "chars": 5012,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/template.py",
    "chars": 9423,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/threads.py",
    "chars": 32848,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/__init__.py",
    "chars": 149,
    "preview": "\"\"\"\ndiscord.types\n~~~~~~~~~~~~~~\n\nTypings for the Discord API\n\n:copyright: (c) 2015-present Rapptz\n:license: MIT, see LI"
  },
  {
    "path": "discord/types/activity.py",
    "chars": 2735,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/appinfo.py",
    "chars": 2470,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/audit_log.py",
    "chars": 8523,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/automod.py",
    "chars": 4051,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/channel.py",
    "chars": 4937,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/command.py",
    "chars": 6457,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/components.py",
    "chars": 3517,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/embed.py",
    "chars": 2329,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/emoji.py",
    "chars": 1528,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/gateway.py",
    "chars": 9005,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/guild.py",
    "chars": 5589,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/integration.py",
    "chars": 2288,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/interactions.py",
    "chars": 7936,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/invite.py",
    "chars": 2755,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/member.py",
    "chars": 2125,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/message.py",
    "chars": 4863,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/poll.py",
    "chars": 2374,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/role.py",
    "chars": 1761,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/scheduled_event.py",
    "chars": 3294,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/sku.py",
    "chars": 1640,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/snowflake.py",
    "chars": 1182,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/sticker.py",
    "chars": 2260,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/team.py",
    "chars": 1561,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/template.py",
    "chars": 1609,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/threads.py",
    "chars": 2454,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/user.py",
    "chars": 1757,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/voice.py",
    "chars": 2268,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/webhook.py",
    "chars": 1978,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/welcome_screen.py",
    "chars": 1460,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/types/widget.py",
    "chars": 1883,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ui/__init__.py",
    "chars": 308,
    "preview": "\"\"\"\ndiscord.ui\n~~~~~~~~~~~\n\nBot UI Kit helper for the Discord API\n\n:copyright: (c) 2015-present Rapptz\n:license: MIT, se"
  },
  {
    "path": "discord/ui/button.py",
    "chars": 11811,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ui/dynamic.py",
    "chars": 8170,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ui/item.py",
    "chars": 5387,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ui/modal.py",
    "chars": 7043,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ui/select.py",
    "chars": 44197,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ui/text_input.py",
    "chars": 8332,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/ui/view.py",
    "chars": 26103,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/user.py",
    "chars": 18201,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/utils.py",
    "chars": 42392,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/voice_client.py",
    "chars": 19639,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/voice_state.py",
    "chars": 27582,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/webhook/__init__.py",
    "chars": 182,
    "preview": "\"\"\"\ndiscord.webhook\n~~~~~~~~~~~~~~\n\nWebhook support\n\n:copyright: (c) 2015-present Rapptz\n:license: MIT, see LICENSE for "
  },
  {
    "path": "discord/webhook/async_.py",
    "chars": 71127,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/webhook/sync.py",
    "chars": 43501,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "discord/welcome_screen.py",
    "chars": 7532,
    "preview": "# -*- coding: utf-8 -*-\n\n\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, fre"
  },
  {
    "path": "discord/widget.py",
    "chars": 10426,
    "preview": "\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2015-present Rapptz\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "docs/Makefile",
    "chars": 7064,
    "preview": "# Makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS    =\nSPHINXBUILD "
  },
  {
    "path": "docs/_static/codeblocks.css",
    "chars": 10603,
    "preview": "/* light theme: default */\n.highlight .hll { background-color: #ffffcc }\n.highlight  { background: #f0f0f0; }\n.highlight"
  },
  {
    "path": "docs/_static/copy.js",
    "chars": 1161,
    "preview": "const COPY = \"content_copy\";\nconst COPIED = \"done\";\n\nconst copy = async (obj) => {\n  // <span class=\"copy\"><span class=\""
  },
  {
    "path": "docs/_static/custom.js",
    "chars": 2768,
    "preview": "'use-strict';\n\nlet activeModal = null;\nlet bottomHeightThreshold, sections;\nlet hamburgerToggle;\nlet mobileSearch;\nlet s"
  },
  {
    "path": "docs/_static/icons.css",
    "chars": 201,
    "preview": "@font-face {\n    font-family: 'Custom Icons';\n    font-style: normal;\n    font-weight: 400;\n    src: url('icons.woff') f"
  },
  {
    "path": "docs/_static/scorer.js",
    "chars": 2506,
    "preview": "'use-strict';\n\nlet queryBeingDone = null;\nlet pattern = null;\n\nconst escapedRegex = /[-\\/\\\\^$*+?.()|[\\]{}]/g;\nfunction e"
  },
  {
    "path": "docs/_static/settings.js",
    "chars": 2551,
    "preview": "'use-strict';\n\nlet settingsModal;\n\nclass Setting {\n  constructor(name, defaultValue, setter) {\n    this.name = name;\n   "
  },
  {
    "path": "docs/_static/sidebar.js",
    "chars": 3848,
    "preview": "class Sidebar {\n  constructor(element) {\n    this.element = element;\n    this.activeLink = null;\n\n    this.element.addEv"
  },
  {
    "path": "docs/_static/style.css",
    "chars": 27415,
    "preview": "/*\nThis theme was created from scratch.\nHistorically however, thanks to:\n- Alabaster for being a good base\n  - Which tha"
  },
  {
    "path": "docs/_templates/genindex.html",
    "chars": 755,
    "preview": "{%- extends \"basic/genindex.html\" %}\n\n{% block body %}\n  {{ super() }}\n  <!-- Inject some JavaScript to convert the inde"
  },
  {
    "path": "docs/_templates/gettext/message.pot_t",
    "chars": 879,
    "preview": "# SOME DESCRIPTIVE TITLE.\n# Copyright (C) {{ copyright }}\n# This file is distributed under the same license as the {{ pr"
  },
  {
    "path": "docs/_templates/layout.html",
    "chars": 9214,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scal"
  },
  {
    "path": "docs/_templates/relations.html",
    "chars": 28,
    "preview": "<!-- purposefully empty -->\n"
  },
  {
    "path": "docs/api.rst",
    "chars": 143226,
    "preview": ".. currentmodule:: discord\n\nAPI Reference\n===============\n\nThe following section outlines the API of discord.py.\n\n.. not"
  },
  {
    "path": "docs/conf.py",
    "chars": 11926,
    "preview": "#\n# discord.py documentation build configuration file, created by\n# sphinx-quickstart on Fri Aug 21 05:43:30 2015.\n#\n# T"
  },
  {
    "path": "docs/crowdin.yml",
    "chars": 941,
    "preview": "# -*- coding: utf-8 -*-\n\nproject_id: \"362783\"\napi_token_env: CROWDIN_API_KEY\n\nfiles:\n  - source: /_build/locale/**/*.pot"
  },
  {
    "path": "docs/discord.rst",
    "chars": 3665,
    "preview": ":orphan:\n\n.. _discord-intro:\n\nCreating a Bot Account\n========================\n\nIn order to work with the library and the"
  },
  {
    "path": "docs/ext/commands/api.rst",
    "chars": 21707,
    "preview": ".. currentmodule:: discord\n\nAPI Reference\n===============\n\nThe following section outlines the API of discord.py's comman"
  },
  {
    "path": "docs/ext/commands/cogs.rst",
    "chars": 5776,
    "preview": ".. currentmodule:: discord\n\n.. _ext_commands_cogs:\n\nCogs\n======\n\nThere comes a point in your bot's development when you "
  },
  {
    "path": "docs/ext/commands/commands.rst",
    "chars": 47142,
    "preview": ".. currentmodule:: discord\n\n.. _ext_commands_commands:\n\nCommands\n==========\n\nOne of the most appealing aspects of the co"
  },
  {
    "path": "docs/ext/commands/extensions.rst",
    "chars": 2676,
    "preview": ".. currentmodule:: discord\n\n.. _ext_commands_extensions:\n\nExtensions\n=============\n\nThere comes a time in the bot develo"
  },
  {
    "path": "docs/ext/commands/index.rst",
    "chars": 629,
    "preview": ".. _discord_ext_commands:\n\n``discord.ext.commands`` -- Bot commands framework\n=========================================="
  },
  {
    "path": "docs/ext/tasks/index.rst",
    "chars": 5377,
    "preview": ".. _discord_ext_tasks:\n\n``discord.ext.tasks`` -- asyncio.Task helpers\n=================================================="
  },
  {
    "path": "docs/extensions/attributetable.py",
    "chars": 9721,
    "preview": "from __future__ import annotations\nimport importlib\nimport inspect\nimport re\nfrom typing import Dict, List, NamedTuple, "
  },
  {
    "path": "docs/extensions/builder.py",
    "chars": 5289,
    "preview": "from sphinx.builders.html import StandaloneHTMLBuilder\nfrom sphinx.builders.gettext import MessageCatalogBuilder, I18nBu"
  },
  {
    "path": "docs/extensions/colour_preview.py",
    "chars": 1233,
    "preview": "from __future__ import annotations\nfrom typing import Dict, Any\n\nfrom sphinx.util.docutils import SphinxDirective\nfrom d"
  },
  {
    "path": "docs/extensions/details.py",
    "chars": 1740,
    "preview": "from docutils.parsers.rst import Directive\nfrom docutils.parsers.rst import states, directives\nfrom docutils.parsers.rst"
  },
  {
    "path": "docs/extensions/exception_hierarchy.py",
    "chars": 1006,
    "preview": "from docutils.parsers.rst import Directive\nfrom docutils.parsers.rst import states, directives\nfrom docutils.parsers.rst"
  },
  {
    "path": "docs/extensions/nitpick_file_ignorer.py",
    "chars": 724,
    "preview": "import logging\n\nfrom sphinx.application import Sphinx\nfrom sphinx.util import logging as sphinx_logging\n\n\nclass NitpickF"
  },
  {
    "path": "docs/extensions/resourcelinks.py",
    "chars": 1411,
    "preview": "# Credit to sphinx.ext.extlinks for being a good starter\n# Copyright 2007-2020 by the Sphinx team\n# Licensed under BSD.\n"
  },
  {
    "path": "docs/faq.rst",
    "chars": 17836,
    "preview": ":orphan:\n\n.. currentmodule:: discord\n.. _faq:\n\nFrequently Asked Questions\n===========================\n\nThis is a list of"
  },
  {
    "path": "docs/index.rst",
    "chars": 2074,
    "preview": ".. discord.py documentation master file, created by\n   sphinx-quickstart on Fri Aug 21 05:43:30 2015.\n   You can adapt t"
  },
  {
    "path": "docs/intents.rst",
    "chars": 10380,
    "preview": ":orphan:\n\n.. currentmodule:: discord\n.. versionadded:: 1.5\n.. _intents_primer:\n\nA Primer to Gateway Intents\n============"
  },
  {
    "path": "docs/interactions/api.rst",
    "chars": 19157,
    "preview": ".. currentmodule:: discord\n\nInteractions API Reference\n============================\n\nThe following section outlines the "
  },
  {
    "path": "docs/intro.rst",
    "chars": 3197,
    "preview": ":orphan:\n\n.. currentmodule:: discord\n\n.. _intro:\n\nIntroduction\n==============\n\nThis is the documentation for discord.py,"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/api.po",
    "chars": 1125864,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2024-03-26 03:41+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/discord.po",
    "chars": 6594,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/ext/commands/api.po",
    "chars": 402776,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/ext/commands/cogs.po",
    "chars": 8062,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/ext/commands/commands.po",
    "chars": 58045,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/ext/commands/extensions.po",
    "chars": 4613,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/ext/commands/index.po",
    "chars": 1372,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/ext/tasks/index.po",
    "chars": 3945,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/faq.po",
    "chars": 23522,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/index.po",
    "chars": 3945,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/intents.po",
    "chars": 17113,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/interactions/api.po",
    "chars": 298269,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/intro.po",
    "chars": 4830,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/logging.po",
    "chars": 3582,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2024-03-26 03:41+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/migrating.po",
    "chars": 117534,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/migrating_to_async.po",
    "chars": 15157,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/migrating_to_v1.po",
    "chars": 80988,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/quickstart.po",
    "chars": 4674,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/sphinx.po",
    "chars": 3138,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/version_guarantees.po",
    "chars": 3528,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2023-06-21 01:17+000"
  },
  {
    "path": "docs/locale/ja/LC_MESSAGES/whats_new.po",
    "chars": 168079,
    "preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: discordpy\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2024-03-26 03:41+000"
  },
  {
    "path": "docs/logging.rst",
    "chars": 3452,
    "preview": ":orphan:\n\n.. currentmodule:: discord\n.. versionadded:: 0.6.0\n.. _logging_setup:\n\nSetting Up Logging\n===================\n"
  }
]

// ... and 47 more files (download for full content)

About this extraction

This page contains the full source code of the GutaShow/discord.py-library GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 247 files (5.6 MB), approximately 1.5M tokens, and a symbol index with 4787 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!