mirror of
https://gitlab.jonasled.de/jonasled/discordbot
synced 2024-11-20 18:21:28 +01:00
documentation
This commit is contained in:
parent
989663c3e5
commit
a5fa480f43
1 changed files with 5 additions and 5 deletions
10
bot.py
10
bot.py
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue