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
Yet another discord-BOT

Note I have not added comments to the initial code as it is for my educational purpose. Use This is the code for a discord-BOT API py-cord-2.0.0a4178+

IRONMELTS 1 Dec 18, 2021
A discord bot that autobans blacklisted users by ID and Names

AutoBan A discord bot that autobans blacklisted users by ID and Names Getting Started Dependencies disnake @ git+https://github.com/DisnakeDev/disnake

Jason Martin 0 Oct 02, 2022
Python bindings to the Syncthing REST interface.

python-syncthing Python bindings to the Syncthing REST interface. Python API Documentation Syncthing Syncthing REST Documentation Syncthing Forums $ p

Blake VandeMerwe 64 Aug 13, 2022
Python script to download WAX transactions

WAXtax Python script to download WAX transactions WAXtax uses the CoinGecko API and the WAX Blockchain History API to download csvs for each account y

SixPM Software 11 Oct 09, 2022
Fastest Pancakeswap Sniper BOT TORNADO CASH 2022-V1 (MAC WINDOWS ANDROID LINUX)

Fastest Pancakeswap Sniper BOT TORNADO CASH 2022-V1 (MAC WINDOWS ANDROID LINUX) ⭐️ AUTO BUY TOKEN ON LAUNCH AFTER ADD LIQUIDITY ⭐️ ⭐️ Support Uniswap

Crypto Trader 7 Jan 31, 2022
This is a simple Python bot to identify sentiments in tweets

Twitter-Sentiment 👋 Hi There! 📱 This is a simple Python bot to identify sentiments in tweets 👨‍💻 This project was made for study, and pratice. You

Guilherme Silva 1 Oct 28, 2021
Repositório para meu Discord Bot pessoal

BassetinhoBot Escrevi o código usando o Python 3.8.3 e até agora não tive problemas rodando nas versões mais recentes. Repositório para o Discord Bot

Vinícius Bassete 1 Jan 04, 2022
`python-jamf` is a library for connecting to a Jamf Server that maps directly to the Jamf Pro Classic API.

`python-jamf` is a library for connecting to a Jamf Server that maps directly to the Jamf Pro Classic API. It is the basis for the `jctl` tool to automate patch management & packages and many other i

University of Utah, Marriott Library, Apple Support 38 Dec 13, 2022
Super simple anti-spam Discord bot

AutoAntiRaidBot Super simple anti-spam Discord bot. Will automatically kick any member with an account made under 1 day ago, and will ban any member w

Kainoa Kanter 6 Jun 27, 2022
🤖 Chegg answers requested and sent by the Discord BOT to the targeted user.

Chegg BOT Description "I believe that open-source resources are a must for everyone around. Especially in the field of education. As Chegg c

Vusal Ismayilov 33 Aug 20, 2021
Announces when a web3 wallet receives a token

excitare_cito v2.0 by Bogdan Vaida ([email protected]) Announces wh

1 Nov 30, 2021
A Simple Telegram Maths Calculator Bot

Calculator-Bot-v1 A Simple Telegram Maths Calculator Bot Demo BOT LINK: Variables Variables Required Variables API_HASH: Get

ᗪᗩᖇK ✞Oᖇᗪ 1 Dec 18, 2021
unofficial source of the discord bot, “haunting.” created by: vorqz, vert, & Veltz

hauntingSRC unofficial source of the discord bot, “haunting.” created by: vorqz, vert, & Veltz reasoning: creators skidded the most of this bot and do

Vast 11 Nov 04, 2022
An API serving data on all creatures, monsters, materials, equipment, and treasure in The Legend of Zelda: Breath of the Wild

Hyrule Compendium API An API serving data on all creatures, monsters, materials, equipment, and treasure in The Legend of Zelda: Breath of the Wild. B

Aarav Borthakur 116 Dec 01, 2022
LyricsGenius: a Python client for the Genius.com API

LyricsGenius: a Python client for the Genius.com API lyricsgenius provides a simple interface to the song, artist, and lyrics data stored on Genius.co

KevinChunye 2 Jun 30, 2022
Bancos de Dados Relacionais (SQL) na AWS com Amazon RDS.

Bancos de Dados Relacionais (SQL) na AWS com Amazon RDS Explorando o Amazon RDS, um serviço de provisionamente e gerenciamento de banco de dados relac

Lucas Magalhães 1 Dec 05, 2021
Asynchronous and also synchronous non-official QvaPay client for asyncio and Python language.

Asynchronous and also synchronous non-official QvaPay client for asyncio and Python language. This library is still under development, the interface could be changed.

Leynier Gutiérrez González 8 Sep 18, 2021
Webb-Tracker-Bot - This is a discord bot that displays current progress of the James Webb Space Telescope.

Webb-Tracker-Bot - This is a discord bot that displays current progress of the James Webb Space Telescope.

Copperbotte 1 Jan 05, 2022
Unirest in Python: Simplified, lightweight HTTP client library.

Unirest for Python Unirest is a set of lightweight HTTP libraries available in multiple languages, built and maintained by Mashape, who also maintain

Kong 432 Dec 21, 2022