graphictama.blogg.se

How to make steam stop playing music
How to make steam stop playing music









how to make steam stop playing music

Now we can start implementing the skipping functionality. Now we are ready to play a song by just typing !play URL in the chat. We use recursion so it plays the next song when the song is finished. Note: This is a recursive function which means that it calls itself over and over again. We also add two listeners that handle the end and error event. Here we create a stream and pass it the URL of our song. Here we save the token of our bot and the prefix he should listen for.

how to make steam stop playing music

npm install discord.js ffmpeg fluent-ffmpeg ytdl-core -saveĪfter the installation finished we can continue with writing our config.json file. Now we just need to install some dependencies before we can get started. I personally use VS Code and can open it with the following command. Now we just need to open our project in our text editor. Then we just need to create the two files we will work in. After entering the command you will be asked some questions just answer them and continue. mkdir musicbot & cd musicbotĪfter that, we can create our project modules using the npm init command. We can do so by using these two commands. Now we can start creating our project using our terminal.įirst, we create a directory and move into it.

how to make steam stop playing music

Invite the bot to the server Creating our project Discord bot invite linkĪfter pasting it, we add it to our server by selecting the server and clicking the authorize button. Then we can copy our generated URL and paste it into our browser. Giving the discord bot the needed permissions OAuth2 tabĪfter that, we need to select the needed permissions to play music and read messages. Adding the bot to your serverĪfter creating our bot we can invite it using the OAuth2 URL Generator.įor that, we need to navigate to the OAuth2 page and select bot in the scope tap. Now our bot is created and we can continue with inviting it to our server. Creating a discord botĪfter that, we need to select the bot tab and click on add bot. Creating a new applicationĪfter that, we need to give our application a name and click the create button. We can do so by visiting the portal and clicking on new application. Setting up a discord botįirst, we need to create a new application on the discord development portal. Prerequisitesīefore we get started creating the bot make sure that you have installed all the needed tools.Īfter the installation, we can continue by setting up our discord bot. The bot will be able to play, skip, and stop the music and will also support queuing functionality. Today we are going to take a look at how we can create a basic music bot and add it to our server. The discord API provides you with an easy tool to create and use your own bots and tools.











How to make steam stop playing music