File tree Expand file tree Collapse file tree 11 files changed +1127
-1394
lines changed
Expand file tree Collapse file tree 11 files changed +1127
-1394
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ LAVALINK_PASSWORD=youshallnotpass
1919# You can use a random string for OPENAI_API_KEY if you are using an custom OpenAI-compatible API server
2020OPENAI_API_KEY =
2121OPENAI_MODEL_NAME = gpt-3.5-turbo
22- # Default to OpenAI API endpoint
22+ # Default to official OpenAI API endpoint
2323OPENAI_BASE_URL = http://localhost:5000/v1
2424
2525# Google API key
Original file line number Diff line number Diff line change @@ -37,14 +37,14 @@ plugins:
3737lavalink :
3838 plugins :
3939 # See https://github.com/lavalink-devs/youtube-source for the latest version of the plugin
40- - dependency : " dev.lavalink.youtube:youtube-plugin:1.15 .0"
40+ - dependency : " dev.lavalink.youtube:youtube-plugin:1.18 .0"
4141 server :
4242 password : " youshallnotpass"
4343 sources :
4444 youtube : false
4545` ` `
4646
47- 6 . To use the AI chat command, set ` OPENAI_API_KEY` and `OPENAI_MODEL_NAME` in `.env`.
47+ 1 . To use the AI chat command, set ` OPENAI_API_KEY` and `OPENAI_MODEL_NAME` in `.env`.
4848
4949# # Docker Compose
5050
@@ -110,15 +110,3 @@ The list below only shows a subset of commands which I think need further explan
110110 1. `docker exec -it <container-name-or-id> /bin/bash`
111111 2. `./.venv/bin/gallery-dl oauth:pixiv`
112112 3. Follow the instructions given
113-
114- # ## `/connect_music`
115-
116- - Establish a new connection to the Lavalink server.
117-
118- Use this command if the music player is not working while the Lavalink server is up.
119-
120- Do NOT use this command while the bot is playing music!
121-
122- - Lavalink can be unstable (probably because YouTube changes their Innertube API often).
123-
124- If the music player consistently produce errors, go to the Lavalink discord to check if there is a hotfix version of Lavalink.
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ services:
1717 # You can use a random string for OPENAI_API_KEY if you are using an custom OpenAI-compatible API server
1818 OPENAI_API_KEY :
1919 OPENAI_MODEL_NAME : gpt-3.5-turbo
20- # Default to OpenAI API endpoint
20+ # Default to official OpenAI API endpoint
2121 OPENAI_BASE_URL : http://localhost:5000/v1
2222 # Google API key
2323 # Required for Youtube live subscriptions
@@ -37,7 +37,7 @@ services:
3737 LAVALINK_SERVER_PASSWORD : youshallnotpass
3838 LAVALINK_SERVER_SOURCES_YOUTUBE : " false"
3939 # See https://github.com/lavalink-devs/youtube-source for the latest version of the plugin
40- LAVALINK_PLUGINS_0_DEPENDENCY : dev.lavalink.youtube:youtube-plugin:1.15 .0
40+ LAVALINK_PLUGINS_0_DEPENDENCY : dev.lavalink.youtube:youtube-plugin:1.18 .0
4141 PLUGINS_YOUTUBE_ENABLED : " true"
4242 PLUGINS_YOUTUBE_CLIENTS_0 : MUSIC
4343 PLUGINS_YOUTUBE_CLIENTS_1 : WEB
Original file line number Diff line number Diff line change @@ -11,11 +11,12 @@ dependencies = [
1111 " discord-py[voice]==2.*" ,
1212 " gallery-dl==1.*" ,
1313 " google-api-python-client==2.*" ,
14+ " lavalink==5.*" ,
1415 " openai==1.*" ,
1516 " pygit2==1.*" ,
1617 " python-dotenv==1.*" ,
1718 " sqlalchemy[asyncio]==2.0.*" ,
18- " wavelink==3.* " ,
19+ " tzdata " ,
1920]
2021
2122[project .scripts ]
@@ -30,5 +31,5 @@ build-backend = "hatchling.build"
3031dev = [" google-api-python-client-stubs" , " ipykernel" , " ruff" ]
3132
3233[tool .pyright ]
33- typeCheckingMode = " strict "
34+ typeCheckingMode = " standard "
3435reportCallInDefaultInitializer = true
Original file line number Diff line number Diff line change 99 ErrorHandler ,
1010 General ,
1111 Meta ,
12- Music ,
1312 AI ,
1413 Subscription ,
14+ Music ,
1515]
1616
1717__all__ = (
1818 "ErrorHandler" ,
1919 "General" ,
2020 "Meta" ,
21- "Music" ,
2221 "AI" ,
2322 "cog_list" ,
2423 "Subscription" ,
24+ "Music" ,
2525)
Original file line number Diff line number Diff line change 1010
1111
1212def check_cooldown_factory (
13- seconds : int = 10 ,
13+ seconds : float = 10 ,
1414) -> ty .Callable [[discord .Interaction ], discord .app_commands .Cooldown | None ]:
1515 """Global cooldown for commands."""
1616
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ def __init__(
2323 self .model_name = os .getenv ("OPENAI_MODEL_NAME" , "" )
2424
2525 @discord .app_commands .command ()
26- @discord .app_commands .checks .dynamic_cooldown (check_cooldown_factory (15 ))
26+ @discord .app_commands .checks .dynamic_cooldown (check_cooldown_factory (1.5 ))
2727 @discord .app_commands .guild_only ()
2828 @discord .app_commands .describe (
2929 message = "Message to the AI." ,
@@ -57,5 +57,5 @@ async def chat(
5757 await ia .followup .send (message [:2000 ])
5858
5959 if len (message ) > 2000 :
60- for split in range (1 , math .ceil (len (message ) / 2000 ) + 1 ):
60+ for split in range (1 , math .ceil (len (message ) / 2000 )):
6161 await ia .followup .send (message [2000 * split : 2000 * (split + 1 )])
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ async def hello(
3232 )
3333
3434 @discord .app_commands .command ()
35- @discord .app_commands .checks .dynamic_cooldown (check_cooldown_factory (2 ))
35+ @discord .app_commands .checks .dynamic_cooldown (check_cooldown_factory (3 ))
3636 @discord .app_commands .guild_only ()
3737 @discord .app_commands .describe (
3838 pixiv_link = "Pixiv image link" ,
You can’t perform that action at this time.
0 commit comments