fix voice
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM python:3.10.1-slim-buster
|
||||
RUN apt-get update -y
|
||||
RUN apt-get install -y ffmpeg libopus0
|
||||
WORKDIR /app
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip3 install -r requirements.txt
|
||||
|
4
bot.py
4
bot.py
@ -219,8 +219,10 @@ class HeidiClient(discord.Client):
|
||||
print("Error: Caller not in channel!")
|
||||
return
|
||||
|
||||
soundfile = message.content.split(" ")[-1]
|
||||
|
||||
voice_client = await voice_channel.connect()
|
||||
audio_source = discord.FFmpegPCMAudio("/sounds/" + message + ".mp3") # only works from docker
|
||||
audio_source = discord.FFmpegPCMAudio("/sounds/" + soundfile + ".mp3") # only works from docker
|
||||
voice_client.play(audio_source)
|
||||
|
||||
while voice_client.is_playing():
|
||||
|
Reference in New Issue
Block a user