Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ChatBot-C3/manualplaylistCreator.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
23 lines (22 sloc)
885 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def manualcreatePlaylist(message): | |
'''Takes the users message as a str and adds in to a list''' | |
print("You humans are strange. Why do you need to listen to Music?\n ERROR! BOT RESETTING!\n"+(".")*10+"\n Sorry about that. Feel free to start adding songs") | |
while True: | |
if message == "done": | |
print("Are you happy with the songs? Y/N") | |
print(playlist) | |
if message == "Y": | |
break | |
if message == "N": | |
print("Your playlist has been reset. Please input your songs") | |
playlist.clear() | |
continue | |
else: | |
print("Song Name: ") | |
playlist = [] | |
playlist.append(message) | |
print("You can now add a name for the playlist: ") | |
playlist.insert(0, message) | |
f = open("playlists.txt", "a") | |
f.write("\n"+playlist) | |
f.close |