discordplus-1.4.1
توضیحات
Extra tools for discord.py developers
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | discordplus-1.4.1 |
| نام | discordplus |
| نسخه کتابخانه | 1.4.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Ashenguard |
| ایمیل نویسنده | Ashenguard@agmdev.com |
| آدرس صفحه اصلی | https://github.com/ashenguard/discord-plus |
| آدرس اینترنتی | https://pypi.org/project/discordplus/ |
| مجوز | MIT License |




[](https://discord.gg/6exsySK)
# Discord Plus
This library is additional tools for python discord developers where they can reduce the effort they need to develop a bot.
This library contains tools, database and pre-made commands and events.
> **Note:** This is still under development, But it is usable.
## How to install
To install just use following command
```shell
pip install discordplus
```
This library will have dev/beta builds on the github, to install them you can use
```shell
pip install --upgrade git+https://github.com/Ashengaurd/DiscordPlus.git
```
***
By installing this library following libraries and their dependencies will be installed too.
> Discord.py
> Flask - Used for web API
> Requests - Used for posting data on top.gg
> Json & Yaml - Used as Not SQL Database managers
# Simple Examples
`BotPlus` extended class of Bot
`Premessage` a message ready to be sent
```python
from discordplus import BotPlus, PreMessage
bot = BotPlus('!', log_channel_id=1234567890)
## Library which has several useful cogs and listeners and you can activate them
bot.library.activate_prefix_send_on_ping()
bot.library.activate_api(__name__, host='0.0.0.0', port=8080, vote_auth='It is valid')
bot.library.activate_topgg_poster('TopGGLongAPITokenWhichYouNeverShareWithAnyIndividual')
## Load all extensions recursive
bot.load_extensions('./cogs', './cogs_part_2')
## Vote event
@bot.event
async def vote(data):
premessage = PreMessage(f'User {data["user"]} has voted!')
await bot.log(premessage)
## Anything else you will do with a simple bot including run it :)
```
`CogPlus` extended class of Cog with tags
```python
from discordplus import CogPlus, BotPlus
@CogPlus.beta
class beta_cog(CogPlus):
"""A Beta cog which will be loaded"""
pass
@CogPlus.beta
@CogPlus.disabled
class disabled_beta_cog(CogPlus):
"""A Disabled Beta cog which will not be loaded"""
pass
@CogPlus.disabled
class disabled_cog(CogPlus):
"""A Disabled cog which will not be loaded"""
pass
class cog(CogPlus):
"""A normal cog which will be loaded"""
pass
def setup(bot: BotPlus):
bot.add_cog(beta_cog()) # Will warn and load
bot.add_cog(disabled_cog()) # Will warn and skip
bot.add_cog(disabled_beta_cog()) # Will warn and skip
bot.add_cog(cog()) # Just loads ;)
```
Emoji library with all emojis in discord:
```python
from discordplus.emotes import *
...
async def bar(channel):
await channel.send(People.get('smile')) # All categories of discord official emojis
await channel.send(Emotes.grinning) # Emotes contains all useful emojis as variables for easier access
await channel.send(Emotes.numbers[1]) # All 10 emojis of numbers accessible
await channel.send(Emotes.letters['a']) # All 26 emojis of letters accessible
```
نیازمندی
| مقدار | نام |
|---|---|
| - | pyyaml |
| - | flask |
| - | requests |
| - | discord-py-interactions |
| - | discord.py |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl discordplus-1.4.1:
pip install discordplus-1.4.1.whl
نصب پکیج tar.gz discordplus-1.4.1:
pip install discordplus-1.4.1.tar.gz