How to Make a Discord Bot with Python

  Рет қаралды 62,766

pixegami

pixegami

Күн бұрын

Пікірлер: 108
@zzz-oc4fe
@zzz-oc4fe 2 жыл бұрын
Just found your channel. Watched the AI SaaS video and am now on the portfolio site for beginners. The level of detail you put into explaining things in your videos is just right. Please keep making content, thanks a lot.
@pixegami
@pixegami 2 жыл бұрын
😅 Thanks for your kind works. It is a challenge for me to balance the content to be fast and simple, but still comprehensive enough to learn from, so hearing that it works for you is very encouraging!
@rachit.6110
@rachit.6110 2 жыл бұрын
@@pixegami you're a great teacher please continue this course
@AlexTsaava
@AlexTsaava 2 ай бұрын
the first video i saw on your channel your skills with discord really impressed me
@jason6569
@jason6569 8 ай бұрын
This was exactly what I needed. Got it running in 10 minutes and coded what I needed. My one issue, and I know it isn't part of this is how to limit the bot to one channel! I did start it as administrator to test. Removed it and readded it with just manage and send messages in text permissions. Google is not helping and I am stumped. I don't want everyone to use my / commands! Just a specific channel. Again great tutorial, it did what it was supposed to! Thank you!
@pixegami
@pixegami 8 ай бұрын
Thank you! To solve your problem, here is one solution I found online: > The easiest way to do this is not actually via code but via permissions on the server. On your server you should find a role with the same name as your bot, whose permissions (including send messages) you can change for seperate channels. Otherwise, I guess you can do it hackily as well by using an if/else statement in the bot logic itself to only respond if the channel ID of the message is the one you want the bot to operate in.
@Maple38
@Maple38 Жыл бұрын
Great tutorial. I looked through a lot of them, and while they worked, none of them really explained why they did stuff. They just wrote code and expected to follow.
@pixegami
@pixegami Жыл бұрын
Thanks for that feedback! It's something I actively try to achieve in my tutorials, so I'm glad it's coming across.
@ArunWills7
@ArunWills7 Жыл бұрын
the only tutorial that actually works, thanks a ton!
@pixegami
@pixegami Жыл бұрын
Glad it helped!
@akuan195
@akuan195 2 жыл бұрын
you are awesome, this is the only one tutorial that works for me
@pixegami
@pixegami 2 жыл бұрын
Glad to hear that!
@MindUnearthed
@MindUnearthed Жыл бұрын
when I want to install the 'pip install discord.py' error comes in and it says "which is required to install pyproject.toml-based projects" how do I make it install ?
@Dark-a242
@Dark-a242 Жыл бұрын
Exactly
@byhelvete4757
@byhelvete4757 Күн бұрын
What extensions are you using while coding this?
@B1oodbeard
@B1oodbeard 9 ай бұрын
This helped so much to get started
@pixegami
@pixegami 9 ай бұрын
Glad to hear it. Thank you!
@LavinOficial
@LavinOficial 5 ай бұрын
great video, direct and precise, I just want to ask you what happens if I want to give each user an ID, what would the logic be?
@AudreyGB
@AudreyGB 8 ай бұрын
Great tutorial! Thanks a lot!
@pixegami
@pixegami 8 ай бұрын
You're welcome!
@gavinosegura4865
@gavinosegura4865 Жыл бұрын
i copied text by text to just have the bot print hello on the discord and i keep running into issues with on ready await channel.send Attribute error with python. Any suggestions?
@pixegami
@pixegami Жыл бұрын
Hmm, I checked the code recently and it was still working. What is the exact error and what version of discord.py are you using?
@maheerhuq6708
@maheerhuq6708 3 ай бұрын
Whats the fix?????
@Daraca5
@Daraca5 11 ай бұрын
Thank you! this was great, half the battle with things like this is getting the thing to run to begin with, so you've gotten me that far, much better tutorial than all the rest I've come across.
@pixegami
@pixegami 10 ай бұрын
Awesome! Glad to hear it was useful :)
@openup8708
@openup8708 4 ай бұрын
hey great video. i have a question. If I have code written already, how do I implement that code to work with the discord bot? For example, if I have a script written to return output for a certain input, how do I implement this to the discord bot so that if i place an input to the discord channel, it will output the values (from my script I created)
@SIMP_Toast87
@SIMP_Toast87 Жыл бұрын
Best tutorial!❤
@xinyangwang6422
@xinyangwang6422 3 ай бұрын
I can log in with client and see my user name (bot #...), but I can't see any channel at all. I can see the bot in server settings though. Do you maybe know why?
@katerinejaimes6585
@katerinejaimes6585 11 ай бұрын
Justo lo que necesitaba, me gusta como explica todo mjuy bien, aunque es en ingles es un reto tambien porque estoy aprendiendo asi que es un Plus. Muchas gracias. Una suscriptora mas 😊
@pixegami
@pixegami 11 ай бұрын
Thank you! I'm glad you enjoyed it. I hope you were able to understand the video :)
@jaixxo
@jaixxo 19 күн бұрын
how do you do it in all channels?
@homerovignecarpi8913
@homerovignecarpi8913 7 ай бұрын
THANKS A LOT MAN, YOU WERE OF GREAT HELP!!!!
@pixegami
@pixegami 7 ай бұрын
You're welcome!
@Alw1130
@Alw1130 Жыл бұрын
When I start a study session, the time is 5 hours later than intended. What is the fix for that?
@pixegami
@pixegami Жыл бұрын
It probably uses the UTC time from the machine your bot is running on. What’s the timezone set on your system? You might have to set it to local time.
@davudhaci5379
@davudhaci5379 Жыл бұрын
Which exintension are u use for complate code
@pixegami
@pixegami Жыл бұрын
GitHub CoPilot
@dogereacts1271
@dogereacts1271 10 ай бұрын
my bot won't work and the error message has a problem with the async. do u know how to fix that?
@pixegami
@pixegami 10 ай бұрын
Sorry I'm not sure, it's been a quite since I worked on this. What's the error message say exactly?
@dogereacts1271
@dogereacts1271 10 ай бұрын
@@pixegamithis was the error message File "bot.py", line 11 async def on_ready(): ^ SyntaxError: invalid syntax
@dogereacts1271
@dogereacts1271 10 ай бұрын
do u know what it means? I'm clueless
@Unpluggedx89
@Unpluggedx89 10 ай бұрын
@@dogereacts1271What version of python were you using?
@dogereacts1271
@dogereacts1271 9 ай бұрын
@@Unpluggedx89 the newest
@novaplatoon5982
@novaplatoon5982 2 жыл бұрын
hey when I tried doing the command it would not respond 14:37
@justecho5760
@justecho5760 Жыл бұрын
relatable
@jordantaylor5302
@jordantaylor5302 Жыл бұрын
same
@jordantaylor5302
@jordantaylor5302 Жыл бұрын
jk make sure when you declare your "!" thing theres no spaces like "! " or " !" this saved me hours and worked after i noticed i had a space of some sort
@Filaskon
@Filaskon 7 ай бұрын
So helpful :D this tutorial is perfect bc i need a bot that runs a command every 24 hrs bc im lazy lol
@AloneNinja36
@AloneNinja36 Жыл бұрын
How can I make my Discord bot only appear in one channel and not work in other channels?
@pixegami
@pixegami Жыл бұрын
You can add a condition into the functions so it only does things in a specific channel: "if message.channel.id == YOUR_CHANNEL_ID: ..."
@lukli425
@lukli425 6 ай бұрын
It doesnt run for me and It cant resolve discord dot ext
@pixegami
@pixegami 6 ай бұрын
Hmm, it could be because you might be using a newer version of the Discord library than what I used in the video, or you have it pointed to the wrong Python environment.
@78wesley67
@78wesley67 2 жыл бұрын
Which add-on do you use for auto generating code?
@pixegami
@pixegami 2 жыл бұрын
GitHub Copilot. I actually talk about it in this video: kzbin.info/www/bejne/qnibgYOkmpyYnJI
@spooky-
@spooky- Жыл бұрын
my bot wont come online, ive check my code and token multipul times (im on mac)
@pixegami
@pixegami Жыл бұрын
What error do you see?
@kingking7698
@kingking7698 2 жыл бұрын
Thank you for the awesome video!!
@pixegami
@pixegami 2 жыл бұрын
You're welcome!
@marcoshocpfner9184
@marcoshocpfner9184 2 жыл бұрын
Thank for this... very useful, do you have enything about on discord bot whit cli AWC ?
@pixegami
@pixegami Жыл бұрын
Not at the moment, but I plan to do more Discord videos in the future.
@retrokjay997
@retrokjay997 Жыл бұрын
do you know how to get the prizepick projections?
@heckor8128
@heckor8128 2 жыл бұрын
why does it show me [Done] exited with code=0 in 0.092 seconds after i do client.run(token) instead of showing my bot online
@joao_silva679
@joao_silva679 2 жыл бұрын
If you did exactly as he did, you should use bot.run(token) instead of client.
@Dhanush10101
@Dhanush10101 8 ай бұрын
Thanks for this video bro it's working with no issues and I got some idea about it once again thank you it's very useful to me ❤❤❤ but can you help me with in 20:41 i'm still can't figure it out to print the timer
@pixegami
@pixegami 8 ай бұрын
Thanks! Glad it's useful. What issue are you having with printing out the timer?
@Dhanush10101
@Dhanush10101 8 ай бұрын
@@pixegami ​ Hey thanks for your replay , so im a Beginner for python i cannot figure out the ' end session's end timer like human readable time and why are you using timedelta(seconds = duration)
@ConsCrafter
@ConsCrafter 4 ай бұрын
which IDE is he using ?
@theOtherGuy2175
@theOtherGuy2175 Жыл бұрын
Is there a way to have a catch all async def? Like if someone types /bot
@pixegami
@pixegami Жыл бұрын
No idea! I looked it up and found this: @bot.event async def on_command_error(ctx, error): await ctx.send(f"An error occured: {str(error)}") From stackoverflow.com/questions/62771154/discord-py-rewrite-sending-an-error-message-when-there-is-an-unknown-command-or
@Manciek_
@Manciek_ Жыл бұрын
Any idea why commands doesnt work with my bot? It doesnt recognize that i typed $hello
@pixegami
@pixegami Жыл бұрын
Hmm, is it possible the Discord API version changed? Compare the version of Discord to the one being used in the video (although I'm not sure if I actually show it in there)...
@Manciek_
@Manciek_ Жыл бұрын
@@pixegami nvm I just found out that .bot.event on_message() ovverite commands 😅
@fumingstargaming2508
@fumingstargaming2508 Жыл бұрын
I need help can i join your dc pls gimme link
@pixegami
@pixegami Жыл бұрын
Sorry I don't have a public Discord channel yet. I'll post an update if I do get around to making one.
@hellonearth311
@hellonearth311 Жыл бұрын
it doesnt work bruh. apparently some "ssl certificate error"
@pixegami
@pixegami 11 ай бұрын
What's the full error?
@hellonearth311
@hellonearth311 11 ай бұрын
i uhh deleted the code now but i was getting the same error with sending emails in python and i created an unverified context using the ssl lib. we don't use that here so i probably have no way to fix it and i honestly dont really wanna make a bot anymore. thanks for the attention to people with errors i really appreciate it! i'll check out your other videos/tutorials.
@nileshswami2426
@nileshswami2426 Жыл бұрын
Thank you🤩
@pixegami
@pixegami Жыл бұрын
You’re welcome 😊
@parrrkkkk
@parrrkkkk 2 жыл бұрын
im having this problem: AttributeError: 'NoneType' object has no attribute 'send'
@pixegami
@pixegami 2 жыл бұрын
What's the full stack trace? Did you initialize your bot properly?
@parrrkkkk
@parrrkkkk 2 жыл бұрын
@@pixegami no its ok now
@maheerhuq6708
@maheerhuq6708 3 ай бұрын
@@parrrkkkk What did udo
@parrrkkkk
@parrrkkkk 3 ай бұрын
@@maheerhuq6708 i posted this a year ago
@SuperLimeWorld
@SuperLimeWorld 7 ай бұрын
It never prints the text when I run it! Edit: so it turns out it has to named 'on_ready' lmao "which thing has to be named on_ready?": Watch the tutorial, if you see something named "on_ready", don't change it, otherwise, it fails.
@pixegami
@pixegami 7 ай бұрын
Thanks for sharing the solution :)
@SuperLimeWorld
@SuperLimeWorld 6 ай бұрын
@@pixegami Np :3
@Meowicat
@Meowicat 5 ай бұрын
could you elaborate on this? which thing has to be named on_ready?
@SuperLimeWorld
@SuperLimeWorld 5 ай бұрын
@@Meowicat I have updated my comment to answer your question
@Theposhestcat
@Theposhestcat Жыл бұрын
does this work with pycharm?
@Sledgemasterrrr
@Sledgemasterrrr Жыл бұрын
Yes
@XaskyShow
@XaskyShow 2 жыл бұрын
Why that's not work on manjaro?
@pixegami
@pixegami 2 жыл бұрын
No idea... What error do you see?
@XaskyShow
@XaskyShow 2 жыл бұрын
@@pixegami no error, just not work.
@XaskyShow
@XaskyShow 2 жыл бұрын
@@pixegami he just don't making anything when typing command.
@solo_zither6365
@solo_zither6365 Жыл бұрын
you are a god
@rachit.6110
@rachit.6110 2 жыл бұрын
Please continue this cource! Also please tell us everything from Discord api documentation and all of the bot commands available there please.
@Drk-Inky
@Drk-Inky 7 ай бұрын
i need pysilon discord
@spionzentauer
@spionzentauer 10 ай бұрын
it says for me bot = commands.Bot(command_prefix="/", intents=discord.intents.all()) AttributeError: module 'discord' has no attribute 'intents' how do I fix this
@pixegami
@pixegami 10 ай бұрын
I think you might be using a different discord.py version than the one used in the tutorial. You'd either have to roll back to the same version, for find the equivalent to "discord.intents.all()" in your current library version.
@juliodiaz9093
@juliodiaz9093 Жыл бұрын
im trying this tutorial but when i ise the command, theres no response. the async function doesnt even run.
@pixegami
@pixegami Жыл бұрын
It's possible that the Discord package may have changed or been updated since the video was made :(
@bongobears673
@bongobears673 4 ай бұрын
hey, it says that there is not module named discord. can you help?
@bongobears673
@bongobears673 4 ай бұрын
nevermind i got it working
@pixegami
@pixegami 27 күн бұрын
Ah, looks like you might not have the discord.py library installed yet. Try running 'pip install discord.py' in your command prompt or terminal. If you're still stuck, check out the GitHub repo for the full setup instructions: github.com/pixegami/simple-discord-bot. Let me know if that helps!
Host a Python Discord Bot on AWS Lambda (Free and Easy)
21:40
How To install Module in python with pypi.org
2:47
Nethran Kumaraswamy (Hail LORD OF UNIVERSE)
Рет қаралды 189
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 3,8 МЛН
КОГДА К БАТЕ ПРИШЕЛ ДРУГ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 8 МЛН
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 6 МЛН
Python RAG Tutorial (with Local LLMs): AI For Your PDFs
21:33
pixegami
Рет қаралды 294 М.
Code a Discord Bot with Python - Host for Free in the Cloud
1:08:28
freeCodeCamp.org
Рет қаралды 2,4 МЛН
This One AI Workflow Change Will Make You 5x More Productive
12:31
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Internet Made Coder
Рет қаралды 1,7 МЛН
Creating a Discord Bot in Python 3.9 Tutorial (Fast & Easy)
12:59
PyTest • REST API Integration Testing with Python
37:24
pixegami
Рет қаралды 89 М.
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,8 МЛН
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 3,8 МЛН