Skip to content

Music Extension with Lavalink and Wavelink.py #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
May 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7c0cbf6
Update db.py
GitGinocchio Apr 5, 2025
2478c8b
Merge branch 'main' into GGsBot-Music-Extension
GitGinocchio Apr 5, 2025
8072f3a
commit fix
GitGinocchio Apr 5, 2025
53b61e3
Merge branch 'GGsBot-Music-Extension' of https://github.com/GitGinocc…
GitGinocchio Apr 5, 2025
3170ce3
fixed commit issue (maybe)
GitGinocchio Apr 5, 2025
8019854
Update db.py
GitGinocchio Apr 5, 2025
1b4d8e5
Update system.py
GitGinocchio Apr 5, 2025
4f6f8c2
Music extension with Lavalink and Wavelink
GitGinocchio Apr 6, 2025
290b9a7
Update requirements.txt
GitGinocchio Apr 6, 2025
2d1d92a
Update requirements.txt
GitGinocchio Apr 6, 2025
c97e178
Update src/bot/commands/music/MusicUI.py
GitGinocchio Apr 6, 2025
b50e376
Update src/utils/classes.py
GitGinocchio Apr 6, 2025
5aea455
MiniPlayer minor buttons
GitGinocchio Apr 6, 2025
9fd76d3
Mini Player ui and events
GitGinocchio Apr 7, 2025
45687d0
wavelink player update and minor changes
GitGinocchio Apr 7, 2025
0592151
Update Music.py
GitGinocchio Apr 7, 2025
0c294d8
emojis and minor changes
GitGinocchio Apr 7, 2025
e03d73d
custom emojis, wavelink VoiceClient fix (maybe) and minor changes
GitGinocchio Apr 10, 2025
02ce066
Update notes.txt
GitGinocchio Apr 11, 2025
5623ecf
emojis.py and more MiniPlayer's buttons
GitGinocchio Apr 11, 2025
0aefdbe
Merge branch 'main' into GGsBot-Music-Extension
GitGinocchio Apr 11, 2025
7a239e8
Merge branch 'main' into GGsBot-Music-Extension
GitGinocchio Apr 12, 2025
a9c9429
switched music messages to ephemeral
GitGinocchio Apr 12, 2025
5c136aa
Merge branch 'main' into GGsBot-Music-Extension
GitGinocchio Apr 18, 2025
bcdf2af
Merge branch 'main' into GGsBot-Music-Extension
GitGinocchio Apr 20, 2025
8a0bd4f
Merge branch 'main' into GGsBot-Music-Extension
GitGinocchio Apr 21, 2025
15a84d9
Merge branch 'main' into GGsBot-Music-Extension
GitGinocchio Apr 21, 2025
dfdcb36
Merge branch 'dev' into GGsBot-Music-Extension
GitGinocchio Apr 22, 2025
51015c8
Merge branch 'dev' into GGsBot-Music-Extension
GitGinocchio Apr 22, 2025
eaaab13
Merge branch 'dev' into GGsBot-Music-Extension
GitGinocchio Apr 23, 2025
62142d2
Merge branch 'dev' into GGsBot-Music-Extension
GitGinocchio Apr 23, 2025
25a79f6
Merge branch 'dev' into GGsBot-Music-Extension
GitGinocchio Apr 23, 2025
3679982
Merge branch 'dev' into GGsBot-Music-Extension
GitGinocchio Apr 23, 2025
ccf01f6
Merge branch 'dev' into GGsBot-Music-Extension
GitGinocchio Apr 23, 2025
6283236
Merge branch 'dev' into GGsBot-Music-Extension
GitGinocchio Apr 25, 2025
92e48d7
Merge branch 'dev' into GGsBot-Music-Extension
GitGinocchio Apr 25, 2025
5a2568a
chore: added music queue and history and minor changes
GitGinocchio May 18, 2025
ee80f2c
Merge branch 'dev' into GGsBot-Music-Extension
GitGinocchio May 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .dev/notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ colori del bot:
- Modificare l'estensione verify per far si che gli utenti non possano accedere ai contenuti del server fino a quando la richiesta non e' stata accettata dai moderatori ecc.

# How to create a disable slash_command
https://stackoverflow.com/questions/78211436/discord-py-check-if-slash-command-exists
https://stackoverflow.com/questions/78211436/discord-py-check-if-slash-command-exists

Ricreare un logger con una configurazione json
- https://github.com/mCodingLLC/VideosSampleCode/tree/master/videos/135_modern_logging
6 changes: 6 additions & 0 deletions config/config.jsonc.template
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
],
"cookiefile": "./data/cookies/ytdlcookies.txt"
}
},
"lavalink" : {
"nodes" : [
]
}
},

Expand Down Expand Up @@ -97,6 +101,8 @@

"db" : "./data/database.db",
"db_script" : "./config/database.sql",
"db_migrations" : "./config/migrations.sql",


"chatbot_templates" : "./data/chatbot-templates/",

Expand Down
3 changes: 3 additions & 0 deletions config/config.test.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
],
"cookiefile": "./data/cookies/ytdlcookies.txt"
}
},
"lavalink" : {
"nodes" : []
}
},

Expand Down
36 changes: 1 addition & 35 deletions config/migrations.sql
Original file line number Diff line number Diff line change
@@ -1,36 +1,2 @@
-- This file is used to update the database structure to the latest version before using it.
-- EDIT ONLY IF YOU KNOW WHAT YOU ARE DOING!

PRAGMA foreign_keys = OFF;

ALTER TABLE users RENAME TO old_users;
ALTER TABLE extensions RENAME TO old_extensions;

CREATE TABLE users (
guild_id INTEGER,
user_id INTEGER,
level INTEGER,
config JSON,
PRIMARY KEY (user_id, guild_id),
FOREIGN KEY (guild_id) REFERENCES guilds (guild_id) ON DELETE CASCADE
);

CREATE TABLE extensions (
guild_id INTEGER,
config JSON,
extension_id TEXT,
enabled BOOLEAN,
PRIMARY KEY (guild_id, extension_id),
FOREIGN KEY (guild_id) REFERENCES guilds (guild_id) ON DELETE CASCADE
);

INSERT INTO users (guild_id, user_id, level, config)
SELECT guild_id, user_id, level, config FROM old_users;

INSERT INTO extensions (guild_id, config, extension_id, enabled)
SELECT guild_id, config, extension_id, enabled FROM old_extensions;

DROP TABLE old_users;
DROP TABLE old_extensions;

PRAGMA foreign_keys = ON;
-- EDIT ONLY IF YOU KNOW WHAT YOU ARE DOING!
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ aiosignal==1.3.2
aiosqlite==0.21.0
annotated-types==0.7.0
anyio==4.9.0
async-timeout==5.0.1
asyncio==3.4.3
attrs==25.3.0
blinker==1.9.0
Expand All @@ -18,6 +19,7 @@ click==8.1.8
cloudflare==4.1.0
colorama==0.4.6
comtypes==1.4.10
discord.py==2.5.2
distro==1.9.0
Flask==3.1.1
frozenlist==1.6.0
Expand Down Expand Up @@ -54,6 +56,7 @@ spotipy==2.25.1
urllib3==2.4.0
typing_extensions==4.13.2
valo_api==2.1.0
wavelink==3.4.1
websockets==15.0.1
Werkzeug==3.1.3
yarl==1.20.0
Expand Down
9 changes: 5 additions & 4 deletions src/bot/commands/general/Greetings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ async def on_member_join(self, member : nextcord.Member):
)

embed.set_thumbnail(url=(member.avatar.url if member.avatar else member.default_avatar.url))

if channel: await channel.send(embed=embed)
except ExtensionException as e:
pass
else:
await channel.send(embed=embed)

@commands.Cog.listener()
async def on_member_remove(self, member : nextcord.Member):
Expand All @@ -61,10 +61,11 @@ async def on_member_remove(self, member : nextcord.Member):
)

embed.set_thumbnail(url=(member.avatar.url if member.avatar else member.default_avatar.url))

if channel:
await channel.send(embed=embed)
except ExtensionException as e:
pass
else:
await channel.send(embed=embed)

def setup(bot : commands.Bot):
bot.add_cog(Greetings(bot))
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import asyncio
import os



class MusicApi:
def __init__(self, loop : asyncio.AbstractEventLoop):
self.yt = YoutubeExtension(loop=loop,params=config['music']['youtube']['ytdl_params'])
Expand Down
Loading
Loading