#1.Introduction To Discord.py
Tags: python, beginners, discord, tutorial
Published: 2023-07-04 08:37:48

## Introduction and basic stuff
Hey Guys!
I am Mannu from India and from today on we are gonna start discord.py and discord.ext...
Its great thing to learn coz creating our own bot that can do what u want is something like a dream which we will be making a reality.

I will create a new [repository](https://github.com/MannuVilasara/discord.py-tutorial) where I will publish all the code.

So let's start by setting up our files, well nm just create a normal python file (main.py) and let's get started.

1.So the first step for us is to install discord.py.Run the following command in terminal
```bash
pip install discord.py
```
and please don't comment saying pip is not recognized or something 💀

Now as our discord.py is installed let's get into the code.
we will be using discord.ext for this tutorial.

2.Now leave the codebase for a while. Go to this [link](https://discord.com/developers/applications) and click on the new application button on top right corner

![Create Application](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0og8h4c4khjtswmu8bf2.png)

`You may need to login`

Name Anything you like to ur application and click create button.

![Setting up application](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8vi64ub7kya9fhwfz3gs.png)

Do Some Customization if u wanna do in general like changing pfp or sum
3.Then on the right side click on this Bot Panel

![Bot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dactd0eivx6wdv3mlsms.png)

Then U will See some stuff like this 

![Bot Panel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cw8f1bkg7zajyqq1voes.png)

Well our bot username will be different, U can change it with whatever u want. Then Go down and enabled these Privileged Gateway Intents


![Intents](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sh2wmozmnbo8oxfxu7iv.png)


These are some intents that our bot need to function.

Go to the top and click on the reset token

![Token](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ia04rwnttaamodn9gmzd.png)
 then click on copy and copy it. (I'll reset this token it was just to show uall )
Save that token somewhere you will need that to control your bot.
`NOTE: PLEASE DO NOT SHARE YOUR BOT TOKEN TO ANYONE.`
4.Then go to OAuth2 ==> URL Generator

![OAuth2 Tab](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vxdey94wz530ck90hqgo.png)

Select Bot and Applications.commands in scopes and give the required permisions, I am giving admin permission for now and you can also give that but don't give administrator to bot while production.
![scopes and perms](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n6br4ydcg1830pm3zhgl.png)

Copy the Generated URL and paste it into any any empty tab and the bot in your server.
![Generated URL](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eehgeiladvw8j95wpx1p.png)

I created a server named discord.py tutorial specially for this tutorial you can do join the [server](https://discord.gg/pvvJvZU6nS) and contact me there.
![Inviting Bot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ctttowy8kl6tue3hrjka.png)
Click on Continue and Authorize

![Inviting bot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s7jjz8put0vcq8mge3ns.png)
And there you go, successfully created a bot and invited it into the server.

![Invited](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7expdm7wbja93lagnhsb.png)

![Invited](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m25lti2i32sw2z1tvm2i.png)

Well this is just beginning.....

I'll be publishing more tutorials on discord.py soon

Up next we will learn how to make our bot online will create our first command. 

Till then Bye Bye and Cya
do like and make sure to follow...