예제 #1
0
def playlist_list(args):
    if args[0].value in ArgValues.All:
        playlist_list_all()
    else:
        p = bot.get_playlist(args[0].value)
        if p is not None:
            msg = playlist_list_playlist(p)
            bot.report(msg)
        else:
            bot.report("playlist not found")
예제 #2
0
def playlist_create(args):
    name = args[0].value
    if len(args) > 1:
        if args[1].name in Args.From:
            if args[1].value in ArgValues.Queue:
                bot.playlist_create_from_queue(name)
            else:
                p = bot.get_playlist(args[1].value)
                if p is not None:
                    bot.playlist_create_from(name, p)
                else:
                    bot.report("couldn't find playlist")
        else:
            bot.report("specified arguments not correct or missing")
    else:
        bot.playlist_create(name)
예제 #3
0
def playlist_add(args):
    if len(args) > 1:
        toArg = None
        for a in args:
            if a.name in Args.To:
                toArg = a
                break

        if toArg is not None and toArg.value is not None:
            p = bot.get_playlist(toArg.value)
            if p is not None:
                _playlist_add(p, args)
            else:
                bot.report("playlist not found")
        else:
            bot.report("specified arguments not correct or missing")
    else:
        bot.report("not enough Args")
예제 #4
0
def playlist_remove(args):
    if len(args) > 1:
        if args[1].name in Args.From:
            p = bot.get_playlist(args[1].value)
            if p is not None:
                integer = True

                try:
                    index = int(args[0].value)
                except:
                    integer = False
                    bot.report("enter a valid number as argument")

                if integer:
                    bot.playlist_remove(index, p)
            else:
                bot.report("playlist not found")
        else:
            bot.report("specified arguments not correct or missing")
    else:
        bot.report("not enough Args")
예제 #5
0
def playlist_clear(args):
    p = bot.get_playlist(args[0].value)
    if p is not None:
        bot.playlist_clear(p)
    else:
        bot.report("playlist not found")