Skip to content

A Telegram bot that will become your buddy at a concert, written in C#/.NET 😎

Notifications You must be signed in to change notification settings

skuill/ConcertBuddy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ConcertBuddy

CodeFactor

Table of contents

General info

Are you planning to go to the concert? This telegram bot will be your companion, like a good buddy! 😎

He can tell you the biography of the artist/band, find out the actual setlist from the last concerts, play the track and show the lyrics.

Just write the artist/band name to the ConcertBuddy bot and enjoy!

Features

A few of the things you can do with ConcertBuddy:

  • βœ… Search artist / band by name
    • MusicBrainz
  • βœ… Read artist / band biography
    • Last.fm
  • βœ… View setlists from recent concerts
    • Setlist.fm
  • βœ… Listen to tracks
    • Directly from: Yandex
    • External link: Spotify
  • βœ… Read the lyrics of the tracks
    • Different lyric providers: AZLyrics, Genius, SongLyrics, MusixMatch

Feedback

Feel free to send me feedback on Telegram or file an issue. Feature requests are always welcome.

Technologies

Project is created with:

  • .NET: 6.0
  • Microsoft Visual Studio Community 2022
  • docker

Built with

  • Telegram.Bot - the most popular .NET Client for πŸ€– Telegram Bot API
  • LyricsScraperNET - 🎼 a library for .NET that provides an API to search for lyrics of a song from the web
  • SpotifyAPI-NET - a client for Spotify's Web API, written in .NET
  • MusicBrainzAPI - Implementation of the MuzicBrainz API v2
  • Inflatable.Lastfm - Last.fm SDK for modern .NET platforms
  • Genius.NET - C# library to access the Genius REST API in .NET
  • HtmlAgilityPack - agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...)
  • Serilog - simple .NET logging with fully-structured events
  • Yandex.Music API - unofficial wrapper for the Yandex.Music API

Documentation

Hosting

The bot is launched on the Ubuntu 22.10 64bit server DigitalOcean droplet in a docker container from docker hub repository. It costs 6$/month.

Deployment

  1. Create and configure ConcertBuddy/ConcertBuddy.ConsoleApp/appsettings.json file with settings Configuration.cs from template appsettings.template.json.
  2. Build and publish docker image with Dockerfile to docker hub registry.
  3. Use docker-compose.yml to run container.

Environments

Name Link
Development TestConcertBuddy
Production ConcertBuddy

Logging

The serilog adapter is used for event logging. Logs are written to the console, debug, file. Log rotation is configured. Logging settings are set in appsettings.json. Example: appsettings.template.json

Roadmap

Visit github project page or issue board

Release Notes

v1.0.0 (15.09.24):

  • Migration from .NET 6 to .NET 8
  • Use FakeItEasy instead of Moq
  • Optimize docker image size by using alpine in dockerfile
  • Updated external libraries to the latest version

v0.1.1 (03.09.23):

  • Fixed a problem with lyric searching (Issue 33)
  • Use LyricsScraperNET library instead of LyricsScraper project.
  • Updated external libraries to the latest version (Spotify, Telegram, Yandex)

v0.1.0 (28.10.22):

BreakingChanges:

  • Refactoring. MusicSearcherClient has many responsibilities and bottleneck (Issue 30)
  • Use nuget package of Yandex api instead of project reference (Issue 21)

Bugfixes:

  • Map properly MusicBrainz to Spotify track while searching (Issue 29)
  • Track searching will return nothing if track not found in spotify (Issue 27)
  • Can't find Wu tang artist's information and tracks (Issue 28)
  • Can't initialize Yandex client! System.Net.WebException: The remote server returned an error: (400) Bad Request. (Issue 31)

v0.0.8 (04.02.22. It's my Bday πŸŽ‚):

Bugfixes:

  • Track searching will return nothing if track not found in spotify (Issue 27)
  • Disable page navigation if nothing found (Issue 26)

v0.0.7 (30.01.22):

  • Added receiving artist's top 10 tracks from Spotify (Issue 9)

v0.0.6 (25.01.22):

  • Catch unhandled exceptions and log them. (Issue 24)
  • Configure write logs to file with rotation with docker volume. (Issue 25)

v0.0.5 (24.01.22):

  • Listening to the track directly in the telegram. Use Yandex track storage. (Issue 8)

v0.0.4 (21.01.22):

Bugfixes:

  • Made SearchLyric async. (Issue 16)
  • Remove async from telegram messages validation. Move callback messages in MessageHelper. (Issue 18)

v0.0.3 (21.01.22):

  • Migrate app.config to appsettings.json with DI.

v0.0.2 (19.01.22):

  • Fixed async task order in SearchArtistByMBID method.
  • Rename methods with Async.
  • Added some TODO comments.

v0.0.1 (12.01.22):

  • Added MemoryCache when searching for artists by mbid to reduce API calls.
  • Fixed logs format with date and scope.
  • Publish docker version 0.0.1 and deploy on server. πŸŽ‰

Support

If you want to support this project or my work in general, you can donate via the link below.

This will always be optional! Thank you! πŸ˜‰

  • "Buy Me A Coffee"
  • "Tinkoff Donate Button"