ChetBot is a Discord bot that can handle audio file conversions, speech transcription using machine learning, combine pdf files, download YouTube videos, play songs in Voice Chat, and more.
When a member joins your server a simple embed will be sent to greet them in their direct messages.
Kicks users with optional specified reason.
/kick <member> <reason>
Arguments:
- member - The member you wish to kick
- reason - The optional reason you kicked the user specified by (default: None)
Bans users with optional specified reason.
/ban <member> <reason>
Arguments:
- member - The member you wish to ban
- reason - The optional reason you banned the user specified by (default: None)
Clears a specified backlog of messages in channel where command was invoked.
/clear <amount>
Arguments:
- amount - Number of previous messages to clear (default: 1)
More about Open AI's general speech recognition model here: LINK
Transcribes the attached audio file using Open AI's Whisper Speech Recognition Model.
/transcribe-audio <attachment>
Arguments:
- attachment - Audio file to transcribe
(If ChetBot and the user running the command have proper manage roles permissions and this command still doesn't work, make sure to place ChetBot's role in the Role Hierarchy of the guild at the top)
Adds the user to the specified role.
/role add <member> <role>
Arguments:
- member - The member to add the role to
- role - The role to add the member to
Removes the user from the specified role.
/role remove <member> <role>
Arguments:
- member - The member to remove the role from
- role - The role to remove from the user
Creates and uploads a file based on the user's descision.
/delimited <desired_file_type> <where_to_split> <user_input>
Desired File Types:
- csv - Creates a csv delimited file based on user input
- line - Creates a line delimited file based on user input
- tab - Creates a tab delimited file based on user input
Combines user attached pdf files via a slash command. This command spawns a button grid for the user to choose the combination order of their new file.
/pdf-combine <attachments>
- attachments - The pdf files that you wish to combine
Converts user attached video/audio files to the desired file type via a slash command. This command spawns a button grid for the user to choose the desired file type of their new file.
/audio <attachments>
Arguments:
- attachments - The attachment(s) you wish to convert
Downloads and converts a YouTube video from the URL given and uploads the mp3 file it converted.
/youtube mp3 <url>
Arguments:
- url - The YouTube URL that you would like ChetBot to download
Downloads a YouTube video from the URL given and uploads it.
(Hidden from general help command as this command only works if the file it generates if less than 8MB, as that is Discord's upload limit currently)
/youtube mp4 <url>
Arguments:
- url - The YouTube URL that you would like ChetBot to download
Makes ChetBot join the Voice Channel that you are currently in.
/voice join
Makes ChetBot leave the Voice Channel that you are currently in.
/voice leave
Makes ChetBot play audio from the URL given. Makes ChetBot join the Voice Channel that you are currently in if it's not in the voice channel with you already.
/voice play <url>
Arguments:
- url - The YouTube URL that you would like ChetBot to play
Makes ChetBot queue audio to play next from the URL given.
/voice queue <url>
Arguments:
- url - The YouTube URL that you would like ChetBot to play next
Makes ChetBot pause the current audio.
/voice pause
Makes ChetBot resume the paused audio.
/voice resume
Makes ChetBot cancel the current audio.
/voice stop
If you need assistance with anything related to ChetBot use this command.
/help
Search for anything you want to on Google and ChetBot returns a link to the search results.
/search google <query>
Arguments:
- query - What you want to search for on Google
Search for anything you want to on YouTube and ChetBot returns a link to the search results.
/search youtube <query>
Arguments:
- query - What you want to search for on YouTube
Search for anything you want to on GitHub and ChetBot returns a link to the search results.
/search github <query>
Arguments:
- query - What you want to search for on Google
Changes the input provided to uppercase.
/up <user_input>
Arguments:
- user_input - Any input given by the user to be changed to uppercase
Changes the input provided to lowercase.
/low <user_input>
Arguments:
- user_input - Any input given by the user to be changed to lowercase
Random number based on range given.
/range <bottom_of_range> <top_of_range>
Arguments:
- bottom_of_range - Bottom of range for random value
- top_of_range - Top of range for random value
Submit feedback to the creator of ChetBot.
/feedback
Launches a persistent ticket creation embed with a 'Create Ticket' button. When the user clicks on the button, they are prompted with a modal asking for additional information that will support the Ticket Support role initially declared when the command was called, then a new ticket text channel is created for them. The chosen ticket_support_role
will get added to every ticket.
/launch-ticketing <ticket_support_role>
Arguments:
- ticket_support_role - The role that you would like to assign as the dedicated Ticket Support
Manually creates a ticket for the desired member. After this command is called, the user is then prompted with a modal asking for additional information that will support the Ticket Support role initially declared when the command was called, then a new ticket text channel is created for the requested member. The chosen ticket_support_role
will get added to every ticket.
/ticket <member> <ticket_support_role>
Arguments:
- member - The member that you would like to open a ticket for
- ticket_support_role - The role that you would like to assign as the dedicated Ticket Support
When inside a ticket text channel, the user can choose to either click the "Close Ticket" button that spawns at the top of every new ticket, or call this command to close out the ticket.
/close
When inside a ticket text channel, the user can choose to either click the "Generate Transcript" button that spawns at the top of every new ticket, or call this command to generate a .log
file that contains the transcripts of the entire ticket.
/transcript
When inside a ticket text channel, the user can call this command to add any users that they think should also be in the ticket.
/add
When inside a ticket text channel, the user can call this command to remove any users that they think should no longer be in the ticket.
/remove
(User must have manage_channels permission to run this. This is assuming that if the user can make a new ticket, they should be able to remove users from them also)
Syncs slash commands based on choice.
/sync
| Global sync/sync !
| Sync current guild/sync *
| Copies all global app commands to current guild and syncs/sync ^
| Clears all commands from the current guild target and syncs (removes guild commands)/sync id_1 id_2
| Syncs guilds with id 1 and 2
Go to the directory where your files have been downloaded or cloned, and in the terminal run the following:
pip install -r requirements.txt
For additional information on the packages that ChetBot utilizes, be sure to take a look at the linked PyPi documentation on each:
- To download FFmpegPCMAudio go to their website, as we are using Windows, we want to use the Windows package
- Click on "Windows build by BtbN"
- On the GitHub repository, find the
ffmpeg-n4.4-latest-win64-gpl-4.4.zip
or similar package, and download it - Extract the .exe files from the .zip file
- Search "path" in the Windows search
- Go to "Edit the System Enviroment Variables"
- Click on "Enviroment Variables"
- Under System Variables double-click on "Path"
- Click "new" and add the file path containing the 3x .exe files extracted
- Click ok, and close out of everything
- Navigate to your cmd, check if FFmpeg is installed with the following:
FFmpeg -version
- Restart your PC to ensure FFmpeg took effect
- Open your Terminal, type the following:
sudo apt install ffmpeg
- Check if FFmpeg is installed with the following:
FFmpeg -version
- Restart your PC to ensure FFmpeg took effect
If you wish to create your own Discord Bot, it needs to work with the Discord API. This section explains how to utilize the discord.py library to work with Discord's API.
- Navigate to:
https://discord.com/developers/applications
- Click on the "New Application"
- Give your application a name and click "Create"
- Next, create a Bot User by navigating to the tab labeled "Bot", and clicking "Add Bot"
- Click "Yes, do it" to continue
- If you want your Bot to be able ot join other people's servers, you must ensure that the option "Public Bot" is checked
- Also, make sure that the option "Require OAuth2 Code Grant" is unchecked unless you are working with or developing a service that needs it.
- Generate your Bot's API Key and copy it
Now that you have that API Key, you can use your program to login to Discord with your new Bot account.
So you made your new Bot, but it is not in any server yet. Here are the steps to invite it to any server of your choosing (Assuming you have permission to invite users).
- Navigate to:
https://discord.com/developers/applications
- Click on your Bot's page
- Go to the "OAuth2" tab on the left-hand side
- Then navigate to the sub-option "OAuth2 URL Generator"
- Tick the "bot" scope checkbox
- A new list of checkbox options should appear under the scopes section called "Bot Permissions"
- Under this new section, check the boxes matching the permissions that your bot will require when it joins a server to function as intended
- Make sure that you are aware of the consequences of requiring your bot to have the “Administrator” permission
- The resulting URL that is generated at the bottom of the screen can be copied when all of the required permissions for your Bot have been checked
- Paste the URL into your web browser and choose which server you would like to have your Bot join, and click "Authorize"
Your Bot should now have successfully joined the Discord Server of your choosing.
Now that you have generated your Discord Bot's API Key and you have invited it to the server(s) of your choosing, you probably want to get to work making your Bot function as you wish.
To do this, make sure that you have cloned the ChetBot files from my GitHub.
- Follow the instructions on the GitHub docs if you are unfamiliar with cloning repositories
- ChetBot repository Link:
https://github.com/ImChet/ChetBot.git
- ChetBot repository Link:
- In the newly cloned ChetBot repository, find the apikeys.py file, navigate to the discordBotAPIKey string definition and place your Discord Bot API Key in it.
You are now ready to use your Discord Bot.
To do this, run the main.py file to sign onto Discord as your Bot.
You may use the built-in ChetBot commands and event listeners as examples for your own Bot. If you wish, you can start from scratch and figure your own way around the discord.py library or view their documentation as reference.