Git Product home page Git Product logo

jqbx-bot-plugins's Introduction

JQBX Bot Plugins

Plugins for the bots that live on JQBX (https://www.jqbx.fm/). JQBX lets you play music online through Spotify with anyone, anywhere. Be a virtual dj, and discover new music by listening together in real time.

Feel free to submit a pull request.

JQBX Bot Commands

The latest commands can be seen by sending /help in chat.

Command Description
––––––––––––––––––––––––––––––– –––
/# Try /shrug or a number /3 - by @tjwds
/artist Get the current artist information, if available.
/artist [name] Get a specific artist's information, if available.
/auto-artist Toggle automatic artist info for every new track.
/audiohelp Will try to help you with your audio issues.
/btc Get the current price of Bitcoin
/dadjoke [search] Get a dad joke! Will give a random joke if you do not use a search term. - by @Captian Internet
/down The bot will stop DJing
/fact num [#] Specify a number to get a fact about it, or input nothing for a random number fact. - by @Waddle Bird
/fact today Get a fact about today's date - by @Waddle Bird
/fact year [yyyy] Specify a year to get a fact about that year, or input nothing for a random year. - by @Waddle Bird
/first Get info about the first play of the current track on JQBX. Note: this does not include tracks played by bots, with less than one upvote, or in rooms without a bot.
/first [track uri] Get info about the first play of the track. Ex: /first spotify:track:5A90uRgyQd1M9ZHbwyrgxx
/first-artist Get info about the first play of the current artist.
/firsts Get info about the first play of the current track and the artist.
/github Add custom functionality and plugins, info here
/haha Upvote the last joke told in this room.
/hay Get a list of room ids for walkie-talkie messaging.
/hay [room id] [message] Send a message to another room. Ex: /hay boteshop Hi there
/help Display this message
/inspire Get an AI generated lame inspirational quote image.
/joke The bot will tell you a random user submitted joke. Limited to 1 joke per 3 minutes.
/joke list List your submitted jokes and their votes.
/joke remove [#] Remove a joke you submitted.
/joke submit 'joke' 'punchline' Your joke will be submitted to the joke pool. The best each month will be saved forever. Max 3 jokes per person each month. [Web/Desktop Only] Submit privately with /w @botname /joke submit ...
/joke top Get the top jokesters for the current joke pool.
/lastfm View lastfm url and status.
/me [action] Do something as you. Ex: /me dances
/queue See what the bot's next tracks will be
/queue build Add tracks to the bot's queue
/queue clear Clear the tracks in the bot's queue
/queue help Learn how the bot queue is generated.
/relink The bot will try to find a working link in your region to the current song.
/ro Votes for the bot to rock out (dope) a song. Requires 3 people. - by @Captian Internet
/roulette # Feeling lucky, DJ? # is optional. - thank @tjwds
/skip The bot's turn will be skipped
/stats View room listening stats on last.fm.
/time Displays the local time of anywhere. By @vmednis aka kweakzsz
/top See the top tracks played in this room.
/tv The bot give you a link to the GIFTV page
/up The bot will start DJing
/urban word Get the urban dictionary definition of a word - by @maniexx
/want Get a bot for your room
/weather Display the weather. Usage: /weather [city] - by @tjwds
/wiki [topic] Get a summary from Wikipedia on the topic
/you-here @name Gets last action information for a user in the room
/yt (search) Get a video URL from youtube matching the currently playing song. Using arguments will return a video based on search terms. - by @Captian Internet

JQBX Bot Configuration Commands

The latest commands and a full list of available plugins can be seen by sending /config in chat.

Plugin Commands

Enable and disable plugins with /config plugins. Do not include the [ and ] characters.

Command Description
––––––––––––––––––––––––––––––– –––
/config plugins help See this help message and list of commands
/config plugins enable [name] Enabled a plugin named, name. Do not include the [ and ] characters.
/config plugins disable [name] Disable a plugin named, name. Do not include the [ and ] characters.

Bot Settings Commands

Configure your bot with /config set. Do not include the [ and ] characters.

Command Description
––––––––––––––––––––––––––––––– –––
/config set images This will set the bot avatars to your current ones. There is no undo.
/config set name [botname] This will set your bot's name. Do not include the [ and ] characters.
/config set genres [indie, rock, etc] This will set the bot's default genres. Up to 5 genres. Do not include the [ and ] characters.
/config set genres List current genres and available options.

Documentation

Plugins contributed to this repo will be applied to all bots on JQBX. Currently, this is the only way to contribute to code to JQBX as there is no timeline for an open API or source.

Bot Object

The current bot information

var bot = that.bot;

/**
    bot.user (the current bot user info)
    {
        uri: "spotify:user:12345678",
        username: "botname"
    }
**/

Room Object

The current room information.

/**

    that.room.djs is an array of users and index 0 is the current dj
    [
        {
            username: 'displaynname',
            id: '12345678',
            uri: 'spotify:user:12345678',
            image: 'https://jqbx.s3.amazonaws.com/profile-1509536915144.gif',
            thumbsUpImage: 'https://jqbx.s3.amazonaws.com/upvote-smooth-1509536820155.gif',
            thumbsDownImage: 'https://jqbx.s3.amazonaws.com/profile-1509536915144.gif',
            djImage: 'https://jqbx.s3.amazonaws.com/dj-1509536762198.gif',
            device: 'desktop',
            status: 'active',
            country: 'US',
            playCount: 0, //only active when setting of max track is enabled
            votes: []
        },
        // ...
    ]

    that.room.users is an array
    [
        {
            username: 'displaynname',
            id: '12345678',
            uri: 'spotify:user:12345678',
            image: 'https://jqbx.s3.amazonaws.com/profile-1509536915144.gif',
            thumbsUpImage: 'https://jqbx.s3.amazonaws.com/upvote-smooth-1509536820155.gif',
            thumbsDownImage: 'https://jqbx.s3.amazonaws.com/profile-1509536915144.gif',
            djImage: 'https://jqbx.s3.amazonaws.com/dj-1509536762198.gif',
            device: 'desktop', //mobile, bot
            status: 'active',
            country: 'US'
        },
        // ...
     ]
**/

Events

A quick list of events to listen on and emit.

Listening

next-track

The track about to start playing.

that.bot.on("next-track", function(data){
    var track = data.nextTrack;
    /**
        data is an object like:
            { nextTrack: {
                _id: '5a91123123123123',
              album:
               { images: [ { height: 300,
                   url: 'https://i.scdn.co/image/ce7a343d33926965828dccb05534b0a7cdd0fa43',
                   width: 300 } ],
                 name: 'Lower Than Atlantis (The Black Edition)',
                 uri: 'spotify:album:6uf4FBKy6xgAW4f1GmQ04A' },
              artists:
               [ { external_urls:
                     { spotify: 'https://open.spotify.com/artist/5pjCYG6hPLBO3y4swxu3dh' },
                    href: 'https://api.spotify.com/v1/artists/5pjCYG6hPLBO3y4swxu3dh',
                    id: '5pjCYG6hPLBO3y4swxu3dh',
                    name: 'Tonight Alive',
                    type: 'artist',
                    uri: 'spotify:artist:5pjCYG6hPLBO3y4swxu3dh' } ],
              duration_ms: 234786,
              href: 'https://api.spotify.com/v1/tracks/04qlaPMIPACn0jsqONhFjF',
              name: 'Ain\'t No Friend',
              popularity: 37,
              uri: 'spotify:track:04qlaPMIPACn0jsqONhFjF',
              userUri: 'spotify:user:12345678',
              username: 'displaynname',
              startedAt: '2018-02-25T00:01:17.074Z',
              thumbsDown: 0,
              thumbsUp: 1,
              thumbsUpUris: [ 'spotify:user:12345658' ],
              room: '5a91123123123123' }
            }
    **/
});

new-roomies

People who just joined the room.

that.bot.on("new-roomies", function(users){

    /**
        users is an array like:
        [
            {
                username: 'displayname',
                id: '123456',
                uri: 'spotify:user:12345678',
                image: 'https://jqbx.s3.amazonaws.com/profile-1509536915144.gif',
                thumbsUpImage: 'https://jqbx.s3.amazonaws.com/upvote-smooth-1509536820155.gif',
                thumbsDownImage: 'https://jqbx.s3.amazonaws.com/profile-1509536915144.gif',
                djImage: 'https://jqbx.s3.amazonaws.com/dj-1509536762198.gif',
                device: 'desktop',
                status: 'active',
                country: 'US'
            },
            //...
         ]
    **/
});

regions

Regions updated with all user's regions in the room.

that.bot.on("regions", function(regions){
    /**
        regions is an array of region codes in the current room
        ["US", "AU", "GB"]
    **/
});

Emitting

These are sent via that.bot.emit("event", data).

do:commandResponse

Send a message to chat from the bot.

var opts = {
    htmlMessage: "htmlversion of message",
    type: "expandable" //alert, null
}

that.bot.on("do:commandResponse", message, opts);

Sends a prviate message to chat.

that.bot.on("do:commandResponsePM", message, recipients, opts);
that.bot.emit("do:commandResponsePM", "Message", user, {
    htmlMessage: "html version"
});

Sends a notice to chat like "user has become a Dj."

that.bot.on("do:commandResponseNotice", message, opts);

Sends an expandable message to chat.

that.bot.on("do:commandResponseExpandable", message, opts);

//To specific users
that.bot.on("do:commandResponseExpandable", message, {
    recipients: [user]
});

jqbx-bot-plugins's People

Contributors

captinternet avatar cwoozle avatar dynasto avatar fkarlsson avatar gdiab avatar hasykes avatar jayfrizzle avatar maniexx avatar masonkuck avatar mcicoria avatar myztiq avatar obliquemotion avatar tjwds avatar vmednis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jqbx-bot-plugins's Issues

/firsts reporting inconsistent (impossible) results

When playing the track Arabic Love by DJ Krush , /firsts reported it was played 3 times, but the artist was only played 1 time.

Arabic Love by DJ Krush was first played on JQBX by fracturetrey on 10/12/2018 in breaks.life. It got 2 upvotes, 1 stars, and 0 lames. In total, it has been played 3 times in: breaks.life, 🥓 NOCAB 🥓 , BOOP

DJ Krush was first played by m0rph0 on 10/15/2018 in C h i l l (🍑l i t). In total, DJ Krush has been played 1 times

I don't know how /firsts works under the hood, but this seems very weird.

/up, /queue set [url] not working

Hi, as the title says, the commands /up, and all the /queue ones are not working for the bot I have in my room; what to do?
Thank you!

Youtube link pull

Plugin to add the following:

Command: /yt (optional)

Arguments:
: Optional. If a search item is provided, it will search for that instead of currently playing song.

Help: Will return the current playing song from a youtube search. Optional Argument. Search for a different item.

Comments: If used without an arguement, just search for "Song Artist" and return first result. Ignore results with "live" in it, unless "live" is in the title.

Command that pulls up song lyrics

Hi there, I hope this is the right place to put this!
I thought it would be cool to have a command that finds the lyrics for whatever song is playing and sends them in the chat.

/whosampled

DaftPuddin: you could do a /who-sampled command so that can hook into whosampled.com and find how many tracks have sampled the current track playing in jqbx

whosampled.com/metadata

I've submitted a contact form explaining the use case and am waiting to hear back.

Add warning message to /AFK

/w @{user} Hey {user}, if you do not {vote or chat} in the next {minutes} minutes, you will be removed from the queue!

Dad Jokes

Plugin to add the following
Command: /dadjoke
Help: Displays a randomly chosen dad joke, courtesy of icanhazdadjoke.com

API: https://icanhazdadjoke.com/api
Additional comments: Maybe have an internal timer so the function cannot be spammed?

/auto-first

Toggle the bot to automatically say stats for /first and /first-artist upon a new song playing.

This would probably be a mod-only feature so that everyone isn't toggling it.

How to implement:

listen to "next-track" and send the "/firsts" command via bot.emit("command:/firsts",input,user,message)

Suggestion: Lyrics command

Just an idea for the suggestion box: /lyrics command that scrapes the lyrics from the currently playing song from a lyrics website. (preferably genius.com, but scraping that may be trickier than some of the others).

Thanks for all you do!

fire events in other systems

Hey! I am dying to figure out how to get events out of jqbx into slack.

It seems like this repo is the way to do that. Im an experienced javascript dev and will write it myself and issue a PR- i just need to know if there's a way i can persist a room-specific config object somewhere?

Automatically shuffle/refresh/reset playlist function

Hi there! :) I'm not sure if this has already been suggested (I apologize if it has) but I've been curious as to whether this is in the works or planned.
A function where the bot isn't restricted to 100 songs per playlist, or can automatically renew its queue/grab new songs (at random) from a set playlist, would be awesome! (We end up cycling the whole /queue set [playlist] and /queue shuffle commands a lot, and I think we're still limited to 100 regardless, right?)

Thank you so much!

Room not syncing for users properly

This may be the wrong area for this, but our Needles & Grooves room has had problems for the last 5 days with users having to click sync audio sometimes after every song. If I need to be re-directed to get help on this please let me know.

Thank you!

/bikes

Meme plugin
command would set bot to play the first 3 seconds of "BIKES! - Tom Segura"

New /genre command

It would be nice to have a /genre command to tell you what genre the genre is of the current song playing. Not just like "EDM" or "Rock" but more detailed genres like "Brostep" or "Metalcore". Just a suggestion.

New tracks only mode

Since the bot already has /first information, and the ability to skip (as in the meme commands), it could enforce only playing tracks which haven't been played in the room (or in any room) before. That would obviously need to be a mod-only feature, probably with some automatic expiry, so nobody leaves it on by accident.

I'm submitting an issue, and not a PR, because I don't know how to access the /first data, or skip tracks.

AFK - Fix for bot reset

If you don't have activity on for AFK -- sometimes when the bot resets it won't properly get any upvotes or messages and incorrectly kick people off for being afk just based on status change.

Since the function is not exposed in github, please make the following change

if messages or vote is undefined, set variable time to current time instead of ignoring it.

No /queue commands working

I just received my bot on 2/4, and was able to use the queue functions fine for a few hours, but ever since then, they have not worked. I have attempted updating the bots several times as stated in a closed issue, but it has not helped or solved the problem.

DJ Queue Management

Plugin to add the following:

Command: /djqueue

Arguements: list add remove clear setlimit
list: list current queue
add: adds user to queue, if user is not currently a dj
remove: removes user from queue
clear: mod only command. clears the current queue.
setlimit : sets queue limit to this number. If queue is currently higher than then the list is culled.

Help: Use the DJ Queue to automatically be placed on stage when a spot opens up. Commands: list add remove clear setlimit (clear and setlimit are mod and admin only)

Comments: This plugin will manage queues in room with dj and/or song limits. It is a first in first out stack. Standard users can add and remove themselves from the queue as well as view it. Moderators and above can clear the entire queue or set a limit to the size of the queue.

It might be smart to add a module called banlist which can be used to ban a particular user from using the command based on spotifyURI

Custom reply commands

Allow admins to set custom reply commands for their room, like the ones in the single string plugin.

ian✨
oh right
i just wanted to add simple trigger command while in chat
/dope
then auto post a certain gif
blank
ah nice
i'll add an issue on github to make it so people can add simple response plugins like that
probably tie them just to the room
"U Betta" by: Machinedrum
would make it interesting to check out what others have added
ian✨
sweet!

AFK Detection (Mod Only)

Plugin to add the following:

Command: /afk

Arguements:
: time, in minutes where a dj will be auto removed if afk. If set to 0, then afk timer is not used.

Help: Automatically removes djs who are afk for the time specified. Set to 0 to disable. Arguments:

Comments: This plugin will run once a minute and remove afk djs as necessary. May need better afk detection in the app first, however. This command is only usable by mods and above.

Bot-unstability...

I'm playing a liveset in august, and I'm considering running the funny /tv command for projecting the gif-music-video thing on the side. I'm not playing my set from jqbx, since it lacks mixing facilities. The bot seems quite unstable though; somtimes it works, sometimes it doesn't. When it doesn't, it disappears from all rooms right? Is there a way to secure it works at a certine time? Would feel kinda stupid to play and have it all ready, and then the bot is gone...

Duel Plugin

Inspired by the jqbx battles we could have a plugin to have casual battles anytime in any room. The sequence would look like this:

1. Challenge

User joja types /duel Hoggy (or even without name to challenge the current dj)

2. Acceptance/Beginning

User Hoggy types /accept and the duel begins

3. Duel

Both users have to each play a song. In order to keep it casual and not laborious nobody should have to give way and step down, so it shouldn't matter if other DJ's spin their songs inbetween.

3. Vote

After both have played a song the bot takes votes for a 3 minutes like with the /joke plugin.
e.g. /vote Hoggy

4. Outcome

The bot announces the winner.

There are some things you could add to that

Extras:

JQBX League

Award points to the winner depending on the outcome for a permanent leaderboard, either for single rooms or the whole platform. Maybe even have seasons

Themes

Of course the duels need themes which the users could choose themselves. In addition to that the duel plugin could also choose random themes from a list (/battle Hoggy random)

Configurations

Toggle 'allow duels' on/off and set maximum of battles running at the same time/per user in a day/in a certain time frame in bot configuration

Fair votes

Have the bot only accept votes of users that have been in the room for both songs

no commands working at all

i just got my bot about 2 days ago. until a couple of hours ago, the bot was working fine. now none of the commands are working. i am unable to get the bot to either dj or step down as well. i'm not familiar with programming, is there anything i can do to fix the issue?

HTML output not working

The output from /help and /hay is broken - it all displays without line breaks, instead of a neat table.

Queuing a playlist for a bot

So the bot adding its own music when the queue runs out is nice and all but I would like to just set a playlist and if it gets done with that playlist then repeat the playlist instead of going to random songs. Can it be possible to set that up somehow? Thanks for all the hard work!

[feature] Wikipedia Unfurling

When someone shares a wikipedia link in chat, the bot should response with a snippet or summary of the article.

Example

input

http://en.wikipedia.org/wiki/Charizma

output

"Charles Edward Hicks Jr. (July 6, 1973 – December 16, 1993), also known by his stage name Charizma, was an MC from Milpitas, California, United States. He is best known for his work with Peanut Butter Wolf; the two artists formed a duo after meeting in 1990 but their musical partnership was cut short following Charizma's murder in 1993."

Not seeing all bot commands in this repo

Is this repo up to date? I'm not seeing all the bot commands here that are listed in the /help command.

I am particularly interested in the /auto-first command but dont see it here. Is there a reason these are missing/hidden? Or is the repo just out of date?

Ability to swap /auto-artist results from last.fm to /wiki

Many of the band descriptions on last.fm are somewhat lacking. It would be nice if we could config the bot to have /auto-artist use the wiki information which is often more informative.

EDIT: or perhaps we could have an /auto-wiki?

Bot left room

Bot "pjarbot" for room "phil jackson ayahuasca retreat" left the room. Unsure what triggered it.

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.