From df2df5750185a9ab653346a2a1c2b3cd43a05bb3 Mon Sep 17 00:00:00 2001 From: Innokentiy Sokolov Date: Wed, 13 Nov 2024 12:52:10 +0300 Subject: [PATCH] add readme file cleanup --- README.md | 102 ++++++++++++++++++++++++++++++++++++++ assets/readme-banner.webp | Bin 0 -> 20570 bytes cmd/melodix/melodix.go | 2 +- player/player.go | 2 + song/song.go | 14 +++--- 5 files changed, 112 insertions(+), 8 deletions(-) create mode 100644 README.md create mode 100644 assets/readme-banner.webp diff --git a/README.md b/README.md new file mode 100644 index 0000000..e2c261e --- /dev/null +++ b/README.md @@ -0,0 +1,102 @@ +![# Header](https://raw.githubusercontent.com/keshon/melodix/master/assets/readme-banner.webp) + +# 🎡 Melodix β€” Self-hosted Discord music bot + +Melodix is my pet project written in Go language that plays audio from YouTube and audio streaming links to Discord voice channels. + +## 🌟 Features Overview + +### 🎧 Playback Support +- 🎢 Single track added by song name or YouTube link. +- 🎢 Multiple tracks added via multiple YouTube links (space separated). +- 🎢 Tracks from public user YouTube playlists. +- 🎢 Tracks from YouTube "MIX" playlists. +- πŸ“» Internet radio streaming links (24/7 playback). + +### βš™οΈ Additional Features +- 🌐 Operation across multiple Discord servers. +- πŸ“œ Access to recent tracks statistic and history of `play` commands. +- πŸ”„ Playback auto-resume support for connection interruptions. + +### ⚠️ Current Limitations +- 🚫 The bot cannot play YouTube live streams or regional-locked videos. +- ⏸️ Playback auto-resume support may create noticeable pauses sometimes. +- ⏩ Playback speed may sometimes slightly vary. +- 🐞 It's not bug-free. + +## πŸš€ Try Melodix + +You can test out Melodix in two ways: +- πŸ–₯️ Download [compiled binaries](https://github.com/keshon/melodix-player/releases) (available only for Windows). Ensure FFMPEG is installed on your system and added to the global PATH variable. Follow the "Create bot in Discord Developer Portal" section to set up the bot in Discord. + +- πŸŽ™οΈ Join the [Official Discord server](https://discord.gg/NVtdTka8ZT) and use the voice and `#bot-spam` channels. + +## πŸ“ Available Discord Commands + +Melodix supports various commands with respective aliases (if applicable). Some commands require additional parameters. + +### ▢️ Playback Commands +- `!play [title|url]` β€” Parameters: song name, YouTube URL, audio streaming URL. +- `!skip` β€” Skip to the next track in the queue. +- `!stop` β€” Stop playback, clear the queue, and leave the voice channel. + +### πŸ“‹ Advanced Playback Commands +- `!list`β€” Show the current songs queue. +- `!pause`, `!resume` β€” Pause/resume current playback. + +### πŸ“Š Information Commands +- `!now` β€” Show the currently playing song. +- `!stats` β€” Show tracks played statistics with total playback duration and count. +- `!log` β€” Show the recent `play` commands by users. + +### βš™οΈ Utility Commands +- `!set-prefx [new_prefix]` β€” Set a custom prefix for a guild to avoid collisions with other bots. +- `melodix-reset-prefix` β€” Revert to the default prefix `!`. + +### ℹ️ General Commands +- `!about ` β€” Show bot information. +- `!help` (aliases: `!h`, `!?`) β€” Show help cheatsheet. + + +### πŸ’‘ Usage Examples +To use the `play` command, provide a YouTube video title, URL: +``` +!play Never Gonna Give You Up +!play https://www.youtube.com/watch?v=dQw4w9WgXcQ +!play http://stream-uk1.radioparadise.com/aac-320 +``` +Play multiple tracks (second link will be added to the queue): +``` +!play https://www.youtube.com/watch?v=dQw4w9WgXcQ https://www.youtube.com/watch?v=OorZcOzNcgE +``` + +## πŸ”§ How to Set Up the Bot + +### πŸ”— Create a Bot in the Discord Developer Portal +To add Melodix to a Discord server, follow these steps: + +1. Create an application in the [Discord Developer Portal](https://discord.com/developers/applications) and obtain the `APPLICATION_ID` (in the General section). +2. In the Bot section, enable `PRESENCE INTENT`, `SERVER MEMBERS INTENT`, and `MESSAGE CONTENT INTENT`. +3. Use the following link to authorize the bot: `discord.com/oauth2/authorize?client_id=YOUR_APPLICATION_ID&scope=bot&permissions=36727824` + - Replace `YOUR_APPLICATION_ID` with your Bot's Application ID from step 1. +4. Select a server and click "Authorize". +5. Grant the necessary permissions for Melodix to function correctly (access to text and voice channels). + +After adding the bot, build it from sources or download [compiled binaries](https://github.com/keshon/melodix-player/releases). Docker deployment instructions are available in `docker/README.md`. + +### πŸ› οΈ Building Melodix from Sources +This project is written in Go, so ensure your environment is ready. Use the provided scripts to build Melodix from sources: +- `bash-and-run.bat` (or `.sh` for Linux): Build the debug version and execute. +- `build-release.bat` (or `.sh` for Linux): Build the release version. +- `build-dist-assemble`: Build the release version and assemble it as a distribution package (Windows only). + +Rename `.env.example` to `.env` and store your Discord Bot Token in the `DISCORD_TOKEN` variable. Install [FFMPEG](https://ffmpeg.org/) (only recent versions are supported). + +### 🐳 Docker Deployment +For Docker deployment, refer to `docker/README.md` for specific instructions. + +## πŸ†˜ Support +For any questions, get support in the [Official Discord server](https://discord.gg/NVtdTka8ZT). + +## πŸ“œ License +Melodix is licensed under the [MIT License](https://opensource.org/licenses/MIT). \ No newline at end of file diff --git a/assets/readme-banner.webp b/assets/readme-banner.webp new file mode 100644 index 0000000000000000000000000000000000000000..cacaddfd5ed30537323ecfd5037ed903f93c1703 GIT binary patch literal 20570 zcmV(#K;*wtNk&FePyhf|MM6+kP&gn)PyhhXh5?-cDgXs(0X~sLo=c^prmrM%`Jvzv z2~Ey>tHJa4-r)o6K0TXByOPE6&HiLbbCP(V*i{agZtnbLY8x(WmG2Lde!KgB%Kk9#${G|Em|2O`R`mcDO*8kdn-1h_hSM@{xv)2dr zk3hfDKhA#Ad(!{B{j&E{{g3^}?T^3*^l$cm`+c;3^!pwEo&Uw`G5p8H+`%tzXlBZM{hSA9DlcN6U{UpG(%8&_3Tk#PHAdZ{>Xk zyidV9xp|6vdG+5$|Izbz`7ibUzTt|e zSd)*|>NBmGcD$hWE=xp_7NoGBlBnoH-RVOvMd~D--qPMHmN>Ctv246Hm4DiaN3Q#o ztXvnsz3;%IC-1*y;C$l$)bWTQYfMsawMDXezOq#RCLae`TZRYX%D@@F)k!=~RAK(D zeqX3#uFpB@j_=pphzQ^w+8#*%1T6k~W><4NVz%q<9c?Y^by@;5%5?aaiP4WK60u^c z39Bt>=`GJtS_5CewA!5ElTEK5=}=|!79lUFN>@@Na|IzzZvpR54UlmVzxjL^{&W-YC1R^4@NQUW^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P|yqs9Yj|^&>fUkW#5Nin5fF0TMEpWK4`0}BG7bM%*}CIzVdpr`;kcz@Bw5` zB+6rILiIMU;IvwZN6+vq#WYR8joby3{OSF06P+<=HdQ+Q41_=MGb_u1U4`fk00b2N z%>}F2xv*-4SwHVujadInUgwKJTSHYR@+GUyWD`7&y#%V?YfOW)$C;gn$9sY$b>no2 zkBxko=go0HDRN_nEZ-x{nGC*Kf~E_=m3RGv?{DrkqT${K3!54^lCa1~yOX4#;b@*U zE{&>3gH2fn?GitgsKss)sB8Rh7ZJUY3lB$@{Hhn=Dr7se!V-61>8qTu z7hjWUAobKa)UYY7=#wk&Yoo*%b=?A86~JdSW5J7m576OW0G4>E6yVGexOcuNj?L%b ts-MQQgMF~uAnL~)9RUO?jx-;t<2+DX8C#QiiqPV~blGnTB?7fn007{kKJfqm literal 0 HcmV?d00001 diff --git a/cmd/melodix/melodix.go b/cmd/melodix/melodix.go index 542fe0e..f6b0520 100644 --- a/cmd/melodix/melodix.go +++ b/cmd/melodix/melodix.go @@ -266,7 +266,7 @@ func (b *Bot) onMessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) for index, song := range songs { emb.Fields = append(emb.Fields, &discordgo.MessageEmbedField{ Name: fmt.Sprintf("%d. %s", index+1, song.Title), - Value: fmt.Sprintf("[%s](%s)", song.Title, song.PublicLink), + Value: fmt.Sprintf("[%s](%s)", song.Source, song.PublicLink), Inline: false, }) } diff --git a/player/player.go b/player/player.go index 278e66a..159bd7c 100644 --- a/player/player.go +++ b/player/player.go @@ -121,6 +121,8 @@ PLAYBACK_LOOP: done := make(chan error) // defer close(done) + time.Sleep(250 * time.Millisecond) // questionable + streaming := dca.NewStream(encoding, vc, done) p.StatusSignals <- StatusPlaying diff --git a/song/song.go b/song/song.go index 4b0fdde..c867dba 100644 --- a/song/song.go +++ b/song/song.go @@ -38,14 +38,14 @@ var ( ) type Song struct { - Title string // Title of the song - PublicLink string // Link to the song page + Title string // title of the song + PublicLink string // link to the song page StreamURL string // URL for streaming the song - StreamFilepath string // Path for streaming the song - Thumbnail Thumbnail // Thumbnail image for the song - Duration time.Duration // Duration of the song - SongID string // Unique ID for the song - Source SongSource // Source type of the song + StreamFilepath string // path for streaming the song + Thumbnail Thumbnail // thumbnail image for the song + Duration time.Duration // duration of the song + SongID string // unique ID for the song + Source SongSource // source type of the song } type Thumbnail struct {