Update pagebot.py

This commit is contained in:
ceb515 2024-02-10 09:50:24 -05:00
parent 708cd6ae71
commit d49030320e

View File

@ -11,14 +11,12 @@ from watchdog.events import FileSystemEventHandler
class MyHandler(FileSystemEventHandler): class MyHandler(FileSystemEventHandler):
def on_created(self, event): def on_created(self, event):
print("New Created!")
if event.is_directory: if event.is_directory:
print("Was a directory")
return return
filepath = event.src_path filepath = event.src_path
filename, file_extension = os.path.splitext(filepath) filename, file_extension = os.path.splitext(filepath)
if file_extension.lower() == '.mp3': if file_extension.lower() == '.mp3':
print("Was an MP3!") print("New MP3!")
mp4_file = convert_to_mp4(filepath) mp4_file = convert_to_mp4(filepath)
client.loop.create_task(upload_to_discord(mp4_file)) client.loop.create_task(upload_to_discord(mp4_file))