How to make a Discord Bot in Python! (Part 1: Setup) (2021 Update)

preview_player
Показать описание
Looking to create a Discord Bot for your server? Well then, this is the first video in my new series in where I should you how to create a fully functioning bot in Python for your server.
In this video, I go over how to setup your discord bot on your server and how to make a basic command.

►Links:

►Social Media:

► Business Inquiries ONLY

#discordbot #discord
Рекомендации по теме
Комментарии
Автор

for people having an issues at the line "client = commands.Bot". replace it by "client = commands.Bot(command_prefix='?', You need to add an 'intents' on the new version of the API

thedragopolunga
Автор

Even after 2 years, this tutorial is very helpful to beginners like me.

By the way, if your bot isn't working, change client = to client = commands.Bot(command_prefix="!", and enable all the "intents" in the bot section of the developer portal.

Edit: A lot of people are confused on what the intents are, it's under the "bot" tab, scroll down, and you'll see "privileged gateway intents." Enable all of them.

revivedblue
Автор

this is so what i’ve been looking for, someone who ACTUALLY explains what they are doing when they’re typing a bunch of stuff beginners dont know or understand. brilliant. would love an update involving intents and slash commands but for now, bless ya james

yarfableaz
Автор

i have literally never written any program or code stuff in my life. i'm 36 and i desided this is a good time to learn it as i have free time.

thank you so much for making this more understandable for beginner like me. i loved the way you explained "ready" for us lol. gave me a giggle and i actually understood what you was trying to say.

Kestrel
Автор

wow im 40 secons in, does this guy's voice keep being like this? its hilarious :D, can't wait to watch the series!!

flydragon
Автор

even that im not a native english speaker and despite the english accent, the explanation really helps thanks fo the content my bRôDeR

-uj
Автор

very comprehensive tutorial - you've done well to make this beginner friendly

aaaxel
Автор

Love your enthusiasm James, really easy to follow and a bit of excitement at the end. Top job. Subscribed.

Neemulus
Автор

For those that don't work, try replacing everything this way:

import discord
from discord.ext import commands

intents = discord.Intents.all()
client = commands.Bot(command_prefix = "!", intents=intents)

@client.event
async def on_ready():
print("Bot is Run")

@client.command()
async def hello(ctx):
await ctx.send("hello!")

MisterKingouCh
Автор

Very helpful, I appreciated how thorough your explanations were! Looking forward to checking out the next parts in the series.

stoobe
Автор

they updated stuff. Add this to make it work and enable all the "intents" in the bot section of the developer portal.

intents = discord.Intents.all()

client = commands.Bot(command_prefix = '!', intents=intents)

MisterQuacker
Автор

This is my first time making a bot and i saw other tutorials but this the best i found and this really helped me understand how this works and also i am new to python and this guy explained everything very well and not like other tutorials where they just say learn to code before making a bot xD

aviraj
Автор

If anyone's bot command isn't working, go to the dev portal and under bot there are three options: PRESENCE INTENT, SERVER MEMBERS INTENT, and MESSAGE CONTENT INTENT. Enable all of them.

NotRendr
Автор

Very cool ... so far the best explanatory video for beginners

timothyokonkwo
Автор

Why my bot has no response when i type "!hello" ?
the bot is online on my server and send on_ready() message on the text channel..
is any code or API change in 2022 discord.py?

Ceres
Автор

For those wondering how to get it working in 2024, you need to put the following lines right under your imports:

intents = discord.Intents.default()
intents.message_content = True
intents.guilds = True

and then change the 'client = command.Bot(...) line to:
client = commands.Bot(command_prefix = '!', intents=intents)

Congrats! Now it's working.
If it still doesn't work, set your bot to all intents/admin in the discord developer portal, save, and reset the token. paste the token in code inside client.run(), make sure to save. stop the current run and rerun the bot. then it should immediately go online within 2 seconds.

TheHalalStudent
Автор

it doesnt work for me it says 'No module named 'discord' why? i did everything alright?? please help

ABorneoOrangutan
Автор

This is a great video, just that I did have trouble since discords things have changed around and I had to add intents at the adding prefix stage.
So here's the solution I found if people are also getting "TypeError: BotBase.__init__() missing 1 required keyword-only argument: 'intents'"
intents = discord.Intents.all()
client = commands.Bot(command_prefix = '!', intents=intents)
And then Enable the Intents under the Privilaged Gateway Intents Section in the Developer Portal and it should run just fine!

stephengaming
Автор

My bot is working. And it is online. but if I say !hello it doesn't responding

Neongamer_
Автор

Can someone tell me why its giving me an error when i do it 19:00 im in 3.12.6 version and installed all the packages and putted the right name of the file and gave my bot an administrator idk what im missing

Can someone please help me❤

MMD-ofll