Quantcast
Viewing all articles
Browse latest Browse all 14126

Why doesn't message.content.startswith work? [closed]

I've been trying to get this code to work but it just wont work. I'm stumped on how to get this to work.

The entirety of my code:

import discordintents = discord.Intents.default()client = discord.Client(intents = intents)intents.members = Trueintents.messages = True@client.eventasync def on_ready():    print(f'We have logged in as {client.user}')@client.eventasync def on_message(message):    if message.author == client.user:            return    if message.content.startswith('$hello'):        print("testing")        await message.channel.send('Hello!')

Trying to make it detected when "$hello" is said and respond with "Hello"


Viewing all articles
Browse latest Browse all 14126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>