DEV Community

Ekcum
Ekcum

Posted on

First Setup to programm a discord bot in python

Hey, you want to create a bot?
Then you are in the right post for that.
Questions are always welcome and I wish you happy coding.

As a smallsidenote: I wrote this to get myself and the world a good explanation of what i programmed. The bot developed in this project is a multipurposebot called ModNPC. You can add him by this clicking this: Just a link.

In this small article we will talk about the basics to create a bot and what you need to develop a bot.

First you need to create a bot. Do this on this website:
https://discord.com/developers/applications
Create a new bot. After that get your token from this menu:
Image description
Please save it and dont share it with anybody u dont trust. It can easily cause server to collapse. After that i recommand, activating this checkboxes:
Image description
Also activate the permissions your bot need to operate normally:
Image description

For developing your bot u will debug a lot. For this create an own discord server. After that invite your bot over the developer portal on this server:

Image description

Dont forget to activate in the first checkerbox bot. After that you choose which rights your bot should have with this link. After this just copy the link, enter in your browser and add the bot to the right server.

For programming a bot, you need to install these libs by entering this in your terminal:
pip install discord.ext.context
py -3 -m pip install -U discord.py update-command: pip install --upgrade discord.py

This is what you need to develop a bot.

Top comments (0)