add first voice line

This commit is contained in:
ChUrl
2021-03-19 20:19:28 +01:00
parent 334171648e
commit dff2783a5c
2 changed files with 25 additions and 0 deletions

25
bot.py
View File

@ -4,6 +4,7 @@ import os
import re
import random
import datetime
import asyncio
from dotenv import load_dotenv
@ -46,6 +47,10 @@ class HeidiClient(discord.Client):
self.matchers["gib Link"] = self.show_link
self.matchers["welche Farbe .+\\?$"] = self.random_color
### Voicelines
self.matchers["sag kein Foto$"] = self.say_kein_foto
### Helpers ------------------------------------------------------------------------------------
def _help_text(self):
@ -187,6 +192,26 @@ class HeidiClient(discord.Client):
choices = ["Rot", "Grün", "Gelb", "Blau", "Lila", "Pink", "Türkis", "Schwarz", "Weiß", "Grau", "Gelb", "Orange", "Olivegrün", "Mitternachtsblau", "Braun", "Tobe"]
await message.channel.send(random.choice(choices))
### Voiceboard ---------------------------------------------------------------------------------
async def say_kein_foto(self, message):
"""
sag kein Foto ("Ich habe heute leider kein Foto für dich")
"""
voice_channel = message.author.voice.channel
if voice_channel == None:
return
voice_client = await voice_channel.connect()
audio_source = discord.FFmpegPCMAudio("sounds/kein_foto.mp3")
voice_client.play(audio_source)
while voice_client.is_playing():
asyncio.sleep(1)
await voice_client.disconnect()
### Automatic Actions --------------------------------------------------------------------------
async def autoreact_to_girls(self, message):

BIN
sounds/kein_foto.mp3 Normal file

Binary file not shown.