Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Rapptz/discord.py
An API wrapper for Discord written in Python.
https://github.com/Rapptz/discord.py
bot discord discord-api discord-bot discord-py python python-3
Last synced: about 1 month ago
JSON representation
An API wrapper for Discord written in Python.
- Host: GitHub
- URL: https://github.com/Rapptz/discord.py
- Owner: Rapptz
- License: mit
- Created: 2015-08-21T22:19:08.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-14T16:56:12.000Z (5 months ago)
- Last Synced: 2024-04-15T08:17:50.357Z (5 months ago)
- Topics: bot, discord, discord-api, discord-bot, discord-py, python, python-3
- Language: Python
- Homepage: http://discordpy.rtfd.org/en/latest
- Size: 19.7 MB
- Stars: 14,204
- Watchers: 261
- Forks: 3,721
- Open Issues: 121
-
Metadata Files:
- Readme: README.ja.rst
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- discord-api-libs - discord.py - An API wrapper for Discord written in Python. (Libraries / Python)
- awesome-discordpy - Discord.py GitHub - Official GitHub repository for Discord.py. (Official Links)
- awesome-discord - discord.py
- awesome-discord - discord.py - Python (💻 API Libraries)
- awesome-ccamel - Rapptz/discord.py - An API wrapper for Discord written in Python. (Python)
- starred - Rapptz/discord.py - An API wrapper for Discord written in Python. (Python)
- best-of-web-python - GitHub - 3% open · ⏱️ 02.06.2024): (Third-party Web APIs)
- awesome-python-resources - Source
- awesome-discord - discord.py
- StarryDivineSky - Rapptz/discord.py
README
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:
returnif 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 commandsintents = 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ディレクトリに更に多くのサンプルがあります。
リンク
------- `ドキュメント `_
- `公式Discordサーバー `_
- `Discord API `_