1
0
Fork 0
mirror of https://gitlab.jonasled.de/jonasled/discordbot synced 2024-11-20 10:13:03 +01:00

documentation

This commit is contained in:
Jonas Leder 2020-04-11 13:58:47 +02:00
parent 989663c3e5
commit a5fa480f43

10
bot.py
View file

@ -455,13 +455,13 @@ async def stop(ctx):
if files.endswith(".mp3"):
remove(files)
@bot.command(brief="changes the volume of the music bot")
@bot.command(brief="changes the volume of the music bot")#with this command you can change the volume of the music bot
async def volume(ctx, volume : int):
global audioPlayer
if(volume < 0) or (volume > 100):
global audioPlayer#import hte global audio player
if(volume < 0) or (volume > 100):#check if the volume is in a percent range
ctx.message.channel.send("Volume has to be between 0 and 100")
else:
audioPlayer.volume = volume / 100
audioPlayer.volume = volume / 100#change the volume
@ -490,7 +490,7 @@ async def checkForNextSong():#background task, that runns every seccond and chec
else:
playing = True#set playing to true and play the next file
print("playing " + playerQue[0])
audioPlayer = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(playerQue[0]))
audioPlayer = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(playerQue[0]))#convert the audio player to a volume audio player
player.play(audioPlayer)
await sleep(1)#sleep 1 seccond and allo the bot to run different tasks