1
0
Fork 0
mirror of https://gitlab.jonasled.de/jonasled/discordbot synced 2024-08-01 15:04:39 +02:00

remove duck and wrong sound

This commit is contained in:
Jonas Leder 2020-04-10 14:01:39 +02:00
parent bc5b0554b8
commit d3b46fa119
3 changed files with 0 additions and 20 deletions

20
bot.py
View file

@ -186,26 +186,6 @@ async def leaderboard(ctx):
embed = discord.Embed(title="Leaderboard" , description=message)#make the response Box
await ctx.message.channel.send(embed=embed)#print the ressponse box
@bot.command(pass_context=True, brief="joins your current voicechat and makes a wrong sound")
async def wrong(ctx):#this function joins the current voicechat of the user and plays the "wrong.mp3" file
channel = ctx.author.voice.channel#get the current voicechat the user is in
await channel.connect()#connect to this chat
voice = ctx.voice_client#make a voice client variable (needed to playx audio)
voice.play(discord.FFmpegPCMAudio("wrong.mp3"))#start to play the audio file
while voice.is_playing():#wait until the file is finished
sleep(0.1)#if we don't wait here for a moment the bot starts lagging
await ctx.message.guild.voice_client.disconnect()#if the file is finished playing, leave the voicechat
@bot.command(pass_context=True, brief="joins your current voicechat and makes a dock sound")
async def duck(ctx):#this function joins the current voicechat of the user and plays the "duck.mp3" file
channel = ctx.author.voice.channel#get the current voicechat the user is in
await channel.connect()#connect to this chat
voice = ctx.voice_client#make a voice client variable (needed to playx audio)
voice.play(discord.FFmpegPCMAudio("duck.mp3"))#start to play the audio file
while voice.is_playing():#wait until the file is finished
sleep(0.1)#if we don't wait here for a moment the bot starts lagging
await ctx.message.guild.voice_client.disconnect()#if the file is finished playing, leave the voicechat
@bot.command(pass_context=True, brief="prints the ping time of the bot")
async def ping(ctx):#prints the ping and the time the bot needed to process this command
now = datetime.utcnow()#get the current time

BIN
duck.mp3

Binary file not shown.

BIN
wrong.mp3

Binary file not shown.