discord.py


Namediscord.py JSON
Version 2.4.0 PyPI version JSON
download
home_pageNone
SummaryA Python wrapper for the Discord API
upload_time2024-06-22 01:20:22
maintainerNone
docs_urlNone
authorRapptz
requires_python>=3.8
licenseThe 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.
keywords
VCS
bugtrack_url
requirements aiohttp
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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>`_

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "discord.py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Rapptz",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/39/af/80cab4015722d3bee175509b7249a11d5adf77b5ff4c27f268558079d149/discord_py-2.4.0.tar.gz",
    "platform": null,
    "description": "discord.py\r\n==========\r\n\r\n.. image:: https://discord.com/api/guilds/336642139381301249/embed.png\r\n   :target: https://discord.gg/r3sSKJJ\r\n   :alt: Discord server invite\r\n.. image:: https://img.shields.io/pypi/v/discord.py.svg\r\n   :target: https://pypi.python.org/pypi/discord.py\r\n   :alt: PyPI version info\r\n.. image:: https://img.shields.io/pypi/pyversions/discord.py.svg\r\n   :target: https://pypi.python.org/pypi/discord.py\r\n   :alt: PyPI supported Python versions\r\n\r\nA modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.\r\n\r\nKey Features\r\n-------------\r\n\r\n- Modern Pythonic API using ``async`` and ``await``.\r\n- Proper rate limit handling.\r\n- Optimised in both speed and memory.\r\n\r\nInstalling\r\n----------\r\n\r\n**Python 3.8 or higher is required**\r\n\r\nTo install the library without full voice support, you can just run the following command:\r\n\r\n.. code:: sh\r\n\r\n    # Linux/macOS\r\n    python3 -m pip install -U discord.py\r\n\r\n    # Windows\r\n    py -3 -m pip install -U discord.py\r\n\r\nOtherwise to get voice support you should run the following command:\r\n\r\n.. code:: sh\r\n\r\n    # Linux/macOS\r\n    python3 -m pip install -U \"discord.py[voice]\"\r\n\r\n    # Windows\r\n    py -3 -m pip install -U discord.py[voice]\r\n\r\n\r\nTo install the development version, do the following:\r\n\r\n.. code:: sh\r\n\r\n    $ git clone https://github.com/Rapptz/discord.py\r\n    $ cd discord.py\r\n    $ python3 -m pip install -U .[voice]\r\n\r\n\r\nOptional Packages\r\n~~~~~~~~~~~~~~~~~~\r\n\r\n* `PyNaCl <https://pypi.org/project/PyNaCl/>`__ (for voice support)\r\n\r\nPlease 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:\r\n\r\n* libffi-dev (or ``libffi-devel`` on some systems)\r\n* python-dev (e.g. ``python3.8-dev`` for Python 3.8)\r\n\r\nQuick Example\r\n--------------\r\n\r\n.. code:: py\r\n\r\n    import discord\r\n\r\n    class MyClient(discord.Client):\r\n        async def on_ready(self):\r\n            print('Logged on as', self.user)\r\n\r\n        async def on_message(self, message):\r\n            # don't respond to ourselves\r\n            if message.author == self.user:\r\n                return\r\n\r\n            if message.content == 'ping':\r\n                await message.channel.send('pong')\r\n\r\n    intents = discord.Intents.default()\r\n    intents.message_content = True\r\n    client = MyClient(intents=intents)\r\n    client.run('token')\r\n\r\nBot Example\r\n~~~~~~~~~~~~~\r\n\r\n.. code:: py\r\n\r\n    import discord\r\n    from discord.ext import commands\r\n\r\n    intents = discord.Intents.default()\r\n    intents.message_content = True\r\n    bot = commands.Bot(command_prefix='>', intents=intents)\r\n\r\n    @bot.command()\r\n    async def ping(ctx):\r\n        await ctx.send('pong')\r\n\r\n    bot.run('token')\r\n\r\nYou can find more examples in the examples directory.\r\n\r\nLinks\r\n------\r\n\r\n- `Documentation <https://discordpy.readthedocs.io/en/latest/index.html>`_\r\n- `Official Discord Server <https://discord.gg/r3sSKJJ>`_\r\n- `Discord API <https://discord.gg/discord-api>`_\r\n",
    "bugtrack_url": null,
    "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. ",
    "summary": "A Python wrapper for the Discord API",
    "version": "2.4.0",
    "project_urls": {
        "Documentation": "https://discordpy.readthedocs.io/en/latest/",
        "Issue tracker": "https://github.com/Rapptz/discord.py/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23103c44e9331a5ec3bae8b2919d51f611a5b94e179563b1b89eb6423a8f43eb",
                "md5": "c49549b411530ff8dd0c8259f5fbf77f",
                "sha256": "b8af6711c70f7e62160bfbecb55be699b5cb69d007426759ab8ab06b1bd77d1d"
            },
            "downloads": -1,
            "filename": "discord.py-2.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c49549b411530ff8dd0c8259f5fbf77f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 1125988,
            "upload_time": "2024-06-22T01:20:19",
            "upload_time_iso_8601": "2024-06-22T01:20:19.764598Z",
            "url": "https://files.pythonhosted.org/packages/23/10/3c44e9331a5ec3bae8b2919d51f611a5b94e179563b1b89eb6423a8f43eb/discord.py-2.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39af80cab4015722d3bee175509b7249a11d5adf77b5ff4c27f268558079d149",
                "md5": "5c5d106a417a07c1a915da5de82cebbd",
                "sha256": "d07cb2a223a185873a1d0ee78b9faa9597e45b3f6186df21a95cec1e9bcdc9a5"
            },
            "downloads": -1,
            "filename": "discord_py-2.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5c5d106a417a07c1a915da5de82cebbd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1027707,
            "upload_time": "2024-06-22T01:20:22",
            "upload_time_iso_8601": "2024-06-22T01:20:22.474405Z",
            "url": "https://files.pythonhosted.org/packages/39/af/80cab4015722d3bee175509b7249a11d5adf77b5ff4c27f268558079d149/discord_py-2.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-22 01:20:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Rapptz",
    "github_project": "discord.py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "aiohttp",
            "specs": [
                [
                    "<",
                    "4"
                ],
                [
                    ">=",
                    "3.7.4"
                ]
            ]
        }
    ],
    "lcname": "discord.py"
}
        
Elapsed time: 0.58383s