1
0
Fork 0
mirror of https://gitlab.jonasled.de/jonasled/discordbot synced 2024-10-03 15:58:51 +02:00

fixed delete on !stop

This commit is contained in:
Jonas Leder 2020-04-10 21:24:03 +02:00
parent ba5ce20e10
commit 22b270f9d4

5
bot.py
View file

@ -9,6 +9,7 @@ from config import *
from requests import get from requests import get
from json import loads from json import loads
from os.path import isfile from os.path import isfile
from os import listdir
from os import rename, remove from os import rename, remove
from youtube_dl import YoutubeDL from youtube_dl import YoutubeDL
from time import time from time import time
@ -472,7 +473,9 @@ async def checkForNextSong():#background task, that runns every seccond and chec
await player.disconnect() await player.disconnect()
player = None player = None
playerServer = None#allow everyone to invite the music bot playerServer = None#allow everyone to invite the music bot
remove("*.mp3")#delete all mp3 files for files in listdir("."):#delete all mp3 files
if files.endswith(".mp3"):
remove(files)
else: else:
playing = True#set playing to true and play the next file playing = True#set playing to true and play the next file
player.play(discord.FFmpegPCMAudio(playerQue[0])) player.play(discord.FFmpegPCMAudio(playerQue[0]))