discordspy-0.1.2
توضیحات
A basic API wrapper for Discords.com
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | discordspy-0.1.2 |
| نام | discordspy |
| نسخه کتابخانه | 0.1.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Jude BC |
| ایمیل نویسنده | jude.version1.0@gmail.com |
| آدرس صفحه اصلی | https://github.com/judev1/discords |
| آدرس اینترنتی | https://pypi.org/project/discordspy/ |
| مجوز | MIT |
# discords.py
The offical Python API wrapper for Discords.com
## Notices
This is the first version with limited coverage of API endpoints, more features, functionality and documentation will be added in the future.
## Installation:
```
pip install discords.py
```
## Features
- Server count posting
- Built-in automatic & interval server count posting
- Built-in voting webhook handler
- Voting & server posting events
## Examples
### Automatic server count posting with event
Autoposting posts the servercount whenever a server is joined/removed while abiding with ratelimits
```py
from discord.ext import commands
import discordspy
bot = commands.Bot("!")
discords = discordspy.Client(bot, DISCORDS_TOKEN, post=discordspy.Post.auto())
@bot.event
async def on_discords_server_post(status):
if status == 200:
print("Posted the server count:", discords.servers())
bot.run(TOKEN)
```
### Interval server count posting every hour and a half
```py
from discord.ext import commands
import discordspy
bot = commands.Bot("!")
post = discordspy.Post.interval(minutes=30, hours=1)
discords = discordspy.Client(bot, DISCORDS_TOKEN, post=post)
@bot.event
async def on_discords_server_post(status):
if status == 200:
print("Posted the server count:", discords.servers())
bot.run(TOKEN)
```
### Webhook voting event
**IMPORTANT:** Your webhook url must end with `/discordswebhook` if you wish to use a different path, please specify it using the path argument inside the webhook method `path="/customwebhook"`, by default the port is 8080
```py
from discord.ext import commands
import discordspy
bot = commands.Bot("!")
discords = discordspy.Client(bot, DISCORDS_TOKEN)
discords.webhook(port=2296, auth="password")
@bot.event
async def on_discords_server_post(status):
if status == 200:
print("Posted the server count:", discords.servers())
bot.run(TOKEN)
```
نحوه نصب
نصب پکیج whl discordspy-0.1.2:
pip install discordspy-0.1.2.whl
نصب پکیج tar.gz discordspy-0.1.2:
pip install discordspy-0.1.2.tar.gz