artificialhoney / dopebot Goto Github PK
View Code? Open in Web Editor NEWA Slack bot which connects with Mopidy and Spotify.
License: MIT License
A Slack bot which connects with Mopidy and Spotify.
License: MIT License
There's really not enough information about what is required to get this running, in terms of setting up in Slack. Even if this is based on another bot (hubot?) it would be helpful to mention that in order to reference other documentation
I get missing scope errors, but I don't know what scope is required. A few lines on the general setup in Slack would go a long way to making this easier. I'll try to write up what I find as I go.
Also, for example, error messages could be more helpful by mentioning what authentication error is generated, ie "Something went wrong when retrieving an access token" would be helpful if it was prefixed with Spotify/Slack.
Basic search and returns numbered results for later reference:
search <keyword>
returns hits from album, artist, track, playlistssearch playlist <keyword>
only returns hits from playlistssearch <type> <keyword>
where type is album
, artist
, playlist
, track
For "generic" searches, the "top 10" search results are displayed grouped by type to fill up 10 hits, something like:
1. Artist: xyz
2. Artist: xyz #2
3. Album: xyz from artist-name
4. Album: xyz #2 from artist-name
5. Playlist: xyz Playlist 1 from User xy
6. Playlist: xyz Playlist 2 from User zz
7. Track: yzs from artist-name (Album: xxx)
8. Track: yzs from artist-name (Album: xxx)
9. Track: yzs from artist-name (Album: xxx)
10. Track: yzs from artist-name (Album: xxx)
Challenge is how to group the different kind of items in this list, and how many of which to display. The spotify client does a pretty good job here.
Then I move over to playing one of the hits:
play 5
would then start playing the playlist "xyz Playlist 1 from User xy"play 1
would play the "top 10" songs from artist xyzplay 3
would play the album from 1-endThe same could be used to fill up the "playlist":
queue 5
queue 1
Then some commands to be able to see the currently played song + the next 10 songs in the queue:
queue show
.... more to come
I've added a client ID and secret (using https://www.mopidy.com/authenticate/#spotify ) however searching is still unsuccessful.
Will the client id + secret created via the mopidy website work in this context?
The difference between play
and queue
should be that play
starts the selected item directly (erasing the current list of tracks) and queue
should just add it for later playing. It seems that currently the play
also only enqueues, which always require a clean
before. So the play
functionality should be fixed or changed.
Currently you search and get hits "0-4" in every type. This requires then to specify the type when wanting to play something. Better would be to number them throughout types and then "play 7" would play that item, regardless of the type:
Tracks:
1.
2.
3.
4.
Albums:
5.
6.
7.
Playlists:
8.
9.
10.
This seems to be the most common mistake (people typing play 0
) and would be mitigated by this change.
Whenever I do a search stuff
command on the slack channel this is printed in console:
2017-11-07T06:07:46.2222 - error: Something went wrong when retrieving an access token
{ [WebapiError: Bad Request] name: 'WebapiError', message: 'Bad Request', statusCode: 400 }
The bot works fine with play <spotifyuri>
and everything else. It just can't search.
While playing a playlist, status
only says "playing". Cool would be to get more infos and maybe add the current
and vol
information to it so that this is the one command to see everything about what's going on (less spams in the channel):
The queue still has NN songs - hh:mm to go
Currently playing Deep Sphere (Stephan Koenigk Remix) by Michael Schwarz from Deep Sphere EP
Volume: 100
So 1. the state of the queue, 2. the current state + song, 3. the current volume
For 1. the state of the queue, alternatives output in other situations could be:
This is the last song in the queue
The queue is empty
For 2. the current state, alternatives:
Currently paused
Currently stopped
If one starts playing songs from a playlist, it could be interesting to display that information along the individual songs that are actually being played.
Current output:
Playing with volume 35
The Trooper - 1998 Remastered Version from Piece Of Mind (1998 Remastered Edition) added by ernesto
Iron Maiden
in pseudo-code:
<songname>
from<album>
added by<person>
<artist>
Desired would be:
<songname>
from<album>
<artist>
added by<person>
from playlist<playlist>
Some cosmetics in the current track list (tracks
):
tracks
to the next 10. If there are more than 10 tracks in the queue, finalize with:... and YY more tracks
- Track 1 by XY from xxxx
- Track 2 by ZZ from nnnn
- Track 3 by jj from mmm
Total time of music in queue: hh:mm
Despite us all being programmers, we still want to communicate as easy as possible with the bot. Common mistakes should be tollerated and "understood" by the bot. With that I mean some aliases allowed for common commands:
skip
, next
clear
, clean
tracks
, list
vol
, volume
and also things like vol up
(+5 steps from current) and vol down
(-5 steps)Some improvements in the search output:
Master of Puppets from Metallica (1986)
tracks
list. Maybe add the album in which the track is in, if the information is available without further queries?Metallica Greatest Hits from hif.pettersson (8.576 followers)
Doing a search and selecting a playlist by number tries to start it like:
Adding spotify:playlist:37i9dQZF1DWSNC7AjZWNry to tracklist
This does not work. The username is missing. Either handle that case without username or add the username. This works then:
play spotify:user:spotify:playlist:37i9dQZF1DWSNC7AjZWNry
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.