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
Cloud-native, data onboarding architecture for the Google Cloud Public Datasets program

Public Datasets Pipelines Cloud-native, data pipeline architecture for onboarding datasets to the Google Cloud Public Datasets Program. Overview Requi

Google Cloud Platform 109 Dec 30, 2022
A Simple modular tool to fetch and parse data related to the stock market.

🐒 stonks-o-fetcher A Simple modular tool to fetch and parse data related to the stock market. Getting started For the moment the only source is this

Daniele 23 May 31, 2021
Send OpenWeatherMap alerts (One Call API) to telegram users.

OpenWeatherMap Telegram Alert Send OpenWeatherMap alerts (One Call API) to telegram users. Installation Requirements: $ apt install python3-yaml pytho

Michael Hacker 1 Jun 04, 2022
RevSpotify is a fast, useful telegram bot to have Spotify music on Telegram.

RevSpotify A Telegram Bot that can download music from Spotify RevSpotify is a fast, useful telegram bot to have Spotify music on Telegram. ✨ Features

Alireza Shabani 12 Sep 12, 2022
Discord CTF helper bot for CyberErudites

Eruditus - CTF helper bot Eruditus - CTF helper bot About Eruditus is a Discord CTF helper bot built with Python, it was initially designed to be used

Hafidh 34 Dec 30, 2022
Google Search Results via SERP API pip Python Package

Google Search Results in Python This Python package is meant to scrape and parse search results from Google, Bing, Baidu, Yandex, Yahoo, Home depot, E

SerpApi 254 Jan 05, 2023
A multipurpose Telegram Bot written in Python for mirroring files on the Internet to Google Drive

Mirror Leech Bot Mirror Leech Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive. Ba

1 Jan 01, 2022
ignorant allows you to check if a phone number is used on different sites like snapchat, instagram.

Ignorant For BTC Donations : 1FHDM49QfZX6pJmhjLE5tB2K6CaTLMZpXZ ignorant does not alert the target phone number ignorant allows you to check if a phon

Palenath 513 Dec 31, 2022
Definitive Guide to Creating a SQL Database on Cloud with AWS and Python

Definitive Guide to Creating a SQL Database on Cloud with AWS and Python An easy-to-follow comprehensive guide on integrating Amazon RDS, MySQL Workbe

Kenneth Leung 6 Aug 17, 2022
Telegram-Voice Recoginiton Project (Python)

Telegram-Voice Recoginiton Project (Python) It is a telegram bot that analyses voice messages and convert it to text and reply back response on bot's

Krishnadev P Melevila 1 Jan 28, 2022
Ethone-Selfbot - Open Source Discord Self-Bot, written in discord.py

Ethone SB Table of contents Newest open-source Discord SelfBot with useful commands and easy documentation on how to add your own and change the exist

Ethone 3 Jan 08, 2022
An API wrapper for Discord written in Python.

disnake A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. About disnake All the contributors and develop

557 Jan 05, 2023
An Inline Telegram YouTube Downloader bot with custom, permanent thumbnail support and cancel upload facility. Make your fork now.

Inline-Tube-Mate (YouTube Downloader) An Inline Telegram bot that can download YouTube videos with permanent thumbnail support Bot need to be in Inlin

Renjith Mangal 41 Dec 14, 2022
DaProfiler vous permet d'automatiser vos recherches sur des particuliers basés en France uniquement et d'afficher vos résultats sous forme d'arbre.

A but educatif seulement. DaProfiler DaProfiler vous permet de créer un profil sur votre target basé en France uniquement. La particularité de ce prog

Dalunacrobate 73 Dec 21, 2022
⚔️ Fastest tibia bot API

📝 Description tibia bot api using python ⌨ Development ⚙ Running the app python bot.py ✅ ROADMAP Add confidence to floor level to have more accuracy

Lucas Santos 133 Dec 28, 2022
Python wrapper library for World Weather Online API

pywwo Python wrapper library for World Weather Online API using lxml.objectify How to use from pywwo import * setKey('your_key', 'free') w=LocalWeat

World Weather Online 20 Dec 19, 2022
Enigma simulator with python and clean code.

Enigma simulator with python and clean code.

Mohammad Dori 3 Jul 21, 2022
this repo store a Awoesome telegram bot for protect from your large group from bot attack.

this repo store a Awoesome telegram bot for protect from your large group from bot attack.

Mehran Alam Beigi 2 Jul 22, 2022
Simple Telegram AI Chat bot made using OpenAI and Luna API

Yui Yui, is a simple telegram chat bot made using OpenAI and Luna Chat bot Deployment 👀 Deploying is easy 🤫 ! You can deploy this bot in Heroku or i

I'm Not A Bot #Left_TG 21 Dec 29, 2022
News API consisting various sources from Tanzania

Tanzania News API News API consisting various sources from Tanzania. Fork the project Clone the project git clone https://github.com/username/news-a

Innocent Zenda 6 Oct 06, 2022