I've noticed that they had a recent update in Discord. If your code is missing intents, try creating some: intents = discord.Intents.default() intents.message_content = True client = discord.Client(intents=intents) Also remember to go on the developer website and under the "BOT" section you can toggle a new "MESSAGE CONTENT INTENT" switch. For the 2024 version + source code: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-UYJDKSah-Ww.html
I might be able to create a custom bot that i need for a client thanks to this video. Making bots is not my area of work, but this video has helped a lot. Thank you
amazing video bro thanks for the help got my bot running just had to do the intents change in the code and the bot as well thanks to everyone else as well who pointed it out in the chat
Begin printing messages places you might think is where the code isnt working then change things there and look for mistakes. Its probaly something with the bot not activating at all so look in main and bot
hi thanks for youre codes but i have a problem with running the bot Exception has occurred: AttributeError module 'discord' has no attribute 'Client' what shoud i do?
ive just done this but it continues to reply with: Traceback (most recent call last): File "C:\Users\Windows PC\PycharmProjects\pythonProject\main.py", line 1, in import bot File "C:\Users\Windows PC\PycharmProjects\pythonProject\bot.py", line 1, in import discord ModuleNotFoundError: No module named 'discord' what do i do??
needed to put client = discord.Client(intents=discord.Intents.default()) for line 15 for bot to run :p if anyone has any cool or semi-cool resources or communities for python, plz lemme know
Was this your error? Client.__init__() missing 1 required keyword-only argument: 'intents' If it was, I found that writing discord.Client(intents=discord.Intents.default()) instead of just discord.Client() fixed my problem.
Only really works in countries that have dollar signs as their currency like Canada or Australia most other places have their other symbol on the number row i.e. £, ¥, or € in which case the hash symbol is moved under the backspace, I believe this person is Scandinavian so he would have a hash where you are describing. The place the "backtick" is moved to everywhere else is to the left of the 1 key along with the "broken bar" and "not sign".
after I run the pip install discord is still get these message: Traceback (most recent call last): File "C:\Users\Siyu Miao\PycharmProjects\hangoutbot\main.py", line 1, in import bot File "C:\Users\Siyu Miao\PycharmProjects\hangoutbot\venv\bot.py", line 1, in import discord ModuleNotFoundError: No module named 'discord' Process finished with exit code 1
i made a minimal version with almost the same functionality that should work if anyone is struggling. just one py file. (message.content not loading properly for some reason when following the tutorial): import discord import random client = discord.Client(intents=discord.Intents.all()) @client.event async def on_message(message): if message.content.lower() == 'hello': await message.channel.send("hi") if message.content.lower() == 'roll': await message.channel.send(str(random.randint(1,6))) client.run("put-your-key-here")
@@prismstealthx100 I spent a few hours debugging my code before I got it to work, I even used Chat GPT to help find mistakes which isn't perfect by any means, but still helpful - Keep working at it, you'll get it to work eventually!
6:27 isn't that character a back tick? also known as a grave. `. it's usually right above the tab key and beside the 1 key. pressing it while holding shift gives a tilde ~.
My thoughts exactly. I know it as a back tick from experience programming, but I was shocked to hear him say "you'll just have to copy it from the internet". Although with the state of minimalistic keyboards these days maybe it's not surprising. Maybe I'm old school but I'm still running with the whole works: Querty, F1-F12, Esc, System keys (Print screen, Insert, Delete, etc.), NumPad, arrow keys, and an additional M1-M5
I did everything in the tutorial but in the end no matter what I write he doesn't respond and the message says "user said ' ' (channel)" what do I do ?
same problem br0 but at first the code ran successully without error but my bot was not running then i went to botghost to make it online but now it is not responding EVEN IT IS ONLINE
for some reason when i try to access the contents of the message, it returns an empty string. i used the exact same code as the video suggested, anyone has any idea what to do?
400 Bad Request (error code: 50006): Cannot send an empty message, When I send a message on discord it detects I have send an empty message. Why and how do I fix it?
@@03tg no. I dunno what is the error, I tried searching on the web for other ways to get the message and send it since this way is clearly broken but found nothing. Can anyone help us?
Happy it worked for you! I know they had a recent update which absolutely destroyed 99.99% of all Discord tutorials recently. But I'll make sure to make an updated one in the winter time. Thanks, and happy coding!
I get this Error: NameError: name 'TOKEN' is not defined Although it is defined with like this: TOKEN = "MYTOKEN" client = discord.Client() Please help meeee
Hey, first off thanks for the vid. I was having a bit of trouble and I can't seem to find the answer. How do I actually run the main on python to get that interface? ( 4:19 ) I keep getting the cmd for python
hey just wanted to say I found the tutorial really helpful. I just have one problem, when I'm trying to run my bot in Pycharm to make it come online it gives me an error saying this Client.__init__() missing 1 required keyword-only argument: 'intents' and I have no clue what this means. I tried looking up what it means and found nothing. Can someone please help?
Why does every single tutorial have a completely differenty code structure to the point where it looks like a different language. Why are beginners guides so complicated
I don't know if you're still having trouble, but there's strength in numbers, right? If you would like, I could walk you through how I was able to do it? on a discord call or whatever you would prefer,
someone help I am getting the message File "C:\Users\Liinter\PycharmProjects\pythonProject1\main.py", line 4, in bot.run_discord_bot AttributeError: module 'bot' has no attribute 'run_discord_bot'
every time I run the program it gives me this Traceback (most recent call last): File "C:\Users\afeef\PycharmProjects\bot\main.py", line 4, in bot.run_discord_bot() File "C:\Users\afeef\PycharmProjects\bot\bot.py", line 18, in run_discord_bot client = discord.Client() TypeError: Client.__init__() missing 1 required keyword-only argument: 'intents' am I doing somthing wrong?
@@afeef5226 try this client = discord.Client(intents=discord.Intents.default()) or this client = discord.Client(intents=discord.Intents.all()) Also enable intents in discord developer portal, I messed around with it for a while and it ended up working when I enabled all intents in discord developer portal (in "bot" section) and had my client as: client = discord.Client(intents=discord.Intents.all())
when i run the code it says that it expected an "Except" block, but i did exactly what you did. here is the complete error: await message.author.send(response) if is_private else await message.channel.send(response) ^ SyntaxError: expected 'except' or 'finally' block