add new opfer sound

This commit is contained in:
ChUrl
2021-03-24 20:59:46 +01:00
parent dff2783a5c
commit f1b7140e2d
2 changed files with 20 additions and 1 deletions

21
bot.py
View File

@ -50,6 +50,7 @@ class HeidiClient(discord.Client):
### Voicelines
self.matchers["sag kein Foto$"] = self.say_kein_foto
self.matchers["sag Opfer"] = self.say_opfer
### Helpers ------------------------------------------------------------------------------------
@ -208,7 +209,25 @@ class HeidiClient(discord.Client):
voice_client.play(audio_source)
while voice_client.is_playing():
asyncio.sleep(1)
await asyncio.sleep(1)
await voice_client.disconnect()
async def say_opfer(self, message):
"""
sag Opfer ("Opfer")
"""
voice_channel = message.author.voice.channel
if voice_channel == None:
return
voice_client = await voice_channel.connect()
audio_source = discord.FFmpegPCMAudio("sounds/opfer.mp3")
voice_client.play(audio_source)
while voice_client.is_playing():
await asyncio.sleep(1)
await voice_client.disconnect()

BIN
sounds/opfer.mp3 Normal file

Binary file not shown.