Python: Making a Discord bot (Part 1: Setup)

Lucas · 716K views · 2019 · 16:28

Open on YouTube

Python, Ruby & scripting languagesSoftware (other)tutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as a beginner walkthrough for starting a discord.py bot, and several people cite it as the tutorial they were following when their bot would not come online.

Recommended by 1 people across 1 different months, 2019 to 2021.

What it is

A 16-minute Python tutorial from 2019 on setting up a Discord bot with discord.py v1.0.1 (the rewrite). It walks through the initial setup and a minimal bot, and points to the library's GitHub, docs and a help server.

What people said

Recommends Michael · 2021-11 · Stack Overflow · on “I'm new to making a discord bot with python, and I'm having trouble with it. I send "$hello" to get a response, but nothing happens”

Can I recommend you watch an easy tutorial to start off where they explain things better This one works but is a bit outdated [this video] or This one is newer but full disclosure I made it [LINK] @Dusco_11

Cites Biray Barca · 2019-11 · Stack Overflow · on “Python Discord bot doesn't go online when code is ran”

I'm using PyCharm to make a discord bot and I'm following a tutorial ( [this video] ). I followed every step and at the end everything is right but whenever I run the code at the end of the video the bot doesn't go online as shown. import discord from discord.ext import commands client = commands.Bot(command_prefix= '.') @client.event async def on_ready(): print("Bot is ready.") client.run('token') obviously the 'token' is my token from the discord website but I still get issues with it. I also don't get any errors, the code runs just fine. This is the only thing that's shown in the "Run" window in PyCharm. C:\Users\user\PycharmProjects\discord\venv\Scripts\python.exe

Cites SmallButts · 2020-06 · Stack Overflow · on “Discord Bot not coming online”

I'm using Visual Studio Code for my bot. I just started and I can't get my bot to come online. This is my code from discord.ext import commands client = commands.Bot(command_prefix = '-') @client.event async def on_ready(): print('YEEEEEEEEET') client.run('BOT_TOKEN') I'm following tutorial from [this video]

Cites Ayush Tripathi · 2020-10 · Stack Overflow · on “Python Discord Bot "cannot connect to host" - Stays Offline”

I am creating my first python discord bot with the latest version of python installed on Atom. I am currently following a tutorial on YouTube done in Python 3.6.5 [this video] The tutorial has been straightforward, as I pip installed discord and replicated the setup code shown in the tutorial. My code is here (the token will not be shown). import discord from discord.ext import commands client = commands.Bot(command_prefix = '!') @client.event async def on_ready(): print('Bot is ready.') client.run('insert token here') When I run this program, I get this very long error message, which says that the bot cannot connect to the host discord.com:443 Traceback (most recent call last): File "C:\Users\ay

Cites Duhon · 2021-05 · Stack Overflow · on “How do I make a bot send a random online picture and quote using a command?”

With discord.py, you can just use a basic bot example (Just Google how to do one if you don't know, plenty of tutorials are awesome) + a list with links to imgur images which are randomly picked on command. Example: Note: Needs to import random @bot.command() async def quote(ctx): quoteList = [] # Put your quotes here! linkList = [] # Put imgur image links here. await ctx.send(str(random.choice(quoteList), random.choice(linkList)) Reference: random.choice() [LINK] discord.py docs [LINK] Discord bot on Python tutorial [this video]