Learn How to Make a Python Discord Bot in 17 Minutes. Host for Free!
HTML-код
- Опубликовано: 19 июн 2024
- Understand how to code a discord bot without spending an hour watching a tutorial. Our goal is to cut all the fat from learning and allow you to move onto bigger and better things!
After this python tutorial you will be able to create a custom discord bot from scratch. In this video we will cover responding to message events and creating bot commands. As well as how to get an API key and creating your server.
@CSDojo
00:00 Intro
00:30 Create Server
01:17 Create Bot and Get API Key
03:27 Code Bot
12:35 Witty Responses
💾 Check out the code!
replit.com/@JacobLower3/Repli...
🌎Free hosting!
repl.it/claim?code=claritycod...
🔑Get your API Key
/ discord
Want to chat with me and other programmers join our discord!
/ discord
#pythontutorial #discordbot #claritycoders - Наука
Thank you so much for this video, I had requested this on CS Dojo's vid on the Telegram bot and you had said it was a good idea. Thanks a lot for listening to the request. I randomly had a thought of visiting your channel to check if you may have done it and I was in luck, fabulous timing! I will try to make a bot fosure
Glad you stopped by! Keep the good ideas coming.
@@ClarityCoders Haha thanks, subscribed! I had a question, how would I use the bot to mention users using @?
For eg: trigger code is $Hello
DiscUser: $Hello
Bot: Hello @DiscUser
or
trigger: !hello
DiscUser: !hello @AnotherUser
Bot: Hello @AnotherUser
THANK YOU holy crap I suck at coding you made it so easy! Another sub
Man you got some amazing tutorials, thank you, you deserve more views and subscribers
Thanks! As long as someone is watching and learning I'll keep doing them no worries.
who else doesn't know anything about coding and python but wants to make a bot?
Great job on walking through the code and explaining the components!
Glad it was helpful!
YOU, MY MANNN, ARE UNDERATED. cant wait for your channel to blow up!!
I hope your right haha. At any rate I appreciate the comment and views!
Finally, a video where I actually have my Bot responding. Thank you ever so much. 100% appreciated!
Great to hear! Thanks for watching and commenting.
Hey Bro thanks for the video!
I like your voice! Its quite calming!
Thank goodness, the time had come i managed write my first accurate pythons coding
Ur channel is great I was very surprised to see that you're not more popular! I guess I'm part of the OG club
forever I won't forget schnitzel the OG! hahs
I was stuck for ages trying to get me bot to turn on, thank you so much!
Thank you for watching and commenting.
Hello for me it says in lane nine list index out of range and its the same as it is in the video. Does anybody know how to fix this?
Great video. Gonna make a bot tomorrow
Thanks! If you have any issues let me know.
@@ClarityCoders It's working perfectly. Thank you so much!
hey! i tried it out and ran it then only the packages popped up but it didn't continue to run it stopped after how do i fix this?
Hello, i want to make a Reddit bot for download saved pictures or videos on my Reddit account. How can i make it? Thanks!
can you help me it says:
Traceback (most recent call last):
File "main.py", line 7, in
async def on_ready():
TypeError: event() missing 1 required positional argument: 'coro'
Bro please create a tutorial with combination of Google spreadsheet (eg : stock screener) + telegram bot + python. Basic if we give input to bot it has to fetch the rows and columns from the spreadsheet and give us the data. There is no video related on internet. It's and humble request bro.
Thanks for the idea I'll put it on my todo list!
it`s always showing "syntax error: invalid syntax" and my bot go offline
Very cool video.
I run New York btw.
Town I run is much smaller.
@@ClarityCoders Lucky you man. Running NY is exhausting.
Also lonely island says it in their song.
hey the code says its already redeemed and i cannot turn on always on
I wish I could turn on the always on setting without hacker subscription
someone can help with this ?
Traceback (most recent call last):
File "main.py", line 4, in
client = discord.client()
TypeError: 'module' object is not callable
change the small c of the client to capital C that will fix it!
@@petsdom i tryed, it did'nt work? heres the code
client = discord.Client()
Great tutorial, although i got stuck due to an error:
Traceback (most recent call last):
File "main.py", line 4, in
client = discord.Client()
TypeError: __init__() missing 1 required keyword-only argument: 'intents'
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
use that instead of client = discord.Client()
Can I do it on pycharm?
Works great. Thanks. Just can't get the subscription through your link.
Just checked it again. Everything's working fine. Thanks again.
Awesome did you get the free hosting if not let me know.
@@ClarityCoders tried to claim the free hosting link in the description, it doesn't work. Nothing happens on that screen after hitting enter.
How to dowland the csv?
6:55 whenever I run the code after finishing this step, it claims that the “my_secret” line is invalid (invalid syntax)
Join our Discord and send something to our help channel we can get it figured out.
@@ClarityCoders I went ahead and just copied the code into another repl and it seems to work now, but thank you :)
How can I claim the free hosting
It started working for like 20 seconds then said I was blocked from accessing the API because I clicked “Run” too many times /:
Note to self, don’t click “run” 5 times -_-
Hey, it says Expected an indented block at the logged in now command, how do I fix this?
Make sure your indents match mine exactly! They matter in Python.
Could you make a kick and ban command
It says that it’s WRONG at ”on_ready”
Hey, I Love this Video But A Problem is Ocurring Please help me.
File "main.py", line 23
elif "$Thought" in message.content:
^
IndentationError: unindent does not match any outer indentation level
Please tell Me The solution asap
How can I claim it
Traceback (most recent call last):
File "main.py", line 11 in
my_secret = os.environ['TOKEN']
NameErroe: name 'os' is not defined
pls help
import os
make sure thats at the top of your file.
Uhm i kinda have a little issue here 😅 whenever i run it it says "Traceback (most recent call last):
File "main.py", line 4, in
cleint = discord.Cleint()
AttributeError: module 'discord' has no attribute 'Cleint"
Yea-
you spelled client wrong. 😂 It happens.
@@ClarityCoders Ouhhhh that makes more sense-
So Repl.it can host python 24/7 for free. Does it mean I can Host nodejs webserver in Repl.it 24/7 for free too ?
Well it's only free for a couple months then you have to pay for the hacker plan. You could also use a ping script to host it for free after trial ends.
Is this deprecated? I saw a few video for making bots but when i try, it's no longer viable.
It shouldnt be. Works fine for me.
Traceback (most recent call last):
File "main.py", line 13, in
print(dir(message))
NameError: name 'message' is not defined
can someone help me
Did you import discord?
i cant find the key can you help me?
edit: aka link
can I get the CSV file
Anyone still has a fix regarding async def bein an invalid syntax?
share code in discord we can help!
Hey, it tells me that the code has been already redeemed, would appreciate it you could add a new one :)
I'll hit them up and see what I can do.
Bhai all are saying thank you but my python says os not defined
Now working
import os
Sorry Wish i had seen this earlier I would have helped you out!
Do one for role management.
Really good idea. I'm like 95% sure this will be in my next 5 videos.
@@ClarityCoders appreciate it. :)
whats your discord server
discord.gg/cAWW5qq stop by and say hi!
instead of mentioning the user can you @ everyone??
Do that video
bruh how do i get the csv file?
nvm i got it
how did you get it?
To Fix: TypeError: __init__() missing 1 required keyword-only argument: 'intents'
Change:
client = discord.Client()
To:
client = discord.Client(intents=discord.Intents.default())
You're welcome.
what does the csv file look like in excel?
issue is there
Sorry, 1st use vs code or pycharm 2nd YOU NEED INTENTS!
It just shows the code
You sure you don't have it already? Try to turn always on - on
SIU?!? you must be near me. E or C?
Maybe.... haha. My brother went there at one time. C
doesn't work
It does! Something must be off if you join our discord we should be able to help.
replit deactivated your code already
DO you know how to make another @client.event
async def on_message(message):
if message.content.startswith("____"):
await message.channel.send(f"______!") because when i make another, it just doesn't work
Don't make another @client.event just nest them inside with if statements for example
if message.content.startswith("$greet"):
await message.channel.send(f"Hello! How are you {message.author}")
elif message.content.startswith("something else remember case matters!"):
response = phrases[random.randint(0, len(phrases) - 1)]
await message.channel.send(response)
elif "$thought" in message.content:
response = phrases[random.randint(0, len(phrases) - 1)]
await message.channel.send(response)
The Totorial is great! I only got stuck on line four, heres the code:
client = discord.Client()
Error message:
Traceback (most recent call last):
File "main.py", line 4, in
client = discord.Client()
TypeError: __init__() missing 1 required keyword-only argument: 'intents'