Code a Discord Bot with Python - Host for Free in the Cloud

  Рет қаралды 2,404,864

freeCodeCamp.org

freeCodeCamp.org

Күн бұрын

Пікірлер: 3 500
@freecodecamp
@freecodecamp 3 жыл бұрын
At 16:43, Replit has a new method for .env: docs.replit.com/programming-ide/storing-sensitive-information-environment-variables The Python Discord library used in this video is no longer being updated. Consider making your bot in JavaScript: kzbin.info/www/bejne/baO4kH6vqsl6eLs
@dash1rl
@dash1rl 3 жыл бұрын
help -please
@xuamnhac
@xuamnhac 3 жыл бұрын
help me add quote web?
@Aravind_Ap
@Aravind_Ap 3 жыл бұрын
Hey I Removed Random Command because I Wanted to get the value Directly Full Value But I Get [ " Text "] like this only how to remove that bracket And Get Text Alone
@jx3715
@jx3715 3 жыл бұрын
you are so late for this news🤣🤣🤣🤣
@Aravind_Ap
@Aravind_Ap 3 жыл бұрын
@@jx3715 😂
@KH-sf5pu
@KH-sf5pu 3 жыл бұрын
Me: im depressed Bot: nice
@bulbuladhikary
@bulbuladhikary 3 жыл бұрын
very sad!! #Thug_life_Bot
@burndowntheworld
@burndowntheworld 3 жыл бұрын
Lmao, ikr
@electrious_46
@electrious_46 3 жыл бұрын
the best bot lmao
@yelloe_birb
@yelloe_birb 3 жыл бұрын
petition for discord to verify this bot, anyone?
@watereater2547
@watereater2547 3 жыл бұрын
Should name it no feelings bot i mean its true
@BeauCarnes
@BeauCarnes 3 жыл бұрын
There may soon be more bots on Discord than people. :)
@spotted2857
@spotted2857 3 жыл бұрын
First reply. Deez Nuts
@INTryzyka
@INTryzyka 3 жыл бұрын
Second Reply. Candice
@qtbee2937
@qtbee2937 3 жыл бұрын
Third reply Kenya
@Em-gj2sg
@Em-gj2sg 3 жыл бұрын
Fourth reply. Ligma
@6dennis98
@6dennis98 3 жыл бұрын
8th Reply
@MaximQuantum
@MaximQuantum 2 жыл бұрын
This is such a great tutorial! Literally people with 0 experience in discord bots can start, maybe even people totally new to python. And it includes the whole package of all the essentials, the framework. Most KZbinrs split this up in like a gazillion videos in a playlist, but this video absolutely dominates them all!! Thank you so much!!!
@flight7511
@flight7511 2 жыл бұрын
Well if you know nothing abour python, jumping straight into making discord bots isnt gonna help, heck, i made a few programs in python and im still not gonna be able to code a bot all by myself.
@goatmike4747
@goatmike4747 2 жыл бұрын
it doesn’t work for me
@Adjgbfd
@Adjgbfd Жыл бұрын
I would know i didnt even know how to make it lol
@toastercs_
@toastercs_ 3 жыл бұрын
58:19 *i am depressed* *_nice_* this bot is a genius
@sivasaran4
@sivasaran4 3 жыл бұрын
What I want to know before going through this
@ishanchoudhary4179
@ishanchoudhary4179 3 жыл бұрын
@@sivasaran4 Its like this because NLP (natural language processing, a form of AI), isn't used here, and we are simply coding in the text
@sivasaran4
@sivasaran4 3 жыл бұрын
@@ishanchoudhary4179 ok, I want to know basic django because he not explaining all
@jacobamarjan2325
@jacobamarjan2325 3 жыл бұрын
@@sivasaran4 umm this video isn't about django
@SentinelAerospaceOfficial
@SentinelAerospaceOfficial 3 жыл бұрын
ehy cant i create a .env file
@barrettross3772
@barrettross3772 3 жыл бұрын
In the introduction, it sounds like he has a gun to his head and is being forced to read the introduction script as fast as he can.
@fortified4799
@fortified4799 3 жыл бұрын
lol
@barabara9855
@barabara9855 3 жыл бұрын
he always talks like that it's hilarious
@chrispysaid
@chrispysaid 3 жыл бұрын
That's just how dude talks, he spec'd into intelligence not charisma
@njbrx
@njbrx 3 жыл бұрын
@@chrispysaid lol
@simpilot001
@simpilot001 3 жыл бұрын
Oddly specific…
@withJed
@withJed 3 жыл бұрын
It's awesome how I understand these functions now, 5 months ago I started studying Python, thankfully now I know a bit
@BAnirudhSV
@BAnirudhSV 3 жыл бұрын
Nice!!
@wyvern-
@wyvern- 3 жыл бұрын
im trying to start out coding in python,any tips of how to start as im kinda overwhelmed and dont have any where to start
@withJed
@withJed 3 жыл бұрын
@@wyvern- For me, having a goal is what keeps me motivated on coding. Join a coding community for beginners so that you won't feel lonely or stressed. And sleep early then study once you're awake, but don't forget to do other things that hits your interests... it's always good to have balance
@BAnirudhSV
@BAnirudhSV 3 жыл бұрын
@@dreamteamextrayt o
@B1ngMing
@B1ngMing 3 жыл бұрын
Just started learning last 2 weeks ago, have 0 clues what he's saying, I only know import and function
@moeheil8839
@moeheil8839 2 жыл бұрын
I have to say, you make coding seem alot less intimidating, good job
@swarmofmudkipz
@swarmofmudkipz 2 жыл бұрын
i just got on my adhd meds for the first time and this was my first project. I struggled with focusing on stuff like this for a long time. It was like 'blah blah blah get to the point' but this was a really great learning experience for me and I got to make something fun and neat and i've even made my own list of gifs that post randomly when a certain word has been said. thanks so much!
@essagamer1438
@essagamer1438 3 жыл бұрын
Me: I murdered someone's parents and made him miserable bot: You're a great person, cheer up!
@loazzu7544
@loazzu7544 3 жыл бұрын
i love this statement! The bot forgave the both of us for what we did! :D
@ryan-gn9gh
@ryan-gn9gh 3 жыл бұрын
LMAO
@Akira-sh7ts
@Akira-sh7ts 3 жыл бұрын
lol
@loazzu7544
@loazzu7544 3 жыл бұрын
@THE_07 indeed
@essagamer1438
@essagamer1438 3 жыл бұрын
@Clockza 😮
@aidynskullz4139
@aidynskullz4139 3 жыл бұрын
Me: Let's code a discord bot during the winter break This GOAT channel: I got you fam!! Video's on the way...
@fog1
@fog1 3 жыл бұрын
This
@tfolz1351
@tfolz1351 3 жыл бұрын
what does goat means?
@aidynskullz4139
@aidynskullz4139 3 жыл бұрын
@@tfolz1351 Greatest Of All Time
@code_philic
@code_philic 3 жыл бұрын
If you get an error when you use options = options + db["encouragements"] I has an error using this try using options = options + db["encouragements"].value I think why by adding .value it works is because in the earlier statement we were trying to concatenate a list/array with a dictionary kind of thing which had {value=[//Your message]}. By adding value I was able to concatenate the message to the database.
@Atharv_Shukla1
@Atharv_Shukla1 3 жыл бұрын
tysm man i was looking for this comment.
@redsturgeon9623
@redsturgeon9623 3 жыл бұрын
Omg yess, finally.
@jchao578
@jchao578 3 жыл бұрын
this sadly didnt work for me
@amazingdestroy
@amazingdestroy 3 жыл бұрын
Thank you!!!
@Emmanuisaac
@Emmanuisaac 3 жыл бұрын
You are amazing
@i.nakanon
@i.nakanon Жыл бұрын
for anyone who gets the missing keyword on 4th line "client = discord.Client()" use this "client = discord.Client(intents=discord.Intents.default())" and those who cant figure how .env isnt working then goto tools(on left hand side)>secrets>add secret then set the key to TOKEN and value as your bot token hope it helps, Enjoy!
@bobfish7777
@bobfish7777 Жыл бұрын
You are the best, U saved my bot! Thank you soo much!!!
@IPi6
@IPi6 6 ай бұрын
bro its still not working
@IPi6
@IPi6 6 ай бұрын
its saying client = discord.Client() TypeError: Client.__init__() missing 1 required keyword-only argument: 'intents
@aakashjana6225
@aakashjana6225 3 жыл бұрын
Coded my own bot for my discord server and yeah this is by far the most easiest and simplest tutorial on how to make a discord bot ! Great work man expecting more tutos from you!
@mateuszsieraszewski7666
@mateuszsieraszewski7666 3 жыл бұрын
BROO THANK YOU SO MUCH, i already did the basic bot before but you helped me with responding to messages function.
@yangwilliam3137
@yangwilliam3137 Жыл бұрын
If there is an issue with the intents, or if your bot is not responding where you put in everything as is in the video, replace the client line with the following two lines: intents = discord.Intents().all() client = discord.Client(intents=intents);
@puskeyman
@puskeyman Жыл бұрын
wow thank you so much you are so cool whichever lady ends up with you i bet she is going to be extremely happy but just remember bros before hoes
@pepememe6561
@pepememe6561 Жыл бұрын
Remember to also toggle ALL privileged gateway intents in the discord developer portal! Otherwise it won't work lol (took me too long to figure out)
@puskeyman
@puskeyman Жыл бұрын
good point there frfr
@Dayum62499
@Dayum62499 Жыл бұрын
@@pepememe6561 You da MVP man, ty
@Plutorings
@Plutorings Жыл бұрын
you are a life saver! thanks man!
@matthewlewis8297
@matthewlewis8297 3 жыл бұрын
Love the way this man says "button"
@rufansdev7446
@rufansdev7446 3 жыл бұрын
Hahaha
@liannea4609
@liannea4609 3 жыл бұрын
could you put a timestamp to when he says it?
@faiyaz167
@faiyaz167 3 жыл бұрын
@@liannea4609 2:21
@_username
@_username 3 жыл бұрын
bahten
@zerkieee
@zerkieee Жыл бұрын
for anyone getting client = discord.Client() TypeError: __init__() missing 1 required keyword-only argument: 'intents' replace client = discord.Client() with client = discord.Client(intents=discord.Intents.all()) and enable all Privileged Gateway Intents in the Discord Developer Portal. Dont do what I did and spend hours looking for the answer.
@Anuragsaroj007
@Anuragsaroj007 Жыл бұрын
tysm bro
@shadowknightlp5097
@shadowknightlp5097 Жыл бұрын
How did you find the problem or just explain how did you solve
@IPi6
@IPi6 6 ай бұрын
bro it didnt work for me it still says missing one keyword
@hierkonnteihrewerbungstehe8008
@hierkonnteihrewerbungstehe8008 2 жыл бұрын
Can you pls make another part? There are so many things we still need: How to React How to Reply How to Send Images How to get Data like Names How to apply Roles etc
@justsomeguy6545
@justsomeguy6545 2 жыл бұрын
You should read the docs
@SoCloudy
@SoCloudy 3 жыл бұрын
I was actually looking for a tutorial like this. This came in at the right time
@matthewanthony4616
@matthewanthony4616 Жыл бұрын
Don’t waste ur time, these old comments are positive, but now there’s a whole lot of problems in just the first 20 minutes. You can’t create a .env file, and now u gotta do a whole lot more for slash commands update. This is annoying, go find a different tutorial
@rossdunn5436
@rossdunn5436 3 жыл бұрын
This is one of the best series , should make a part 2
@EmilVitus
@EmilVitus Жыл бұрын
Type "client = discord.Client(intents=discord.Intents.default())" instead of "client = discord.Client()"
@VoltzOnCrack
@VoltzOnCrack Жыл бұрын
this comment needs to be on top, thanks a lot
@iconicicon9542
@iconicicon9542 3 жыл бұрын
I don't know if this comment is going to make this to the top but, they have created something new on the side bar. It's called "My Secret". It looks like a lock. When you click it, they will give you directions. First you put the name as "TOKEN", if that's what you want to call it. Then you would put the value of it below it (token). Then hit create. It gives you a option to import the easier way which is what I did.. Hope this helps :)
@swagsnags5489
@swagsnags5489 3 жыл бұрын
this is so crazy! This video pops up a couple days before I need it! Thanks so much was really helpful !
@Milenakos
@Milenakos 10 ай бұрын
replit is shutting down free hosting on january 1st, 2024
@cozmoxjc3404
@cozmoxjc3404 9 ай бұрын
bruh... Is this tutorial still useful then?
@Milenakos
@Milenakos 9 ай бұрын
@@cozmoxjc3404 absolutely not
@Mr76Pontiac
@Mr76Pontiac 3 жыл бұрын
Soooo... the server I hang out is normally never (with seriousness) toxic. However... Knowing this crew... I'm sure that allowing them to add their own words of 'encouragement' is really really going to turn out to be hilariously not encouraging. haha.
@NHAFFFF
@NHAFFFF 3 жыл бұрын
Or even worse, instead of encouragement or not encouragement they could make the bot send other stuff such as gore, porn and everyone pings
@BaconGamesinHD
@BaconGamesinHD 2 жыл бұрын
If anyone has a problem with the line : options = options + db["quotes"], youll have to change it to: options = options.append(db["quotes"]). You can only use append to add something to a list.
@kasquisaliq2910
@kasquisaliq2910 2 жыл бұрын
this help me a lot i stuck in this line for 3 hr
@DeepakSharma-ug3ij
@DeepakSharma-ug3ij 2 жыл бұрын
@@kasquisaliq2910 u get how to solve...if yes then tell the solution......plzzzzzzz
@kasquisaliq2910
@kasquisaliq2910 2 жыл бұрын
@@DeepakSharma-ug3ij this work for me options = options + db["encouragements"].value sry I'm really busy but you can ask me anything
@DeepakSharma-ug3ij
@DeepakSharma-ug3ij 2 жыл бұрын
@@kasquisaliq2910 i got already solution that is : option+=db["encouragements"] easy
@snoop_official
@snoop_official Жыл бұрын
Yo, what's good homie? I ain't got no problem with that line. You just gotta use append to add something to a list, ya dig? Ain't no thang but a chicken wang.
@4r640
@4r640 3 жыл бұрын
This was perfect tutorial i was looking for
@tornadown_
@tornadown_ 2 жыл бұрын
Hey, i've a issue, when I try to start the bot and click the button "RUN", it starts and then turn off without saying anything in the console. Any solutions?
@josephcorleto1853
@josephcorleto1853 3 жыл бұрын
I award you year's best tutorial.
@dayv4630
@dayv4630 3 жыл бұрын
Thanks for this - as a software developer (who works mainly in the linux/cli environment) - a lot of this stuff is new to me. So I really appreciate you walking us through it step by step.
@sarguhl5892
@sarguhl5892 3 жыл бұрын
Really nice video idea! As I skipped trough the video, I noticed that you put all the code in one file and for commands used the 'on_message' event. Might be good to show the community how to work with cogs!
@yamdagni
@yamdagni 3 жыл бұрын
Please help. I am trying to make commands using @client.command() after setting the prefix but it is not giving any output on the discord server
@sarguhl5892
@sarguhl5892 3 жыл бұрын
@@yamdagni hey! Sorry for the late answer, I was a bit in a hurry today. Anyway, where exactly does the error appear?
@yamdagni
@yamdagni 3 жыл бұрын
@Sarguhl I have fixed it after trying for 3 hours. TheIr was no error in the console upon running. The @client.command() just didn't work for some reason. I set the prefix as + and wrote a command. But when I put that in the discord it wouldn't give out any output, there was no error in the console either. Turns out that for some reason, adding this: @client.event async def on_message(message): message.author==client.user: return Was what was preventing it. I removed that and it all worked again
@snis_wrld
@snis_wrld 3 жыл бұрын
i cant create an .env file problem: You cannot create .env files anymore, checkout the variable sidebar Need help :/
@c2222-u6l
@c2222-u6l 3 жыл бұрын
Me too
@wtster
@wtster 3 жыл бұрын
same here man @
@snis_wrld
@snis_wrld 3 жыл бұрын
@Sweet Lozen thx
@nemovelter4974
@nemovelter4974 3 жыл бұрын
@Sweet Lozen do you still use os.getenv('TOKEN') to replace your token
@nateplays2765
@nateplays2765 3 жыл бұрын
@Sweet LozenWhy is the 2856 a url link? lol
@circuitcoder
@circuitcoder Жыл бұрын
It's pretty amazing how much replit can change in just two years
@_ahn9631
@_ahn9631 3 жыл бұрын
At 37:49, he types "delete_encouragment(index)" The E after G is missing. And at 46:22, he types "delete_encouragment(index)" - This has to be "_encouragment" since the previous one was "_encouragment" or a red underline will appear, saying it's undefined and the "$del 0" won't WORK. Chances are that you might spell "_encouragment" correctly the next time, that's what happened to me and caused frustration.
@nimeshjoshi8904
@nimeshjoshi8904 3 жыл бұрын
i am getting an unhasble type list error which does not make my del command run
@_ahn9631
@_ahn9631 3 жыл бұрын
@@nimeshjoshi8904 Hey, I need to take a look at your code, a screenshot would be preferred with the Error details. discord.gg/aBzGumjr Can you join this discord server and share?
@cracknut28
@cracknut28 3 жыл бұрын
Oh my god, thank you, I was pouring over the comments trying to see what was wrong
@anivez4480
@anivez4480 3 жыл бұрын
It says File "main.py", line 34 if len(encouragements) > index ^ SyntaxError: invalid syntax
@novaplatoon5982
@novaplatoon5982 2 жыл бұрын
on line 50 which is the if message.content.startswith('inspire'): has an error that says File "main.py", line 49 if message.content.startswith('!inspire'): /\ IndentationError: unindent does not match the outer indentation level what did I do wrong
@lord_fulgi
@lord_fulgi 2 жыл бұрын
How do i make the bot say something everyday at the same hour?
@Anonymous4045
@Anonymous4045 2 жыл бұрын
You can get the current time using datetime.now().strftime("%H:%M:%S"). Then, you would check if the current time is the time you want, and if it is, send the message
@ahadfahim201
@ahadfahim201 Жыл бұрын
It there is an intents error you can use : client = discord.Client(intents=discord.Intents.default())
@grizzlypandastudio
@grizzlypandastudio Жыл бұрын
Thank you
@ghazitozri4989
@ghazitozri4989 Жыл бұрын
i am a swift/iOS Developer, i must sat that *"if any(word in msg for word in sad_words): "* got me into python and am gonna learn it asap. Great tutorial btw !
@brodmontgomery
@brodmontgomery 2 жыл бұрын
This would have been very useful back in Dec 2020, but now it's totally unworkable. This lesson really needs to be re-done for the latest version of Discord.
@manasvinr2985
@manasvinr2985 2 жыл бұрын
Him: uses python Ad: do you want to learn how to use python?
@ttanh1255
@ttanh1255 2 жыл бұрын
came back here to announce that uptimerobot is going to terminate replit's domain so the free hosting is pretty much gone now
@cb235
@cb235 3 жыл бұрын
The keep alive bit so you dont have to type it: from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return"Hello. I am alive!" def run() app.run(host ='0.0.0.0', port = 8080) def keep_alive(): t = Thread(target = run) t.start()
@keffjennedy5578
@keffjennedy5578 3 жыл бұрын
Thanks for this 👍
@liasglo
@liasglo 3 жыл бұрын
you forgot the : after run(), it has to be def run():
@cb235
@cb235 3 жыл бұрын
@@liasglo Ty
@cb235
@cb235 3 жыл бұрын
@@keffjennedy5578 yw
@kiadokot1241
@kiadokot1241 3 жыл бұрын
stupid question but do i have to call the functions home(), run(), and keep_alive()?
@herlocksholmes-uv5qw
@herlocksholmes-uv5qw 2 жыл бұрын
There are many outdated things here, it'd be nice to see another tutorial on how to make a bot with the changes that ended up happening. For example, my bot isn't working because apparently there's an ObservedList
@Patrick1999ki
@Patrick1999ki 3 жыл бұрын
Thanks for the video :D 1:08:18 I found it funny when you need to create your own event after 5 days, then actually get an event while recording
@Varmehundererdebeste
@Varmehundererdebeste 3 жыл бұрын
Thank for help! Now i have created ColaBot to my Cola server!
@ripjoe.-_-.
@ripjoe.-_-. 3 жыл бұрын
this is a very good tutorial, although I only used it for making my bot being up always
@yanderekat1
@yanderekat1 3 жыл бұрын
same lol
@HealthyWC-2
@HealthyWC-2 2 жыл бұрын
Want to add, thank you for this tutorial, its still super helpful in 2022 ( with some fixes ) and gave me an idea on how to use Webhooks and so much more, thank you for all the free resources! :)
@OPGAMER3000PRO
@OPGAMER3000PRO 3 жыл бұрын
THX verry much, i made my first simple bot by js but soon after that every thing was ruined by errors, but with python every bot runs perfectly FINE! THX VERRY MUCH!
@AR3AND
@AR3AND Жыл бұрын
It says that there is an error in client = discord.Client() every single time I try to run it
@AR3AND
@AR3AND Жыл бұрын
@The Music Theorists Thank you so much bro!
@MyAncestors
@MyAncestors Жыл бұрын
@Code_Works Thank you bro
@gcfrreal
@gcfrreal 3 жыл бұрын
7:04 - Uh, why is there a "brute-force-password-cracker" in your recents? 🤨
@ratulhasan7136
@ratulhasan7136 2 жыл бұрын
Time to create my search engine bot thanks to you Lots of respect to you (also to replit for keeping that ping flaw)
@carnage2k4
@carnage2k4 Ай бұрын
Mine shuts down within minutes of closing the tab, so I guess they fixed it.
@terminatorfishstudios
@terminatorfishstudios 3 жыл бұрын
I FOUD A SERIOUS PROBLEM WITH THE .env FILE!!! it turns out anyone can view and run the code so if someone goes on there and puts in at the end of the code before the get token they can put in “print(os.getenv('TOKEN'))” Which, even though the code may not go anywhere its like using a console in Inspect on windows, it wont actually do anything to the real bot but it will show the bots token. WHAT CAN I DO TO STOP THIS FROM HAPPENING!
@nithen8179
@nithen8179 3 жыл бұрын
idk im new to discord
@professionalshitposter6897
@professionalshitposter6897 3 жыл бұрын
@@nithen8179 then why are you even replying, nobody asked you specifically, seems like youre also new to the internet
@Devidra
@Devidra 3 жыл бұрын
Just tested something, it's safe, don't worry! If another try to fork your bot, the ".env" File is removed, just if you accept someone who wanna "edit" your repl, he can see what you see
@wellplayed4497
@wellplayed4497 3 жыл бұрын
@@professionalshitposter6897 well no one asked you specifically for your reply ¯\_(ツ)_/¯
@professionalshitposter6897
@professionalshitposter6897 3 жыл бұрын
@@wellplayed4497 No one asked you to be a moron, so stop acting like one
@RoxsannePatel
@RoxsannePatel 2 жыл бұрын
For anyone wondering what to do now that replit changed their secret variables (16:43), do the following: Click on the Padlock icon on the left of the page In the key box, give it a name (in this case, it would be "token") In the value box, enter your bots secret token Add the secret Go back to your python file, and make sure you have "import os" at the start Before the "client.run..." line, add "my_secret = os.environ['token'] And in the client.run line, type "client.run(os.environ('token'))
@levlev4048
@levlev4048 2 жыл бұрын
Ok, can I get your discord for help on the bot
@levlev4048
@levlev4048 2 жыл бұрын
I really don't understand what to do, and I need your code to actually make the bot. The new padlock confuses me
@RoxsannePatel
@RoxsannePatel 2 жыл бұрын
@@levlev4048 sure, send me your discord id
@JwNineNineNine
@JwNineNineNine 2 жыл бұрын
thanks for your help
@BenjaminEmm
@BenjaminEmm 2 жыл бұрын
This gives me the error "'_Environ' object is not callable" do you know why?
@kaisershaik
@kaisershaik 3 жыл бұрын
I actually just finished setting mine up. If only this was uploaded a week ago xD
@professorpuddle
@professorpuddle 3 жыл бұрын
This encouraging bot is very encouraging! ~ Beau Carnes, Dec 15, 2020
@ontsi4082
@ontsi4082 3 жыл бұрын
Could you teach how i can add play music commands to my bot
@djbabu8796
@djbabu8796 3 жыл бұрын
The intro guy looks just like a professional programmer
@GetYourHandle
@GetYourHandle Жыл бұрын
.env files on replit are now disabled💀💀💀
@nicoheart7572
@nicoheart7572 Жыл бұрын
use secret
@mm-fn9uj
@mm-fn9uj 2 жыл бұрын
for anyone who has bot responding "
@honzikoscz1826
@honzikoscz1826 3 жыл бұрын
When I wrote msg = message.content it gave error name "message" is not defined
@potato420
@potato420 3 жыл бұрын
well, you need to always pass the message argument in an on_message
@mathewrtaylor
@mathewrtaylor 3 жыл бұрын
Good tutorial, was able to follow along and make alterations with no issues. Thanks for sharing!
@mathewrtaylor
@mathewrtaylor 2 жыл бұрын
@Anime lover Hey, I had issues with ensuring it's appropriately spaced, so I'd check that first! Good luck!!
@MrFayeRick
@MrFayeRick 3 жыл бұрын
Gonna watch this again when I reach this level in school
@yanddev5887
@yanddev5887 3 жыл бұрын
most schools dont teach programming
@Audioandlyrics
@Audioandlyrics 3 жыл бұрын
won't work for creating won't say we have logged in as (name) bot
@Audioandlyrics
@Audioandlyrics 3 жыл бұрын
@@stephennovak8083 did you fix it yet
@stephennovak8083
@stephennovak8083 3 жыл бұрын
@@Audioandlyrics nope, still won't work
@kingpanda.
@kingpanda. 3 жыл бұрын
@@_ahn9631 hey could you send a permenant invite so I could join?
@daduckling_5728
@daduckling_5728 3 жыл бұрын
@@_ahn9631 can you help me won't say we have logged in as (name) bot
@pulin4594
@pulin4594 3 жыл бұрын
@@_ahn9631 the discord link wont work! can u help me?
@justsomeguy6545
@justsomeguy6545 2 жыл бұрын
The library used in this vid is now dead btw if you are serious about making bots then you should use hikari + light bulb or tanjun
@WAZXIII
@WAZXIII 3 жыл бұрын
Great tutorial. Very through and helpful!
@official_kex
@official_kex 2 жыл бұрын
The moment it actually worked and replied to my message felt really really good :D
@Catboylawliet
@Catboylawliet 3 жыл бұрын
This is amazing but for some reason I’m just 20 min in and I’m already having problems. I’m not sure where they are and I have never done this in my life. Can someone help me? It won’t say “We have logged in as DiGiorno pizza” (don’t question the name for the bot) If someone can help I’ll send the link to it
@neelp1956
@neelp1956 3 жыл бұрын
cross check the codes many times
@definitelynotneron7649
@definitelynotneron7649 2 жыл бұрын
Him: Im depressed Bot: nice
@J9homes
@J9homes 3 жыл бұрын
Learning coding from Steve jobs himself is my pleasure
@Towoawawabo8
@Towoawawabo8 2 жыл бұрын
He wasn't a coder but ok lol
@Jawsnpie
@Jawsnpie 2 жыл бұрын
Finally finished this tutorial. Had to modify some lines here and there, but overall pretty good!
@Jawsnpie
@Jawsnpie 2 жыл бұрын
bot didn't work next day bc discord blocked replit bc it did too many requests rip.
@popcat2309
@popcat2309 2 жыл бұрын
@@Jawsnpie lol ... what did you make the bot for tho? I just made a bot that could generate memes
@wikanwar
@wikanwar 3 жыл бұрын
error on the File "main.py", line 60, in on_message, options = options + db["encouragements"]. TypeError can only concatenate list (not the 0bservedList") to list. Pls help been stuck for 30 mins
@ashweena8327
@ashweena8327 3 жыл бұрын
just do options+=db["encouragements"] instead of options = options + db["encouragements"]
@DeepakSharma-ug3ij
@DeepakSharma-ug3ij 2 жыл бұрын
@@ashweena8327 working................thnx
@itsjimmy6227
@itsjimmy6227 2 жыл бұрын
i will count this 1 hour of my life as one the best
@macShen
@macShen 3 жыл бұрын
my code will stop working immediately when i close the tab. did i miss something?
@ph662
@ph662 3 жыл бұрын
It will keep working if you do this part of the video 58:42​
@k9beast_122
@k9beast_122 3 жыл бұрын
Alright I get it KZbin you keep on recommending me this video 2x a day I'll watch please give me a different recommendation
@chrispysaid
@chrispysaid 3 жыл бұрын
Hopefully somebody smart here can help me out. Since this tutorial, repl.it has changed their .env procedure, so now you have to actually add a secret. Does the client.run(os.getenv ('TOKEN')) code still work with this change?? I can't seem to get it to run correctly. EDIT (SOLUTION): You have to add your token as a secret within the side menu of replit, then change client.run(os.getenv('TOKEN')) to client.run(os.environ['TOKEN'])
@niteshswarnakar
@niteshswarnakar 3 жыл бұрын
yes brother , donot add my_secret variable. Everything is same . Just change the code of os.getenv("TOKEN") into os.environ["TOKEN"]. do not forget to add TOKEN into your environment variables
@Moije20
@Moije20 3 жыл бұрын
@chrispysaid i don´t understand, because it won´t work for me, or I mean when i press run nothing happens in the black bar. And my bot doesn´t go online.
@mdr_bot1054
@mdr_bot1054 3 жыл бұрын
@@Moije20 if u fine the solution help me too!
@niteshswarnakar
@niteshswarnakar 3 жыл бұрын
@@mdr_bot1054 join my discord server name " Nepali Tech Nitesh " I will help you there
@chrispysaid
@chrispysaid 3 жыл бұрын
@@Moije20 I explained it for you, if you don't understand I don't know how to help you without more information
@cft7193
@cft7193 3 жыл бұрын
I use it in my project and it works.Thanks for your sharing.
@aryanraje2770
@aryanraje2770 2 жыл бұрын
If anyone is getting the error regarding environment variables remember, key = TOKEN and value='your bot key' I made that mistake and I think that most people here have done the same.
@marzeqpog
@marzeqpog 3 жыл бұрын
Hey, there's a lot of things wrong with this tutorial. First of all, you should be using discord.ext.commands.Bot instead of discord.Client which allows you to use @client.command(), and not a massive wall of ifs (which by the way should be if, elif, elif etc.). This code would be very hard to maintain and putting everything is a very very bad idea. You should really look into using Cogs.
@emrizess6543
@emrizess6543 2 жыл бұрын
is there supposed to be () at the end of bot? it doesnt work
@iWillRun_
@iWillRun_ 2 жыл бұрын
depends on the usage of bot . my bot do not have to responds to coommands so I just use clients plus it have better documentation
@holof443
@holof443 3 жыл бұрын
There's soooo much wrong with this tutorial, please don't follow it. Look into the official documentation and follow the guide on how to set up a basic bot, it's gonna be a nightmare to maintain code that's done like this.
@mateuszsieraszewski7666
@mateuszsieraszewski7666 3 жыл бұрын
basic setup is fucked, but when you actually wrote a basic bot improving it from that tutorial is really good.
@freecodecamp
@freecodecamp 3 жыл бұрын
The set up of the basic bot in this tutorial comes directly from the official documentation for discord.py.
@holof443
@holof443 3 жыл бұрын
Yes my bad, i meant the bot on the discord py repo, not in the documentation. github.com/Rapptz/discord.py/blob/master/examples/basic_bot.py
@Nuhjeea
@Nuhjeea 3 жыл бұрын
@@holof443 What are advantages and disadvantages of both? What's so bad about official documentation? I was gonna run through this guide real quick but IDK anymore lol
@holof443
@holof443 3 жыл бұрын
@@Nuhjeea if you just want to make something quick that's just for you, this should work, but if you want to make something that's easier to maintain and neater you should go for something closer to what the official repo shows. Learn about how to work with object oriented programming, databases and threading if you're planning on doing this for a bot that other people will use. Be responsible with your code!
@neca1542
@neca1542 3 жыл бұрын
Since I use python for programming this will be useful!
@WaffleyHD
@WaffleyHD 3 жыл бұрын
Thank so much my GTA staff team is thankful for it cause we got tone of member that can bypassing everything we put in there way! (edited my server has it own website)
@Glope-yv7bl
@Glope-yv7bl 3 жыл бұрын
At 47:44 I’m having an error with the options = options + db[“encouragements”] line it’s saying can only concantenate list (not “ObservedList”) to list
@michaelredruello3011
@michaelredruello3011 3 жыл бұрын
me too
@a036nikhilsannat4
@a036nikhilsannat4 3 жыл бұрын
me too
@yonatancohen3879
@yonatancohen3879 3 жыл бұрын
Same problem
@yonatancohen3879
@yonatancohen3879 3 жыл бұрын
How can we ask for help?
@yashverma8267
@yashverma8267 3 жыл бұрын
options.extend(db["encouragements"])
@soksakCZ
@soksakCZ 3 жыл бұрын
EDIT: Sorry, there's section for making things secret right below packages button :3 .env files are no longer able to be created or however stored. Is there any other way to keep the bot token secret? (sorry for my bad english lol)
@helsy1122
@helsy1122 3 жыл бұрын
Yes, go to the left handside and click the lock icon, there you will find the instructions!
@jonttu1992
@jonttu1992 3 жыл бұрын
@@helsy1122 i go to the left handside but it dont work :(((((((
@minecraft4life688
@minecraft4life688 3 жыл бұрын
@@jonttu1992 you go to lock symbol and make the secret import os at the top At the end where you put client run to client.run(os.getenv('here put what u named the secret'))
@kachii65
@kachii65 3 жыл бұрын
@@minecraft4life688 thank you so much, i was struggling doing it
@RichieMK4Rich
@RichieMK4Rich 3 жыл бұрын
@@kachii65 You can also just insert the 'my_secret' and type out client.run(my_secret) under it!
@FurDimgo
@FurDimgo 2 жыл бұрын
i felt bored so i decided to make a bot, thank you. My first inspirational quote was this; You must conceive it in your heart and mind before you can receive it. If you believe then all things are possible. -Norman Vincent Peale
@pronice9201
@pronice9201 3 жыл бұрын
But my commands when i type in it doesent work i will say $Hello and nothing happend
@younglink680
@younglink680 3 жыл бұрын
i think his tutorial is $hello. also make sure you don't have any extra spaces inside your code.
@LishaeLelundae
@LishaeLelundae 3 жыл бұрын
same here
@OfficalLunar
@OfficalLunar 3 жыл бұрын
Thank you- I was SUFFERING because of my friends instruction
@CherryPlayz-d7j
@CherryPlayz-d7j 3 жыл бұрын
somehow on async def on_ready(): it says Traceback (most recent call last): File "main.py", line 13, in async def on_ready():TypeError: event() missing 1 required positional argument: 'coro'TypeError: event() missing 1 required positional argument: 'coro'
@abdelrahmankhatab4772
@abdelrahmankhatab4772 2 жыл бұрын
INCREDIBLE video .. Thank you so much FCC ❤
@HHK26
@HHK26 3 жыл бұрын
love you freecodecamp ❤❤❤ third person to like the video:❤
@ucPham-sj5bc
@ucPham-sj5bc 5 ай бұрын
Thank you very much for your tutorial; you saved my life!
@CodyStephens297
@CodyStephens297 3 жыл бұрын
I think you forgot the sarcasm filter for users adding encouragement statements. Lol all kidding aside great video!
@ruelyt2483
@ruelyt2483 2 жыл бұрын
Thx man, helped a lot❤️❤️
@FolTakX
@FolTakX 2 жыл бұрын
Thank you, this video helped out a lot!
@nikro7239
@nikro7239 2 жыл бұрын
Hello. I cant get access to message.content . It just doesnt exist
@triangulator01
@triangulator01 2 жыл бұрын
same
@nikro7239
@nikro7239 2 жыл бұрын
You need to go to discord developer portal > bot and change message intent to trye
@dinired9657
@dinired9657 2 жыл бұрын
i love you so much you are the best I will always support you!
@pcgalvintoybonnie2827
@pcgalvintoybonnie2827 2 жыл бұрын
Amazing tutorial man!👌🏻god bless
@richardburns7270
@richardburns7270 Жыл бұрын
It's a shame replit has changed some major terminology with its coding, because this video is so good, yet using the 'client' and 'client.event' codes just don't work anymore and gives a user error. Am I missing something or is this tutorial just too old now?
@spookzzgtag
@spookzzgtag 2 жыл бұрын
Can you make a tutorial of how to make a bot that notify's when people upload? Thanks! (I also love this bot I made now)
@zenphixnull6694
@zenphixnull6694 2 жыл бұрын
well i would rather not have my github repo public because people that find it could easily attach my bot's token to a server nuker which would mean over 400 servers would be destroyed. this is a clever trick though but it doesnt have any security
A math GENIUS taught me how to LEARN ANYTHING in 3 months (it's easy)
8:52
*Next-door 10x Software Engineer* [FULL]
4:50
Programmers are also human
Рет қаралды 640 М.
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 64 МЛН
Пришёл к другу на ночёвку 😂
01:00
Cadrol&Fatich
Рет қаралды 11 МЛН
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 240 МЛН
Trying and Exposing Discord Nitro Generators (ft. ChatGPT)
12:48
No Text To Speech
Рет қаралды 1,8 МЛН
When you Accidentally Compromise every CPU on Earth
15:59
Daniel Boctor
Рет қаралды 827 М.
The Home Server I've Been Wanting
18:14
Hardware Haven
Рет қаралды 106 М.
I Hacked a Discord Bot, the Owner said this...
9:09
No Text To Speech
Рет қаралды 1,3 МЛН
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 79 М.
Can You Get Every Discord Badge?
9:44
No Text To Speech
Рет қаралды 2,4 МЛН
40 APIs Every Developer Should Use (in 12 minutes)
12:23
Coding with Lewis
Рет қаралды 370 М.
I tried Discord Bot Makers...
14:19
FaceDev
Рет қаралды 124 М.
I beat rigged giveaways with a bot
3:43
Kian Brose
Рет қаралды 2 МЛН