Discord bot code

Discord bot code DEFAULT

# Initial files

Once you add your bot to a server, the next step is to start coding and get it online! Let's start by creating a config file for your client token and a main file for your bot application.

# Creating configuration files

As explained in the "What is a token, anyway?" section, your token is essentially your bot's password, and you should protect it as best as possible. This can be done through a file or by using environment variables.

Open your application in the Discord Developer Portalopen in new window and go to the "Bot" page to copy your token.

# Using

Storing data in a file is a common way of keeping your sensitive values safe. Create a file in your project directory and paste in your token. You can access your token inside other files by using .

1
2
3

1
2
3

# Using environment variables

Environment variables are special values for your environment (e.g., terminal session, docker container, or environment variable file). You can pass these values into your code's scope so that you can use them.

One way to pass in environment variables is via the command line interface. When starting your app, instead of , use . You can repeat this pattern to expose other values as well.

You can access the set values in your code via the global variable, accessible in any file. Note that values passed this way will always be strings and that you might need to parse them to a number, if using them to do calculations.

1
2
3

# Using dotenv

Another common approach is storing these values in a file. This spares you from always copying your token into the command line. Each line in a file should hold a pair.

You can use the packageopen in new window for this. Once installed, require and use the package to load your file and attach the variables to :

1
2
3

1
2
3
4
5
6
7

# Git and

Git is a fantastic tool to keep track of your code changes and allows you to upload progress to services like GitHubopen in new window, GitLabopen in new window, or Bitbucketopen in new window. While this is super useful to share code with other developers, it also bears the risk of uploading your configuration files with sensitive values!

You can specify files that Git should ignore in its versioning systems with a file. Create a file in your project directory and add the names of the files and folders you want to ignore:

1
2
3

TIP

Aside from keeping credentials safe, should be included here. Since this directory can be restored based on the entries in your and files by running , it does not need to be included in Git.

You can specify quite intricate patterns in files, check out the Git documentation on open in new window for more information!

# Creating the main file

Open your code editor and create a new file. We suggest that you save the file as , but you may name it whatever you wish.

Here's the base code to get you started:

1
2
3
4
5
6
7
8
9
10
11
12
13
14

This is how you create a client instance for your Discord bot and login to Discord. The intents option is necessary for your client to work properly.

Open your terminal and run to start the process. If you see "Ready!" after a few seconds, you're good to go!

TIP

You can open your file and edit the field to point to your main file. You can then run in your terminal to start the process!

After closing the process with , you can press the up arrow on your keyboard to bring up the latest commands you've run. Pressing up and then enter after closing the process is a quick way to start it up again.

# Resulting code

If you want to compare your code to the code we've constructed so far, you can review it over on the GitHub repository here open in new window.

Edit this page open in new window

Last Updated: 9/29/2021, 3:04:03 AM

Sours: https://discordjs.guide/creating-your-bot/

This tutorial will show you how to use JavaScript and Node.js to build your own Discord bot completely in the cloud.

You do not need to install anything on your computer, and you do not need to pay anything to host your bot.

We are going to use a number of tools, including the Discord API, Node.js libraries, and a cloud computing platform called Repl.it.

If you'd rather code your discord bot using Python instead of JavaScript, read this tutorial instead.

There is also a video version of this written tutorial. The video is embedded below and the written version is after the video.

How to Create a Discord Bot Account

In order to work with the Node.js library and the Discord API, we must first create a Discord Bot account.

Here are the step to creating a Discord Bot account.

1. Make sure you’re logged on to the Discord website.

2. Navigate to the application page.

3. Click on the “New Application” button.

4. Give the application a name and click “Create”.

5. Go to the “Bot” tab and then click “Add Bot”. You will have to confirm by clicking "Yes, do it!"

Keep the default settings for Public Bot (checked) and Require OAuth2 Code Grant (unchecked).

Your bot has been created. The next step is to copy the token.

This token is your bot's password so don't share it with anybody. It could allow someone to log in to your bot and do all sorts of bad things.

You can regenerate the token if it accidentally gets shared.

How to Invite Your Bot to Join a Server

Now you have to get your Bot User into a server. To do this, you should create an invite URL for it.

Go to the "OAuth2" tab. Then select "bot" under the "scopes" section.

Now choose the permissions you want for the bot. Our bot is going to mainly use text messages so we don't need a lot of the permissions. You may need more depending on what you want your bot to do. Be careful with the "Administrator" permission.

After selecting the appropriate permissions, click the 'copy' button above the permissions. That will copy a URL which can be used to add the bot to a server.

Paste the URL into your browser, choose a server to invite the bot to, and click “Authorize”.

To add the bot, your account needs "Manage Server" permissions.

Now that you've created the bot user, we'll start writing the Python code for the bot.

How to Code a Basic Discord Bot with the discord.js Library

We'll be using the discord.js Node library to write the code for the bot. discord.js is an API wrapper for Discord that makes it easier to create a Discord bot in Node.js / JavaScript.

How to Create a Repl and Install discord.js

You can develop the bot on your local computer with any code editor. However, in this tutorial, we'll be using Repl.it because it will make it simpler for anyone to follow along. Repl.it is an online IDE that you can use in your web browser.

Start by going to Repl.it. Create a new Repl and choose "Node.js" as the language. This means the programming language will be JavaScript.

To use the discord.js library, just add at the top of . Repl.it will automatically install this dependency when you press the "run" button.

How to Set Up Discord Events for Your Bot

discord.js revolves around the concept of events. An event is something you listen to and then respond to. For example, when a message happens, you will receive an event about it that you can respond to.

Let’s make a bot that replies to a specific message. This simple bot code is taken directly from the discord.js documentation. We will be adding more features to the bot later.

Add this code to main.js. I'll explain what all this code does shortly.

When you created your bot user on Discord, you copied a token. Now we are going to create a file to store the token.

files are used for declaring environment variables. On Repl.it, most files you create are visible to anyone but files are only visible to you.  Other people viewing a public repl will not be able to see the contents of the file.

So if you are developing on Repl.it, only include private information like tokens or keys in a file.

Click the "Add file" button and create a file named .

Inside the file add the following line, including your actual token you copied previously:

Now let's go over what each line of code is doing in your Discord bot code.

The first line imports the discord.js library.  Next, we create an instance of a . This is the connection to Discord.

The is used to check for events.  It accepts an event name, and then a callback function to be called when the event takes place. In this code, the event is called when the bot is ready to start being used. Then, when the Discord server has a new message, the event is called.

The code checks if the equals . If so, then the bot replies with to the channel.

Now that the bot is set up, the final line runs the bot with the login token. It gets the token from out file.

We have the code for the bot so now we just have to run it.

How to Run the Bot

Now click run button on the top to run your bot in repl.it.

Now go to your Discord room and type "ping". Your bot should return "pong".

How to Improve the Bot

Now that we have a basic bot working, we'll improve it. It is called "Encourage Bot" for a reason.

This bot will respond with a message of encouragement whenever someone sends a message containing a sad or depressing word.

Anyone will be able to add encouraging messages for the bot to use and the user-submitted messages will be stored in the Repl.it database.

The bot will also return a random inspirational quote from an API when someone types the message "$inspire" into the chat.

We'll start with adding the "$inspire" feature.

How to Add Inspirational Quotes to the Bot

We will get inspirational quotes from an API called zenquotes.io. We need to import the node-fetch module, add a function, and update our bot code to call the function.

Here is the updated code. After the code, I'll explain the new parts.

We now have to import the module. This module allows our code to make an HTTP request to get data from the API.

The function is pretty straightforward. First, it uses the node-fetch module to request data from the API URL. The API returns a random inspirational quote. This function could easily be rewritten to get quotes from a different API, if the current one stops working.

Then the function converts the response from the API to JSON and creates a string to return. Through trial and error I figured out how to get the quote from the JSON into the string format I wanted. The quote is returned from the function as a string.

The final part updated in the code is toward the end. Previously it looked for the message "ping". Now it looks for "$inspire". Instead of returning "pong", it gets the quote with and returns the quote. We use to send the message to the channel. Also, the code checks if the message comes from the bot itself and if it does, it leaves the function so it does not do anything.

At this point you can run your code and try it out.

How to Add Encouraging Messages to the Bot

Now we will implement the feature where the bot responds with encouraging messages when a user posts a message with a sad word.

How to Add Sad Words to the Bot

First we need to create an array that contains the sad words that the bot will respond to.

Add the following line after the variable is created:

Feel free to add more words to the list.

How to Add Encouraging Messages to the Bot

Now we'll add an array of encouraging messages that the bot will respond with.

Add the following array after the list you created:

Like before, feel free to add more phrases of your choice to the array . I'm just using three items for now because later we'll add the ability for users to add more encouraging phrases for the bot to use.

How to Respond to Messages

Now we need to update our bot to use the two lists we created.

Now we will update the function to check all messages to see if they contain a word from the list. If a sad word is found, the bot will send a random message of encouragement.

Here is the updated code:

This is a good time to test the bot. You know enough now to create your own bot. But next you'll learn how to implement more advanced features and store data using the Repl.it database.

How to Enable User-submitted Messages

The bot is completely functional, but now let's make it possible to update the bot right from Discord. A user should be able to add more encouraging messages for the bot to use when it detects a sad word.

We are going to use Repl.it's built-in database to store user-submitted messages. This database is a key-value store that’s built into every repl.

At the top of the code, under the other import statements, add:

This will allow us to use the Repl.it database. When you run the code, Repl.it should install the database module automatically. If for some reason it doesn't, you may have to go into the Shell tab (not the Console) and type "npm install @replit/database".

After where the array is created, insert the following code to add the encouragements to the database if needed:

Also, rename the array toward the top to .

Users will be able to add custom encouraging messages for the bot to use directly from the Discord chat. Before we add new commands for the bot, let's create two helper functions that will add custom messages to the database and delete them.

Add the following code after the function:

The function accepts an encouraging message as an argument.

First it gets the "encouragements" from the database. Then, it adds the new encouragement to the array, and stores the updated array back in the database under the "encouragements" key.

The function accepts an index as an argument.

It gets the list of encouragements from the database stored under the "encouragements" key. If the length is more than the index, then the list item at that index is deleted. Finally, the updated list is stored back in the database under the "encouragements" key.

Here is the updated code for the function. After the code, I'll explain the new sections.

The sad words section has been updated to use the encouraging messages from the database so user submitted messages can be used.

The next new section of code is used to add a new user-submitted message to the database. If a Discord message starts with "$new", then the text after "$new" will be used as a new encouraging message.

The code splits off the message from the "$new" command and stores the message in a variable. In that line of code, take note of the space in . We want everything after the space.

We call the helper function with the new message, and then the bot sends a message to the discord chat confirming that the message was added.

The third new section (at the end of the code above) checks if a new Discord message starts with "$del". This is the command to delete an item from the "encouragements" list in the database.

The index is split off from the Discord message starting with "$del". Then, the function is called passing in the index to delete. The updated list of encouragements is loaded into the variable, and then the bot sends a message to Discord with the current list.

Final Bot Features

The bot should work so this is a good time to test it. We will now add a few final features.

We will add the ability to get a list of user-submitted messages right from Discord and we will add the ability to turn off and on whether the bot responds to sad words.

I will give you the full final code of the program, and then I'll discuss the updates below the code.

The first section added to the code is right under the list:

We create a new key in the database called "responding" and set it to "true". We'll use this to determine if the bot should respond to sad words or not. Since the database is saved even after the program stops running, we only create the new key if it doesn't already exist.

The next new part of the code is in the section that responds to sad words is now inside this if statement. The bot will only respond to sad words if . The ability to update this value comes after this next section.

Next, after the code to make the bot respond to the "$del" command, there is new code to respond to the "$list" command when sent as a Discord message.

The bot sends the list of encouragements as a Discord message.

The final new section comes next. This code makes the bot respond to the "$responding" command. This command takes an argument of either "true" or "false". Here is a usage example: "$responding true".

The code first pulls off the argument with (like before, note the space in ). Then there is an if/else statement that appropriately sets the "responding" key in the database and sends a notification message back to Discord. If the argument is anything but "true", the code assumes "false".

The code for the bot is complete! You can now run the bot and try it out. But there is one more important step that we will discuss next.

How to Set Up the Bot to Run Continuously

If you run your bot in repl.it and then close the tab it is running in, your bot will stop running.

But there are two ways you can keep your bot running continuously, even after you close your web bowser.

The first way and simplest way is to sign up for paid plan in Repl.it. Their cheapest paid plan is called the Hacker Plan and it includes five always-on Repls.

You can get three months free using this link (limited to first 1000 people):  https://repl.it/claim?code=tryalwayson2103

Once you have signed up for that plan, open your Repl and click the name at the top. Then select the "Always On" option.

There is another way to keep your code running even on the free tier but it is a little more complicated. Repl.it will continue running a web server even after the tab is closed. But even a web server will only run for up to an hour without any use.

Here is what the repl.it docs say:

Once deployed, the server will continue to run in the background, even after you close the browser tab. The server will stay awake and active until an hour after its last request, after which it will enter a sleeping stage. Sleeping repls will be woken up as soon as it receives another request; there is no need to re-run the repl. However, if you make changes to your server, you will need to restart the repl in order to see those changes reflected in the live version.

To keep the bot running continuously, we'll use another free service called Uptime Robot at https://uptimerobot.com/.

Uptime Robot can be set up to ping the bot's web server on repl.it every 5 minutes. With constant pings, the bot will never enter the sleeping stage and will just keep running.

So we have to do two more things to get our bot to run continuously:

  1. create a web server in repl.it and
  2. set up Uptime Robot to continuously ping the web server.

How to Create a Web Server in repl.it

Creating a web server is simpler than you may think.

To do it, create a new file in your project called .

Then add the following code:

In this code, we use express to start a web server. The server returns "Bot is running!" to anyone who visits it. The server will run on a separate thread from our bot. We won't discuss everything here since the rest is not really relevant to our bot.

Now we just need the bot to run this web server.

Add the following line toward the top of  to import the server.

To start the web server when is run, add the following line as the second-to-last line, right before the bot runs.

When you run the bot on repl.it after adding this code, a new web server window will open up. There is a URL shown for the web server. Copy the URL so you can use it in the next section.

How to Set Up Uptime Robot

Now we need to set up Uptime Robot to ping the web server every five minutes. This will cause the bot to run continuously.

Create a free account on https://uptimerobot.com/.

Once you are logged in to your account, click "Add New Monitor".

For the new monitor, select "HTTP(s)" as the Monitor Type and name it whatever you like. Then, paste in the URL of your web server from repl.it. Finally, click "Create Monitor".

We're done! Now the bot will run continuously so people can always interact with it on Repl.it.

Conclusion

You now know how to create a Discord bot with JavaScript, and run it continuously in the cloud.

There are a lot of other things that the discord.js library can do. So if you want to give a Discord bot even more features, your next step is to check out the docs for discord.js.



If you read this far, tweet to the author to show them you care. Tweet a thanks

Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started

Sours: https://www.freecodecamp.org/news/create-a-discord-bot-with-javascript-nodejs/
  1. 1660 ti hashrate
  2. Victory park spac
  3. Bang bang pdx
  4. Maria alejandra marquez
  5. Houses for rent 33183

How to create a music bot using Discord.js

The discord API provides you with an easy tool to create and use your own bots and tools. Today we are going to take a look at how we can create a basic music bot and add it to our server. The bot will be able to play, skip and stop the music and will also support queuing functionality.

Prerequisites

Before we get started creating the bot make sure that you have installed all the needed tools.

After the installation, we can continue by setting up our discord bot.

Setting up a discord bot

First, we need to create a new application on the discord development portal.

We can do so by visiting the portal and clicking on new application.

Creating a new application

After that, we need to give our application a name and click the create button.

Creating a discord bot

After that, we need to select the bot tab and click on add bot.

Discord bot information page

Now our bot is created and we can continue with inviting it to our server.

Adding the bot to your server

After creating our bot we can invite it using the OAuth2 URL Generator.

For that, we need to navigate to the OAuth2 page and select bot in the scope tap.

OAuth2 tab

After that, we need to select the needed permissions to play music and read messages.

Giving the discord bot the needed permissions

Then we can copy our generated URL and paste it into our browser.

Discord bot invite link

After pasting it, we add it to our server by selecting the server and clicking the authorize button.

Invite the bot to the server

Creating our project

Now we can start creating our project using our terminal.

First, we create a directory and move into it. We can do so by using these two commands.

After that, we can create our project modules using the npm init command. After entering the command you will be asked some questions just answer them and continue.

Then we just need to create the two files we will work in.

Now we just need to open our project in our text editor. I personally use VS Code and can open it with the following command.

Discord js basics

Now we just need to install some dependencies before we can get started.

After the installation finished we can continue with writing our config.json file. Here we save the token of our bot and the prefix he should listen for.

To get your token you need to visit the discord developer portal again and copy it from the bot section.

Copy token

That are the only things we need to do in our config.json file. So let’s start writing our javascript code.

First, we need to import all our dependencies.

After that, we can create our client and login using our token.

Now let’s add some basic listeners that console.log when they get executed.

After that, we can start our bot using the node command and he should be online on discord and print “Ready!” in the console.

Reading messages

Now that our bot is on our server and able to go online, we can start reading chat messages and responding to them.

To read messages we only need to write one simple function.

Here we create a listener for the message event and get the message and save it into a message object if it is triggered.

Now we need to check if the message is from our own bot and ignore it if it is.

In this line, we check if the author of the message is our bot and return if it is.

After that, we check if the message starts with the prefix we defined earlier and return if it doesn’t.

After that, we can check which command we need to execute. We can do so using some simple if statements.

In this code block, we check which command to execute and call the command. If the input command isn’t valid we write an error message into the chat using the send() function.

Now that we know which command we need to execute we can start implementing these commands.

Adding songs

Let's start by adding the play command. For that, we need a song and a guild (A guild represent an isolated collection of users and channels and is often referred to as a server). We also need the ytdl library we installed earlier.

First, we need to create a map with the name of the queue where we save all the songs we type in the chat.

After that, we create an async function called execute and check if the user is in a voice chat and if the bot has the right permission. If not we write an error message and return.

Now we can continue with getting the song info and saving it into a song object. For that, we use our ytdl library which gets the song information from the youtube link.

This will get the information of the song using the ytdl library we installed earlier. Then we save the information we need into a song object.

After saving the song info we just need to create a contract we can add to our queue. To do so we first need to check if our serverQueue is already defined which means that music is already playing. If so we just need to add the song to our existing serverQueue and send a success message. If not we need to create it and try to join the voice channel and start playing music.

Here we check if the serverQueue is empty and add the song to it if it’s not. Now we just need to create our contract if the serverQueue is null.

In this code block, we create a contract and add our song to the songs array. After that, we try to join the voice chat of the user and call our play() function we will implement after that.

Playing songs

Now that we can add our songs to our queue and create a contract if there isn’t one yet we can start implementing our play functionality.

First, we will create a function called play which takes two parameters (the guild and the song we want to play) and checks if the song is empty. If so we will just leave the voice channel and delete the queue.

After that, we will start playing our song using the play() function of the connection and passing the URL of our song.

Here we create a stream and pass it the URL of our song. We also add two listeners that handle the end and error event.

Note: This is a recursive function which means that it calls itself over and over again. We use recursion so it plays the next song when the song is finished.

Now we are ready to play a song by just typing !play URL in the chat.

Skipping songs

Now we can start implementing the skipping functionality. For that, we just need to end the dispatcher we created in our play() function so it starts the next song.

Here we check if the user that typed the command is in a voice channel and if there is a song to skip.

Stoping songs

The stop() function is almost the same as the skip() except that we clear the songs array which will make our bot delete the queue and leave the voice chat.

Complete source code for the index.js:

Here you can get the complete source code for our music bot:

Conclusion

You made it all the way until the end! Hope that this article helped you understand the Discord API and how you can use it to create a simple bot. If you want to see an example of a more advanced discord bot you can visit my Github repository.

If you have found this useful, please consider recommending and sharing it with other fellow developers.

If you have any questions or feedback, let me know in the comments down below.

Sours: https://gabrieltanner.org/blog/dicord-music-bot
Creating a Discord Bot in Python 3.9 Tutorial (Fast \u0026 Easy)

Make a Discord bot in just 30 lines of code.

Hey everyone 👋🏻, today we are going to make a discord bot 🤖 which will send gifs according to the user in just 30 lines of code!

The way this bot will work is, if you write then the bot will send a random happy gif.

What are we going to use to build this mini-project:

  • JavaScript
  • NPM Packages:
    • Discord.js
    • DOTENV
    • node-fetch

Okay so let's get started 🎉!!

Steps :

  1. We have to go to the discord developer portal and create a new application.

portal

  1. Then you have to create a new application ☝🏻. .
  2. Give a name to your application.
  3. Then on the left hand side, click on bot👇🏻 .
  4. second
  5. After clicking on bot, now click on on the right hand side, and after this step you will have a screen like this 👇🏻.
  6. third
  7. Now the Token is something which you have to keep a secret and not reveal anywhere or to anyone.
  8. If you reveal it by mistake, no worries just regenerate it, but make sure you don't or else someone can take over your bot.
  9. Now we have to decide what permissions does our bot need, and after deciding this, just head to OAuth2 section on the right hand side of your screen.
  10. You will have a screen when many check boxes, and you have to click on the checkbox which says 👇🏻.
  11. four
  12. Then click on the permission you have to give to the bot.
  13. After that click on the link and copy it, after that paste it into a new tab and authorize it to add it to a new server.

Now we just have to code it!

Before explaining the code, let me explain you the folder structure 👇🏻.

folder

  1. There is a folder called in which we have a main file called in which we are going to code our bot.
  2. Okay so you can see that there are two files and a folder, named as , and respectively, they are basically of node packages and their information.
  3. There is also a file but we will discuss about it later in this blog.
  4. Okay so we have to use 3 packages to make a discord bot, they are as follows:
    1. discord.js ()
    2. dotenv ()
    3. node-fetch ()
  5. Now using this image as my reference, I am going to explain the code.
  6. code

As you can see ☝🏻, there are only 30 lines of code! How amazing it that?

Your own discord bot 🤖 in just 30 lines of code!

Okay so the first and the third line of code are the import statements which can also be written as :

The second line of code is basically us initializing the client/user, which in this case will be our bot and the users themselves .

and the fourth line is importing the env package and configuring it, so basically files stores all your secrets, like your discord bot's token or your API Key, these things will not be uploaded on GitHub using the git ignore file.

Okay so in JavaScript there is this thing called which helps us to react to certain events, like if a user clicks on something or double-tap on something a particular function should run.

In the same way here in discord.js is more or less replaced by function.

All of the functions are called in regards to the so we have to write .

On line number 6 you can see that I have written a function which is

ready

This basically means that, whenever the user is ready and logged in the console should log and name of the bot is fetched by this inbuilt property known as , which is to be called in regards to the .

Now we have to make our bot login to the server. And for that we have another inbuilt method/function called .

So we can write :

Now you might wonder what is this , this is the way we call variables from our file.
So let me show what is stored inside file.

env

Here in this file, we have to put our bot token inside a pair of single or double quotes and our tenor API key (you can generate it from here)

For example if you want to call the inside your file, you just have to write .

And you can make a block around the function, so if any error occurs, we can catch it and show it on the console.

try-catch
So as of now, we have our boiler plate code ready with us, which is 👇🏻:

boiler

Let's code the main functionality of the bot now.

Now all the code discussed below will be in the reference to 👇🏻 this image.

main

Now let's understand the above code step-by-step:

  1. Creating an add event listener to react when the user sends message:
    1. addEve
    2. Here the parameter will contain the message which user has sent.
  2. Let's add a prefix to our bot, so it will only react if we write .
    1. Just to be a little safe, I am going to write the main functionality inside a block.
    2. try
    3. helps us to fetch the content inside the msg. In leman's term, it is like in JavaScript.
    4. Here when the user will write the code inside the statement will be executed.
  3. Now let's get user's queries.
    1. Now if a user writes then this will be considered as a string and a problem arises here, which is how do we separate the bot command and the user's query.
    2. We do that by an inbuilt function called , which will help us to separate the whole string into two different values stored in an array, for example: if I write then will make an array : .
    3. Let's see it's code.
    4. split
    5. We are going to compare the which will be to the string .gif.
  4. Let's discuss about the API and Fetching it.
    1. I am using node-fetch to fetch the API.
    2. The base of the API is
      1. And in order to take query from the user and give the key as your API Key we have to make this URL dynamic.
      2. We can do that by using template literals.
        1. And now the code looks like this.
        2. url
        3. And the query has to be the second value (First Index) in the array.
      3. Let's fetch the API now.
        1. We just have to put in front of the callback function as you can see in the above image on line number 10.
        2. will make your function, asynchronous and then we will use to wait for the response from the API.
        3. without
        4. Now here we will have a problem, which is we will only receive one GIF every time.
        5. Now the API will return 20 GIFs and we have to pick a random one (on line 17).
        6. So to do this, we will make a random variable which will choose one GIF.
        7. Now the final code looks like 👇🏻
        8. final
    3. Let's run this.
      1. Just open the terminal, change the directory to the home directory and inside folder, then write .

    Thank you for reading the whole blog 🎉!! If you liked it do share it with your developer friends and feel free to comment and give suggestions.


    Sours: https://dev.to/shreyazz/make-a-discord-bot-in-just-30-lines-of-code-44el

    Bot code discord

    Having touched the tip of their finger several times to her lips, they found that from each touch her body seemed to be hitting her lips by an invisible lightning and she could not restrain herself, as if from a blow she was bending with force and trembling with her lips, unable to contain a quiet one that looked more like a supplication moan. Uncertainly, looking at her, Alice slightly pulled her finger up, as if asking whether it was necessary to continue this strange torture, her.

    Hair, as before, surrounded her prostrate naked body in a cozy tent, despite the shock from the sharp and unusual sensations. When she poked into her. already flowing.

    Creating a Discord Bot in Python 3.9 Tutorial (Fast \u0026 Easy)

    Samir stroked my back, kissed my face, and I just purred like a cat with pleasure. When after a while I was able to come to my senses, I got off his penis and sat down between his legs. She took his drooping member and began to kiss him, collecting our juices from him.

    Similar news:

    Well, in the shower. I had to wash off the cosmetics, I suffered. After spending 15 minutes under hot streams, I go out and see a man in the mirror again. Damn, in this form it is somehow even indecent to appear in public ".



    12826 12827 12828 12829 12830