GithubHelp home page GithubHelp logo

musicbucket / musicbucket-bot Goto Github PK

View Code? Open in Web Editor NEW
38.0 3.0 13.0 3.35 MB

A Telegram bot that helps chat users sharing and keeping track music

License: GNU General Public License v3.0

Python 99.32% Dockerfile 0.57% Shell 0.11%
music music-bot telegram telegram-bot python python3 spotify deezer lastfm lastfm-api

musicbucket-bot's Introduction

MusicBucket Bot

full_logo

About

MusicBucket Bot is a Telegram Bot that adds features and possibility to interact with Spotify music links that users send in a chat.

Its main feature is to allow you to save links that someones shares in a Chat in a personal list. So you can easily track which music you have pending to listen to.

When an user sends a link, the bot is able to get information from a Spotify link like:

  • Artist
  • Album
  • Track
  • Genres
  • Audio preview

It also integrates with Last.fm to retrieve information about your user like Now Playing.

Why Telegram?

I chose Telegram because I'm in a few groups where we share music everyday. We soon realized that the links we shared in a group were often missed. Therefore, the idea of making a tool for keeping track of the music we share started growing so I started developing this bot.

Why Spotify?

At the start the bot supported both Spotify and Deezer, but Spotify is the platform that we use mostly, so implementing new features for both platforms became complicated and I decided supporting Spotify only.

Commands

  • /music [@username] Retrieves the music shared in the chat from the last week. Grouped by user. Filter by @username optionally.
  • /music_from_beginning @username Retrieves the music shared in the chat from the beginning of time by an user.
  • /savedlinks Retrieves a list with your saved links
  • /deletesavedlinks Shows a list of buttons for deleting saved links
  • /mymusic Retrieves the music that you shared in all the chats. It has to be called from a private conversation.
  • /topalbums [period](7day 'default'/1month/3month/6month/12month/overall) Top Albums. Returns the Last.fm top albums of your user.
  • /topartists [period](7day 'default'/1month/3month/6month/12month/overall) Top Artists. Returns the Last.fm top artists of your user.
  • /toptracks [period](7day 'default'/1month/3month/6month/12month/overall) Top Tracks. Returns the Last.fm top tracks of your user.
  • /np Now Playing. Returns track information about what you are currently playing in Last.fm.
  • /collage [rows] [cols] [period](7day 'default'/1month/3month/6month/12month/overall) Returns a collage of your most listened albums in a period.
  • /lastfmset username Sets a Last.fm username to your Telegram user.
  • /stats Retrieves an user list with a links counter for the current chat.
  • /help Retrieves a list of available commands and bot features.
  • @music_bucket_bot artist|album|track name Search for an artist, an album or a track and send it to the chat.

Official bot => @music_bucket_bot

Screenshots

screenshot_1 screenshot_3
screenshot_2 screenshot_4

Installation

  • Install pyenv and poetry
  • Do poetry install inside the folder.
  • Copy the .env.dist file to .env and fill the variables with your Telegram and Spotify data.
  • Execute python main.py

Special thanks

To the Sonomada community and its group in Telegram (https://t.me/Sonomada_gang) where we use and test the bot actively and propose new features.

License

The content of this project is licensed under the GNU/GPLv3 license. See LICENSE file.

musicbucket-bot's People

Contributors

paurieraf avatar prieraapsl 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

Watchers

 avatar  avatar  avatar

musicbucket-bot's Issues

Refactor musicbucket_bot.py

Refactor musicbucket_bot.py creating a class for every command and split large command methods into smaller ones

Refactor responser.py file

Refactor Responser class into smaller classes for every command and split the large response functions into smaller ones

Last.fm integration

  • Add the possibility to retrieve, with a command (/nowplaying [username] or similar) the track that a last.fm user is playing. If it's possible, send the Spotify link too.
  • Add the possibility to set the last.fm username to a specific telegram user.

General refactor

  1. Create a bot module in app and move responser.py inside.
  2. Add a commands.py file and move in all the commands in bot.py

Database restructuration

Create Artist and Album model and a foreign key from Link to both. Save both ids and some information like name and genres
This will allow to use /recommendations basing the query to both Artist and Album and not only Artist.

Then, it will be necessary to do a migration to retrieve the data from Spotify for every album and artist.

Search artists/albums/tracks

Add the possibility to search artists/albums/tracks using the Spotify API.

@music_bucket_bot [name] > display a list of results and add to the chat by clicking them

Revisar dependencias de node

La dependencia node-sass lanza dos warnings:

warning node-sass > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning node-sass > node-gyp > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

Habría que mirar de actualizar la dependencia y ver si se puede eliminar request, revisar el enlace que indica en el mensaje de error.

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.