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
The official Python library for the Plutto API

Plutto Ruby SDK This library will help you easily integrate Plutto API to your software, making your developer life a little bit more enjoyable. Insta

Plutto 3 Nov 23, 2021
An Open-Source Discord bot created to provide basic functionality which should be in every discord guild. We use this same bot with additional configurations for our guilds.

A Discord bot completely written to be taken from the source and built according to your own custom needs. This bot supports some core features and is

Tesseract Coding 14 Jan 11, 2022
A Dm Bot, also knows as Mass DM bot which can send one message to All of the Users in a Specific Server!

Discord DM Bot discord.py 1.7.2 python 3.9.5 asyncio 3.4.3 Installation Cloud Host Tutorial uploaded in YouTube, watch it by clicking here. Local Host

hpriyam8 7 Mar 24, 2022
An API wrapper for the file.io web service.

🗃️ File.io An API wrapper for the file.io web service. Install $ pip3 install fileio or

nkot56297 1 Dec 18, 2021
A simple Discord Mass-Ban that's still working with Member Scraper.

Mass-Ban [!] This was made for education / you can use for revenge. Please don't skid it. [!] If you want to use it, please use member scraper before

WoahThatsHot 1 Nov 20, 2021
Ark API Wrapper in Python

Pythark Ark API Wrapper in Python. Built with Python Requests Installation Pythark uses Arky to create a new transaction, if you want to use this feat

Jolan 14 Mar 11, 2021
This is a unofficial library for making bots in rubika.

rubika this is a unofficial library for making bots in rubika using this library you can make your own0 rubika bot and control that those bots that ma

Bahman 50 Jan 02, 2023
A simple Python script using Telethon to log all (or some) messages a user or bot account can see on Telegram.

telegram-logger A simple Python script using Telethon to log all (or some) messages a user or bot account can see on Telegram. Requirements Python 3.6

Richard 13 Oct 06, 2022
Weather Tracker, made with Python using Open Weather API

Weather Tracker Weather Tracker, made with Python using Open Weather API

Sahil Kumar 1 Feb 07, 2022
This Is A Python Program To Showcase Two Modules (Gratient And Fade)

Hellooo, It's PndaBoi Here! This Is A Python Program To Showcase Two Modules (Gratient And Fade). I Really Like Both Of These Modules So I Decided To

PndaBoi! 6 May 31, 2022
Asca - Antiscam Discord Bot With Python

asca Antiscam Discord Bot Asca moderates scammers and deletes scam messages Opti

11 Nov 01, 2022
VideocompBot - This is TG Video Compress BoT. Prouduct By BINARY Tech 💫

VideocompBot - This is TG Video Compress BoT. Prouduct By BINARY Tech 💫

1 Jan 04, 2022
Linky bot, A open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

LinkyBot Linky bot, An open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

AlexyDaCoder 1 Sep 20, 2022
Um simples bot público para todos usarem no discord!

Discord Bot - Código Público Características: Linguagem de Programação: Python Quantidade de comandos: 17 Comandos: Prefixo do bot: O prefixo desse bo

Kevin 3 Dec 31, 2021
Pycord, a maintained fork of discord.py, is a python wrapper for the Discord API

pycord A fork of discord.py. PyCord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Mo

Pycord Development 2.3k Dec 31, 2022
⚡ Simple mass dm selfbot for Discord written in python3.

Zapp Simple mass dm selfbot for Discord written in python3. Warning. This project was made for educational purposes only! I take no responsibility for

Ѵιcнч 34 Nov 01, 2022
Discord Mafia Game Bot using nextcord

Mafia-Bot Discord Mafia Game Bot using nextcord Features Mafia Game Game Replays Installation Run the following command to install required modules: p

Nian 6 Nov 19, 2022
A collection of scripts to steal BTC from Lightning Network enabled custodial services. Only for educational purpose! Share your findings only when design flaws are fixed.

Lightning Network Fee Siphoning Attack LN-fee-siphoning is a collection of scripts to subtract BTC from Lightning Network enabled custodial services b

Reckless_Satoshi 14 Oct 15, 2022
A battle-tested Django 2.1 project template with configurations for AWS, Heroku, App Engine, and Docker.

For information on how to use this project template, check out the wiki. {{ project_name }} Table of Contents Requirements Local Setup Local Developme

Lionheart Software 64 Jun 15, 2022
Console XMPP client in python

poezio Homepage: https://poez.io Forge Page: https://lab.louiz.org/poezio/poezio Poezio is a console Jabber/XMPP client. The initial goal was to provi

48 Dec 19, 2022