committed some changes to the bot

This commit is contained in:
Jellyfishsh 2025-04-18 20:03:37 -07:00
parent 7a70bc2c23
commit 91e4dd66d5
2 changed files with 7 additions and 21 deletions

View File

@ -2,12 +2,7 @@ FROM python:3.12.10-alpine
RUN apk add --no-cache \ RUN apk add --no-cache \
ffmpeg \ ffmpeg \
opus \ opus \
opus-dev \ opus-dev
build-base \
libffi-dev \
openssl-dev \
musl-dev \
python3-dev
WORKDIR /usr/src/app WORKDIR /usr/src/app
@ -17,7 +12,4 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY . . COPY . .
RUN python -c "import discord.opus as opus; opus.load_opus('/usr/lib/libopus.so.0.10.1'); print('✅ Opus loaded:', opus.is_loaded())"
CMD python bot.py CMD python bot.py

18
bot.py
View File

@ -196,24 +196,18 @@ async def search(interaction: discord.Interaction, title: str):
# Get the data # Get the data
data = await make_request(url, params, interaction) data = await make_request(url, params, interaction)
await interaction.followup.send("stuff")
print(data)
return
if not data: if not data:
await interaction.followup.send(f"No song found matching `{title}`.") await interaction.followup.send(f"No song found matching `{title}`.")
return return
songs = data.get("Items", [])
lines = [] lines = []
print(data.get("Items", []))
return
# for song in songs: for song in data:
# title = song.get("Title") title = song.get("Name")
# artist = song.get("AlbumArtist", ["Unknown Artist"]) artist = song.get("AlbumArtist", ["Unknown Artist"])
# lines.append(f"**{title}** by *{artist}*") lines.append(f"**{title}** by *{artist}*")
# await interaction.followup.send("\n".join(lines)) await interaction.followup.send("\n".join(lines))
# end search ----- # end search -----
@ -222,7 +216,7 @@ async def search(interaction: discord.Interaction, title: str):
@bot.tree.command(name="disconnect", description="Disconnects from current voice channel!") @bot.tree.command(name="disconnect", description="Disconnects from current voice channel!")
async def disconnect(interaction: discord.Interaction): async def disconnect(interaction: discord.Interaction):
if interaction.guild.voice_client == None: if interaction.guild.voice_client == None:
await interaction.response.send_message("I am not in any voice channel!") await interaction.followup.send("I am not in any voice channel!")
return return
await interaction.guild.voice_client.disconnect() await interaction.guild.voice_client.disconnect()