A module to complement discord.py that has Music, Paginator and Levelling.

Overview

discord-super-utils

A modern python module including many useful features that make discord bot programming extremely easy.

Features

  • Modern leveling manager.
  • Modern Music/Audio playing manager.
  • Modern Database manager (SQLite).
  • Modern Paginator.
  • Modern Reaction Manager.

Examples

Leveling Example

import discordSuperUtils
import sqlite3
from discord.ext import commands


database = discordSuperUtils.DatabaseManager(sqlite3.connect("database"))
bot = commands.Bot(command_prefix='-')
LevelingManager = discordSuperUtils.LevelingManager(database, 'xp', bot)


@bot.event
async def on_ready():
    print('Leveling manager is ready.')


@LevelingManager.event()
async def on_level_up(message, member_data):
    await message.reply(f"You are now level {member_data['rank']}")


@bot.command()
async def rank(ctx):
    member_data = LevelingManager.get_member(ctx.author)
    await ctx.send(f'You are currently level **{member_data["rank"]}**, with **{member_data["xp"]}** XP.')

bot.run("token")

Leveling Manager Example

Playing Example

from discordSuperUtils import MusicManager
from discord.ext import commands


bot = commands.Bot(command_prefix='-')
MusicManager = MusicManager(bot)


@MusicManager.event
async def on_play(ctx, player):
    await ctx.send(f"Now playing: {player.title}")

@bot.event
async def on_ready():
    print('Music manager is ready.', bot.user)



@bot.command()
async def leave(ctx):
    if await MusicManager.leave(ctx):
        await ctx.send("Left Voice Channel Lol Gang Shit")


@bot.command()
async def np(ctx):
    if player := await MusicManager.now_playing(ctx):
        await ctx.send(f"Currently playing: {player}")


@bot.command()
async def join(ctx):
    if await MusicManager.join(ctx):
        await ctx.send("Joined Voice Channel Lol Gang Shit!")


@bot.command()
async def play(ctx, *, query: str):
    player = await MusicManager.create_player(query)
    await MusicManager.queue_add(player=player, ctx=ctx)

    if not await MusicManager.play(ctx):
        await ctx.send("Added to queue")


@bot.command()
async def volume(ctx, volume: int):
    await MusicManager.volume(ctx, volume)

@bot.command()
async def loop(ctx):
    is_loop = await MusicManager.loop(ctx)
    await ctx.send(f"Looping toggled to {is_loop}")

@bot.command()
async def stop(ctx):
    ctx.voice_client.stop()


bot.run("token")

Database Example

import discordSuperUtils
import sqlite3


database = discordSuperUtils.DatabaseManager(sqlite3.connect("database"))
values = database.select(keys=['guild'], table_name='xp', checks=[{'guild': 1}], fetchall=True) 

Paginator Example

import discordSuperUtils
from discord.ext import commands
import discord


bot = commands.Bot(command_prefix='-')


@bot.event
async def on_ready():
    print('Page manager is ready.', bot.user)


@bot.command()
async def paginator(ctx):
    messages = [
        discord.Embed(
            title='Data (1/2)',
            description="Hello world"
        ),
        "Hello world"
    ]

    await discordSuperUtils.PageManager(ctx, messages).run()


bot.run("token")

Reaction Manager Example

import sqlite3
import discord
import discordSuperUtils
from discord.ext import commands

database = discordSuperUtils.DatabaseManager(sqlite3.connect("database"))
bot = commands.Bot(command_prefix='-')
ReactionManager = discordSuperUtils.ReactionManager(database, 'reaction_roles', bot)


@ReactionManager.event()
async def on_reaction_event(guild, channel, message, member, emoji):
    """This event will be run if there isn't a role to add to the member."""

    if ...:
        print("Created ticket.")


@bot.event
async def on_ready():
    print('Reaction manager is ready.', bot.user)


@bot.command()
async def reaction(ctx, message, emoji: str, remove_on_reaction, role: discord.Role = None):
    message = await ctx.channel.fetch_message(message)

    await ReactionManager.create_reaction(ctx.guild, message, role, emoji, remove_on_reaction)


bot.run("token")

More examples are listed in the examples folder.

Support

Comments
  • A full fledged ready to use advance_music_cog.py

    A full fledged ready to use advance_music_cog.py

    This is meant to be a copy and paste cog code for lazy users

    I made the changes based on your suggestions:

    • Added error handlers
    • Changed the parse duration to the DSU bot's
    • Lyrics are handled by the page manager
    • Added a before envoke check to join and play command
    • Added a check if the queue exists for history and queue command.
    • Also added a check if queue/history is an empty list (while playing the first song)
    opened by MG-LSJ 8
  • Level Leaderboard

    Level Leaderboard

    Hello. Im new here :) I just got working leveling bot from this repo but i would like to add a leaderboard of top 10 members, could you tell me how to do it?

    opened by Volverine 6
  • on_play is never dispatched

    on_play is never dispatched

    title is the issue, no matter what I do on_play is never dispatched, now I do have a subclassed version of commands.Cog but that shouldn't matter...right? not sure.

    opened by xFGhoul 2
  • Fixed the manually disconnect issue.

    Fixed the manually disconnect issue.

    If the music is playing and any of the mod/admin disconnect the bot from the voice channel from right click then if you try to play the song again it won't work. But now it will work properly i have tested this

    opened by Ariz-z 2
  • Made the rank card in create_leveling_profile more customizable.

    Made the rank card in create_leveling_profile more customizable.

    • added options to change the color of each element
    • slightly adjusted the size of the outer rectangle in the rank bar
    • adjusted the examples to it image (Though my color theme looks crap)
    opened by MG-LSJ 2
  • [Suggestion] setup.py discord.py changes

    [Suggestion] setup.py discord.py changes

    First of all, thanks for making an amazing library but the one caviat I have is this requires discord.py to be installed and now I'm suggesting either:

    remove discord.py completely from setup.py

    seperate into popular forks so it's like python -m pip install discordSuperUtils[default] (Installs with discord.py) python -m pip install discordSuperUtils[pycord] (installs pycord)

    opened by xFGhoul 1
  • Added Autoplay, Shuffle and previous

    Added Autoplay, Shuffle and previous

    • Added Autoplay, Shuffle and previous
    • Adjusted the requester in now_playing, on_play, queue, and history for autoplayed song
    • Skip vote logic updated for autoplay and autoplayed songs
    opened by MG-LSJ 1
  • fix get_upcoming method

    fix get_upcoming method

    Traceback (most recent call last):
      File "C:\Users\Administrator\Desktop\harinbot\venv\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
        ret = await coro(*args, **kwargs)
      File "C:\Users\Administrator\Desktop\harinbot\cogs\birthday.py", line 96, in upcoming
        guild_upcoming = await self.BirthdayManager.get_upcoming(ctx.guild)
      File "C:\Users\Administrator\Desktop\harinbot\venv\lib\site-packages\discordSuperUtils\birthday.py", line 282, in get_upcoming
        birthdays[birthday] = await birthday.next_birthday()
      File "C:\Users\Administrator\Desktop\harinbot\venv\lib\site-packages\discordSuperUtils\birthday.py", line 84, in next_birthday
        new_date = (await self.birthday_date()).replace(year=current_datetime.year)
      File "C:\Users\Administrator\Desktop\harinbot\venv\lib\site-packages\discordSuperUtils\birthday.py", line 70, in birthday_date
        return datetime.utcfromtimestamp(birthday_data["utc_birthday"])
    TypeError: 'NoneType' object is not subscriptable
    

    Before I fix it got this error. so, fix and I make this pull request

    opened by popop098 0
  • keyerror on yt mix playlist fix

    keyerror on yt mix playlist fix

    yt mixes/radio like: https://www.youtube.com/watch?v=6nxrllqnP2Q&list=RDCLAK5uy_ksEjgm3H_7zOJ_RHzRjN1wY-_FFcs7aAU&start_radio=1&rv=YZAFd9o3RYQ

    idk why the hek 3 commits, tell me if you need it cleaner, will fork again

    opened by zennnez 1
Releases(v0.3.0)
  • v0.3.0(Nov 14, 2021)

  • v0.2.9(Oct 27, 2021)

    What's Changed

    • Fix invitetracker '__initialize_cache' by @popop098 in https://github.com/discordsuperutils/discord-super-utils/pull/27
    • edit typo by @popop098 in https://github.com/discordsuperutils/discord-super-utils/pull/28

    Full Changelog: https://github.com/discordsuperutils/discord-super-utils/compare/v0.2.8...v0.2.9

    Source code(tar.gz)
    Source code(zip)
  • v0.2.8(Oct 14, 2021)

    What's Changed

    • parse_duration by @MG-LSJ in https://github.com/discordsuperutils/discord-super-utils/pull/23
    • Updated the Music Example in Readme.md with the one in example/Music.py by @MG-LSJ in https://github.com/discordsuperutils/discord-super-utils/pull/24
    • Advance music cog updated. by @MG-LSJ in https://github.com/discordsuperutils/discord-super-utils/pull/25
    • fix get_upcoming method by @popop098 in https://github.com/discordsuperutils/discord-super-utils/pull/26

    New Contributors

    • @popop098 made their first contribution in https://github.com/discordsuperutils/discord-super-utils/pull/26

    Full Changelog: https://github.com/discordsuperutils/discord-super-utils/compare/v0.2.6...v0.2.8

    Source code(tar.gz)
    Source code(zip)
  • v0.2.3(Oct 4, 2021)

    Whats Changed?

    Added Lavalink support and playlist saving to MusicManager. The MusicManager Queue (Queuemanager) was also rewritten to support rewinding. ModMail was added and other small bugs were sorted out.

    Spotify song detail image card was also added to Imaging

    Source code(tar.gz)
    Source code(zip)
  • tests1(Oct 3, 2021)

  • v0.2.2(Sep 28, 2021)

    discord-super-utils 0.2.2



    Documentation

    discordSuperUtils 0.2.2 has been released. Incase you have any questions, ask them in our discord server or check out our documentation!

    Changes

    • Added previous method.
    • Bug fixes.
    • More customization in imaging.
    • Added vote_skips attribute to queues.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Sep 24, 2021)

    discord-super-utils 0.2.1



    Documentation

    discordSuperUtils 0.2.1 has been released. Incase you have any questions, ask them in our discord server or check out our documentation!

    Changes

    • Fixed bugs.
    • Memory improvements.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Sep 18, 2021)

    discord-super-utils 0.2.0



    Documentation

    discordSuperUtils 0.2.0 has been released. Incase you have any questions, ask them in our discord server or check out our documentation!

    Changes

    • Moved to new youtube client.
    • Made ffmpegs on demand.
    • Formatted all files in project.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.9(Sep 15, 2021)

    discord-super-utils 0.1.9



    Documentation

    discordSuperUtils 0.1.9 has been released. Incase you have any questions, ask them in our discord server or check out our documentation!

    Changes

    • Fixed major bug in music.
    • Code changes in birthday, command hinter that shouldn't affect users.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.8(Sep 15, 2021)

    discord-super-utils 0.1.8



    Documentation

    discordSuperUtils 0.1.8 has been released. Incase you have any questions, ask them in our discord server or check out our documentation!

    Changes

    • Fixed bugs in music
    • Removed unused methods from music
    • Made leveling account take leveling manager
    Source code(tar.gz)
    Source code(zip)
  • v0.1.7(Sep 13, 2021)

    discord-super-utils 0.1.7



    Documentation

    discordSuperUtils 0.1.7 has been released. Incase you have any questions, ask them in our discord server or check out our documentation!

    Changes

    • Added MessageFilter and SpamManager
    • Fixed looping in music
    • Added many events to music.
    • Added ButtonsPageManager
    • Merged RoleManager with LevelingManager
    • Added duration to music.
    • Added beta slash commands.
    • And many code changes.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.6(Sep 3, 2021)

    discord-super-utils 0.1.6



    Documentation

    discordSuperUtils 0.1.6 has been released. Incase you have any questions, ask them in our discord server or check out our documentation!

    Features

    • Very easy to use and user-friendly.
    • Object Oriented.
    • Modern Leveling Manager.
    • Modern Music/Audio playing manager.
    • Modern Async Database Manager (SQLite, MongoDB, PostgreSQL, MySQL, MariaDB).
    • Modern Paginator.
    • Modern Reaction Manager.
    • Modern Economy Manager.
    • Modern Image Manager (PIL).
    • Modern Invite Tracker.
    • Modern Command Hinter.
    • Modern FiveM Server Parser.
    • Modern Birthday Manager.
    • Modern Prefix Manager.
    • Includes easy to use convertors.
    • Modern spotify client that is optimized for player fetching.
    • Modern Punishment Manager (Kick, Ban, Infractions, Mutes)
    • Modern Template Manager.
    • Modern CogManager that supports usage of managers in discord cogs.

    Changes

    • Added spotify client.
    • Added punishment managers.
    • Added template manager.
    • Bug fixes.
    • Added cog manager.
    Source code(tar.gz)
    Source code(zip)
  • 0.1.4(Aug 15, 2021)

    discord-super-utils 0.1.4



    Documentation

    discordSuperUtils 0.1.4 has been released. Incase you have any questions, ask them in our discord server or check out our documentation!

    Features

    • Modern Leveling Manager.
    • Modern Music/Audio playing manager.
    • Modern Async Database manager (SQLite, MongoDB, PostgreSQL).
    • Modern Paginator.
    • Modern Reaction Manager.
    • Modern Economy Manager.
    • Modern Image Manager (PIL).
    • Modern Invite Tracker.

    Changes

    • Databases are now async.
    • All managers now support new async mode.
    Source code(tar.gz)
    Source code(zip)
  • 0.1.3(Aug 13, 2021)

    discord-super-utils 0.1.3



    Documentation

    discordSuperUtils 0.1.3 has been released. Incase you have any questions, ask them in our discord server or check out our documentation!

    Features

    • Modern Leveling Manager.
    • Modern Music/Audio playing manager.
    • Modern Database manager (SQLite, MongoDB, PostgreSQL).
    • Modern Paginator.
    • Modern Reaction Manager.
    • Modern Economy Manager.
    • Modern Image Manager (PIL).
    • Modern Invite Tracker.

    Changes

    • Added Image Manager
    • Added Invite Manager
    • Added Support to MongoDB and PostgreSQL
    • Added Spotify Playing to Music
    • Fixed self.net bug when accessing leaderboard
    • And much more!
    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Jul 26, 2021)

  • 0.0.9.1(Jul 3, 2021)

  • 0.0.8(Jul 2, 2021)

  • v0.0.7(Jun 30, 2021)

    0.0.7, First Release

    discordSuperUtils is now public!!

    Install using pip install discordSuperUtils

    Current Features:

    • Database Manager
    • Leveling Manager
    • Music Manager
    • Paginator
    • Reaction Manager
    • Documentation
    Source code(tar.gz)
    Source code(zip)
  • 0.0.5(Jun 30, 2021)

    0.0.5, First Release

    discordSuperUtils is now public!!

    Install using pip install discordSuperUtils

    Current Features:

    • Database Manager
    • Leveling Manager
    • Music Manager
    • Paginator
    • Reaction Manager
    • Documentation
    Source code(tar.gz)
    Source code(zip)
  • 0.0.2(Jun 30, 2021)

Owner
Yash
hola
Yash
DragDev Maintained Instance Of discord.py

discord.py - DragDev Flavour A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. The Future of discord.py

DragDev Studios 3 Aug 27, 2022
Just another Shiny and Greninja-ash killing preventor for Myuu

Myuu-Anti-Shiny-Discord-Bot Why I made it? Since, I was legit fed up of NebbyBot's lag (not criticising it), I decided to make my own but in python an

5 Nov 12, 2022
Confirm that files have been uploaded to Backblaze Cloud Backup successfully

Backblaze Backup Checker This Python script compares metadata captured from files within source folders against data parsed from Backblaze Cloud Backu

18 Jul 29, 2022
Account Profiles Dumper for Fortnite.

Fortnite Profile Dumper This program allows you to dump your Fortnite account profiles. How to use it? After starting the FortniteProfileDumper.py, yo

PRO100KatYT 12 Jul 28, 2022
Discord Remote Administration Tool

Discord Remote Administration Tool

Rdimo 82 Aug 15, 2022
discord bot made in discord.py

udeline discord bot made in discord.py, which's main features include: general use server moderation fun commands other cool commands dependencies dis

1 Feb 08, 2022
LHXP・Official "LH - Cyber Security" Discord Leveling-Bot

LHXP・Official "LH - Cyber Security" Discord Leveling-Bot Based on nsde/NOVΛLIX Feature Overview /clear @user Requires admin permission Purges all XP

Felix・onlix 2 Mar 09, 2022
Minecraft checker

This Project checks if a minecraft account is a nfa/sfa account or invalid it also says you if the ip you are using is shadow banned from minecraft (shadow bann is if you send too many login attempts

baum1810 4 Oct 03, 2022
A Discord API Wrapper for Userbots/Selfbots written in Python.

DisCum A simple, easy to use, non-restrictive, synchronous Discord API Wrapper for Selfbots/Userbots written in Python. -using requests and websockets

Liam 450 Dec 27, 2022
A Telegram bot that scrapes websites for available vaccination appointments to notify users. (German)

@dachau_impf_bot 🇬🇧 A Telegram bot to check the contents of https://termin.dachau-med.de for available slots and inform users of the available dates

1 Nov 21, 2021
ro.py is a modern, asynchronous Python 3 wrapper for the Roblox API.

GitHub | Discord | PyPI | Documentation | Examples | License Overview Welcome to ro.py! ro.py is an asynchronous, object-oriented wrapper for the Robl

ro.py 81 Dec 26, 2022
ServiceX DID Finder Girder

ServiceX_DID_Finder_Girder Access datasets for ServiceX from yt Hub Finding datasets This DID finder is designed to take a collection id (https://gird

1 Dec 07, 2021
A Twitter Bot that retweets and likes tweets with the hashtag #girlscriptwoc and #girlscript, and also follows the user.

GirlScript Winter of Contributing Twitter Bot A Twitter Bot that retweets and likes tweets with the hashtag #girlscriptwoc and #girlscript, and also f

Pranay Gupta 9 Dec 15, 2022
:spaghetti: Pastas is an open-source Python framework for the analysis of hydrological time series.

Pastas: Analysis of Groundwater Time Series Pastas: what is it? Pastas is an open source python package for processing, simulating and analyzing groun

Pastas 277 Dec 29, 2022
Twitter bot that finds new friends in Twitter.

PythonTwitterBot Twitter Bot Thats Find New Friends pip install textblob pip install tweepy pip install googletrans check requirements.txt file Env

IbukiYoshida 4 Aug 11, 2021
Cytotron - A unique discord bot like never before. Add it to your server to keep it active, motiviated, and amazing!!

Cytotron - Take your server to the next level Most of the details are in the website. Go to https://cytotron-bot.gq for more information. If that link

LeviathanProgramming 6 Jun 13, 2021
Discord bot developed by Delhi University Student Community!

DUSC-Bot Discord bot developed by Delhi University Student Community! Libraries Used Pycord - Documentation Features Can purge messages in bulk Drop-D

professor 1 Jan 29, 2022
Stock Market Insights is a Dashboard that gives the 360 degree view of the particular company stock

fedora-easyfix A collection of self-contained and well-documented issues for newcomers to start contributing with How to setup the local development e

Ganesh N 3 Sep 10, 2021
An unofficial library for discord components (under-development)

discord-components An unofficial library for discord components (under-development) Welcome! Discord components are cool, but discord.py will support

11 Jun 14, 2021
Playing around with the slack api for learning purposes

SlackBotTest Playing around with the slack api for learning purposes and getting people to contribute Reason for this Project: Bots are very versatile

1 Nov 24, 2021