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 \
ffmpeg \
opus \
opus-dev \
build-base \
libffi-dev \
openssl-dev \
musl-dev \
python3-dev
opus-dev
WORKDIR /usr/src/app
@ -17,7 +12,4 @@ RUN pip install --no-cache-dir -r requirements.txt
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

18
bot.py
View File

@ -196,24 +196,18 @@ async def search(interaction: discord.Interaction, title: str):
# Get the data
data = await make_request(url, params, interaction)
await interaction.followup.send("stuff")
print(data)
return
if not data:
await interaction.followup.send(f"No song found matching `{title}`.")
return
songs = data.get("Items", [])
lines = []
print(data.get("Items", []))
return
# for song in songs:
# title = song.get("Title")
# artist = song.get("AlbumArtist", ["Unknown Artist"])
# lines.append(f"**{title}** by *{artist}*")
# await interaction.followup.send("\n".join(lines))
for song in data:
title = song.get("Name")
artist = song.get("AlbumArtist", ["Unknown Artist"])
lines.append(f"**{title}** by *{artist}*")
await interaction.followup.send("\n".join(lines))
# 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!")
async def disconnect(interaction: discord.Interaction):
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
await interaction.guild.voice_client.disconnect()