Skip to content

GamyingOnline/yt-yapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YT-Yapper

YT-Yapper is a feature-rich Discord music bot written in Rust. It provides seamless music playback and advanced controls while integrating Last.fm scrobbling and Spotify track data for a complete music experience.

Features

  • Music playback with search and URL support
  • Comprehensive playback controls:
    • Play/Pause
    • Skip tracks
    • Seek within tracks
    • Clear queue
    • Remove specific tracks
    • Single track repeat mode with toggle
    • Now playing information with rich embeds and thumbnails
    • Automatic track progression
    • Spotify playlist support
    • Spotify album support
  • Server-specific features:
    • Per-server music queues
    • Server mute synchronization
    • Automatic voice channel state handling
  • Last.fm Integration:
    • Automatic song scrobbling on track completion
    • Real-time now playing updates
    • Voice channel member tracking
    • Secure DM-based authentication
    • Multi-user support with session persistence
  • SQLite persistence for Last.fm user tokens
  • Spotify Integration: Fetches detailed track metadata using the spotify-rs crate.

Installation

1. Prerequisites:

2. Clone the Repository:

git clone https://github.com/gamyingonline/yt-yapper.git
cd yt-yapper

3. Configuration:

  • Rename .env.example to .env and fill in the required details:
    DATABASE_URL=database_url
    DISCORD_TOKEN=your_discord_token
    LASTFM_API_KEY=your_lastfm_api_key
    LASTFM_SECRET=your_lastfm_secret
    SPOTIFY_CLIENT_ID=your_spotify_client_id
    SPOTIFY_CLIENT_SECRET=your_spotify_client_secret

4. Build and Run:

cargo install sqlx-cli
cargo sqlx prepare
cargo build --release
cargo run --release

Dependencies

  • poise v0.6.1 - Discord bot framework
  • songbird v0.4.3 - Voice and audio handling
  • tokio v1.41.1 - Async runtime
  • serenity v0.12.2 - Discord API wrapper
  • spotify-rs v0.3.14 - Spotify integration
  • symphonia v0.5.2 - Audio decoding
  • rustfm-scrobble v1.1.1 - Last.fm integration
  • sqlx v0.8.2 - SQLite database integration
  • dotenv v0.15.0 - Environment configuration

Usage

Once the bot is running, invite it to your Discord server using the OAuth2 URL generated in the Discord Developer Portal. Use the following commands with the prefix ;

  • ;play <playlist, album url or search>: Play a track from a search query (searches from spotify) or a spotify playlist, album. (alias: ;music)
  • ;yt <url or search>: Play a track from a url or search query (searches from yt). (alias: ;youtube)
  • ;pause: Pause the current track.
  • ;resume: Resume playback.
  • ;skip [<number of tracks>]: Skip to the next track in the queue.
  • ;queue: Display the current queue.
  • ;clear: Clear the queue.
  • ;now: Show information about the currently playing track.
  • ;seek <time>: Seek within current track (format: HH:MM:SS, MM:SS, or SS)
  • ;repeat: Toggle repeat mode. (alias: ;loop)
  • ;fmlogin <username> <password>: Set up Last.fm integration (DM only, alias: ;login)

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes. Ensure your code adheres to the existing style.

License

This project is licensed under the BSD-3-Clause License. See the LICENSE file for details.