Skip to main content

How to make a your own Discord bot with Python in 2023. #01


I'm sure that you have heard of discord bots way before reading this article. But have you ever tried to make your own bot with Python? If not, this is the time. Let's get started.

Over time tons of discord bot tutorials have been published, but if you follow them they don't help you to build a functional bot because many of the packages used in them are updated and no longer support older syntaxes.

Here is the full guide to creating your own Discord Bot in 2023 with Python.

STEP 1: Create a Discord account

First of all, we have to set up a developer account to create the bot. Actually, you can use your ordinary discord account to access the discord developer portal, but it is highly recommended to create a separate account for development purposes.

You can create a new discord account with this link: https://discord.com/register

STEP 2: Create a new Application

After creating the discord account, you have to go to the discord developer portal and sign in with your newly-created discord account.

After signing in, go to this link: https://discord.com/developers/applications/ 

and click on the New Application button in the top right corner.








Then you can give a name you like to the new application.



















After checking the Terms and Conditions you can hit the Create button.

STEP 3: Build-A-Bot.


Select Bot from the left sidebar and hit the Add Bot button.












After confirming you will be redirected to this page:













STEP 4: Giving Powers
Then you can give the permissions to the bot. More information about the Intents can be seen under every toggle button.

For this tutorial, I will only enable message content intent as this bot is going to interact with the messages.
You can change them anytime you want.






 











After giving the necessary permissions, hit the Save Changes button.


STEP 5: Adding the Bot to a Server.


Finally, we have to add our bot to a server when we can test it. So, it is highly recommended to create a new server and add the bot to it.


To create a new server follow the instructions below:

Open the discord web app or desktop app ( for the web app: https://discord.com/app) 

Click on the + button to add a new server














Then select create my own, after selecting a category or skipping the question, You can give a name you like to the server.

















Then go back to the developer portal Click on OAuth2 > URL Generator and tick the necessary checkboxes shown in the following picture.














Then copy the link at the bottom of the page and paste it on a new tab and hit enter.

After selecting the server that you want the bot to be added to click continue.
Then you can authorize the bot and after the human verification, you would be able to see your new bot in your server.



















The bot is on your server




That's the basic and now we have to write our code. I will talk about it soon in another tutorial.


Thanks for reading and please subscribe to our youtube channel for the next tutorial.



Comments

Trending Now

Let's talk about cryptography.

Have you ever heard of cryptography?  People write their diaries every day. For many of them, their diary is one of their best friends to whom they tell their every secret. What happens when someone else finds such a diary? That would freak out the dairy's owner for sure. Also, it might put their lives in danger. Wise men always hide their diaries so no one else finds it.  But legends hide their message so that only they can read what they wrote. So even if the diary is found by someone else, they cannot know the secrets. for example, I wrote this in my diary today.   P dyval h isvn wvza hivba jyfwavnyhwof avkhf Can you understand it? This is just a very primitive level of cryptography yet powerful enough to hide what I wrote from 90% of people. I will discuss this type of cryptography in the next blog post. The human used cryptography from the very beginning to share their messages in secret and conceal their inventions. As you may know, many people tried to find a recip...

Generate all possible phone numbers with Python | Generates Crores of Phone Numbers within minutes.

Recently,  I learned about itertools in python. Especially, about the functions permutations, combinations, and products and I tried to make a script that generates all phone numbers in our country. I bet your phone number is too on the list. let the hack begin!!! First, you need to install itertools in your computer  Simply open your terminal and type                sudo apt-get  install  -y python-more- itertools Then Write the code below from itertools import product file_name = "phonebook.txt" phonebook = open (file_name, 'a' ) prefixes = [ '+9471' ] product_a = product([ '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' ], [ '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' ], [ '1' , '2' , '3' , '4' , '5...