Skip to main content

Extra tools for discord.py developers

Project description

Discord

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

pip install discordplus

This library will have dev/beta builds on the github, to install them you can use

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

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

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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discordplus-1.4.1.tar.gz (33.0 kB view hashes)

Uploaded source

Built Distribution

discordplus-1.4.1-py3-none-any.whl (36.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page