- Ability to process song while the song is still in queue, this will speed up the music transition
- Added Support for Discord build-in command feature
- Added Command
!resumecommand, this will resume the music - Added Command
!pausecommand, this will pause the msuic - Added Shortcut
!p=!play - Added Shortcut
!s=!stop
A Music Bot By Mark
- Added Command
!ythelpcommand, this will show as an embed message of all available command - Discord Token Discord token get read from
Discord_Token.txtinstead of showing in the .py file itself for security
- Scheduled File Deletion: Using the Linux script, files are now scheduled for deletion. This includes
Cornjobanddelete_mp3.sh. - Queue Feature: Added the
!queuecommand. You can also use!playwhile a file is already playing. - Enhanced Play Command: The
!playcommand now searches for files if a non-valid URL is detected. - Skip Feature: Added the
!skipcommand to skip currently playing files. - Nuke Queue Feature: Added
!nuketo clear the entire queue. - Stop Queue(Bot Disconnect) : The
!stopcommand will disconnect the bot from current voice channel
-
Discord Library
pip install discord.py -
yt-dlp for YouTube Downloads
pip install yt-dlp -
FFmpeg Library for Audio Processing For Ubuntu/Debian:
sudo apt-get install ffmpeg -
Moving Files to Your Linux Machine
- Create a folder:
mkdir project/production/YTBot - Move your files to the YTBot directory.
- Create a folder:
-
Make your bot token File
- For Linux
cd path/to/your/BOT/Folder- Create the file
touch Discord_Token.txt- Edit the file
nano Discord_Token.txt- Paste your discord token into the file
- Save and exit (Ctrl+O, Enter, Ctrl+X).
-
Edit the Python file to direct the bot to the right Path
- Assume you are already cd in the correct path
nano Bot.py- edit
with open('path/to/your/BOT/Folder/Discord_Token.txt','r') as file: TOKEN = file.read().strip()- Save and exit (Ctrl+O, Enter, Ctrl+X).
-
Install and Use Screen for Background Running
- Install Screen:
sudo apt-get install screen - Start Screen session:
screen - Run your Python script:
python3 [path to your Python script] - Detach from Screen session:
Ctrl-A then Ctrl-D - To return to the session:
screen -r
- Install Screen:
-
Setup Cronjob for Scheduled Deletion
- Change the directory to where your shell script is located.
cd directory/of/your/sh/file - Make Executable
- Note: Sudo needed if this file is located from /root
chmod +x delete_mp3.sh - Edit crontab:
crontab -e - Add the following line to schedule the job:
0 9 * * * /path/to/delete_mp3.sh - Save and exit (Ctrl+O, Enter, Ctrl+X).
- Verify the scheduled jobs:
crontab -l
- Change the directory to where your shell script is located.