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
veez music bot is a telegram music bot project, allow you to play music on voice chat group telegram.

?? Veez Music Bot Music bot for playing music on telegram voice chat group. Requirements ?? FFmpeg NodeJS nodesource.com Python 3.7+ PyTgCalls ?? Get

levina 143 Jun 19, 2022
veez music is a telegram music bot project, allow you to play music on voice chat group telegram.

?? VEEZ MUSIC BOT Veez Music is a telegram bot project that's allow you to play music on telegram voice chat group. Requirements ?? FFmpeg NodeJS node

levina 23 Aug 29, 2021
ELiza music is a telegram music bot project, allow you to play music on voice chat group telegram.

❤️ ?????????? ?????????? ❤️ Unmaintained. The new repo of @MrsElizaRobot is private. (It is no longer based on this source code. The completely rewrit

Team Eliza 2 Dec 8, 2022
A Discord Bot - has a few commands. Built using python - Discord.py - RIP.

Discord_Bot A Discord Bot has been built here. It is capable of running a few commands. The below present screenshot should suffice in terms of explai

Manab Kumar Biswas 1 May 22, 2022
Discord music bot using discord.py, slash commands, and yt-dlp.

bop Discord music bot using discord.py, slash commands, and yt-dlp. Features Play music from YouTube videos and playlists Queue system with shuffle Sk

Hizkia Felix 3 Aug 11, 2022
MusicBot is the original Discord music bot written for Python 3.5+, using the discord.py library

The original MusicBot for Discord (formerly SexualRhinoceros/MusicBot)

Just Some Bots 2.9k Jan 2, 2023
SongLink Discord Bot - Discord bot to share music links easily

SongLink_Discord_Bot Discord bot to share music links easily. Take a link from y

Edgar Lefevre 4 Feb 18, 2022
A discord token nuker With loads of options that will screw an account up real bad, also has inbuilt massreport, GroupChat Spammer and Token/Password/Creditcard grabber and so much more!

Installation | Important | Changelogs | Discord NOTE: Hazard is not finished! You can expect bugs, crashes, and non-working functions. Please make an

Rdimo 470 Aug 9, 2022
Acid's Utilities is a bot for my Discord server that alerts when I go live, welcomes new users, has some awesome games and so much more!

Acid's Utilities Acid's Utilities is a bot for my Discord server that alerts when I go live, welcomes new users, has some awesome games and so much mo

AcidFilms (Fin Stuart) 3 Nov 19, 2021
A discord nuking tool made by python, this also has nuke accounts, inbuilt Selfbot, Massreport, Token Grabber, Nitro Sniper and ALOT more!

Disclaimer: Rage Multi Tool was made for Educational Purposes This project was created only for good purposes and personal use. By using Rage, you agr

†† 50 Jul 19, 2022
JAKYM, Just Another Konsole YouTube-Music. A command line based Youtube music player written in Python with spotify and youtube playlist support

Just Another Konsole YouTube-Music Overview I wanted to create this application so that I could use the command line to play music easily. I often pla

Mayank Jha 73 Jan 1, 2023
A Telegram Music Tag Editor Bot that can remove almost all usernames in the music tags and add own username instead.

Music Tag Editor Bot A Telegram Music Tag Editor Bot that can remove almost all usernames in the music tags and add own username instead. It can also

null 14 Oct 21, 2022
A discord bot for checking what linked profiles a user has to their Ubisoft account

ubisoft_discord_profiles A Discord bot for checking what linked profiles a user has to their Ubisoft account. This can be setup using an enviromental

Andrei 1 Dec 17, 2021
A multipurpose, semi-modular Discord bot written in Python with the new discord.py module.

Discord.py Reaction Bot MIRAI KURIYAMA A multipurpose, semi-modular Discord bot written in Python with the new discord.py module. Installing dependenc

null 1 Dec 2, 2021
VC-Music , Playing music without bot.

VC-Userbot A Telegram Userbot to play or streaming Audio and Video songs / files in Telegram Voice Chats. It's made with PyTgCalls and Pyrogram Requir

RioProjectX 8 Aug 4, 2022
Music bot for playing music on telegram voice chat group.

Somali X Music ?? Music bot for playing music on telegram voice chat group. Requirements FFmpeg NodeJS nodesource.com Python 3.8+ or Higher PyTgCalls

Abdisamad Omar Mohamed 4 Dec 1, 2021
this is an op music pyrogram music bot.

amanrajputpytgcallmusic this is an op music pyrogram music bot..... this bot user music bot can play music without being admin...... TG-MusicPlayer A

null 2 Dec 27, 2021
ANKIT-OS/TG-MUSIC-PLAYER a special repository. Its Is A Telegram Bot To Play To Play Music In Voice Chat

?? ?? TG MUSIC PLAYER ?? ?? The owner would not be responsible for any kind of bans due to the bot. • ⚡ INSTALLING ⚡ • • ??️ Lᴀɴɢᴜᴀɢᴇs Aɴᴅ Tᴏᴏʟs ?? •

ANKIT KUMAR 1 Dec 27, 2021