bradtraversy / chatcord

Realtime chat app with rooms
1.16k stars 1.15k forks source link

Submit Button #44

Open DmitriyMalayev opened 2 years ago

DmitriyMalayev commented 2 years ago

Chat Room is visible, able to join, but when sending a message nothing occurs. Any assistance is appreciated.

juanpormon commented 2 years ago

Same here

juanpormon commented 2 years ago

Please check this function is like this: I made like this and worked image

Vipul0052 commented 1 year ago

Python import discord import asyncio

client = discord.Client()

@client.event async def on_ready(): print('Bot is ready.')

@client.event async def on_message(message): if message.author == client.user: return

if message.content.startswith('!hello'):
    await message.channel.send('Hello!')

client.run('YOUR_TOKEN_HERE')

The code seems to be working fine. When you send the message !hello in the chat room, the bot should respond with Hello!. However, if you are not seeing the bot respond, it is possible that there is a problem with your Discord token. You can check your Discord token by going to your Discord settings and clicking on the "Bot" tab. Your token will be displayed in the "Token" field.