Giter Club home page Giter Club logo

Comments (1)

robinfriedli avatar robinfriedli commented on June 7, 2024

If you're hosting an instance of botify you could add a script for that like so:

$botify script $identifier=runAll "
def commands = input.split('\\n')
for (def cmdStr : commands) {
    if (cmdStr.isBlank()) {
        continue
    }
    command.run(cmdStr)
}
"
"

then you could do

$botify runAll
queue Empire State Of Mind artist:JAY-Z
queue MONTERO artist:Lil Nas X
queue Sense artist:King Gizz
queue Mars For The Rich
queue Under the Bridge artist:Red
queue Somebody that i used to know artist:gotye

(would change the default $botify prefix to a custom one though ;))

Note that you couldn't run more than 5 commands though as command.run is limited to 5 invocations per script, though if you're hosting your own instance you could change that in the groovyWhitelist.xml file on line 454.

For this specific use case you could also create a script that queues several items separated by comma like so:

$botify script $identifier=queueAll "
def argsRaw = input.split(',')
def args = Arrays.stream(argsRaw).map({s -> s.trim()}).filter({s -> !s.isEmpty()}).collect(Collectors.toList())
if (args.size() > 5) {
    messages.sendError('Cannot select more than 5 items', channel)
    return null
}
for (def arg : args) {
    command.run('queue ' + arg)
}
return null
"

(remove the size check if you change the limit for command.run invocations, that's just the script I use)

then you can do $botify queueAll numb, "$album $spotify $select=1 meteora", in the end

from aiode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.