Error While Making Discord Bot

It says something about STR in it, but I have no idea what is wrong.

Error Photo:

Code Snipit:

async def on_ready():
  print('We have logged in as {0.user}'.format(client))
async def on_message(msg):
  if == client.user:
  if msg.content('/people'):
  elif msg.content('/teamcomp'):
my_secret = os.environ['token']

Try msg.content == "/people"? It almost seems like “msg” or “content” might be a string (referred to as str), but try this first.


What @Firepup650 said was right, msg.content is not a function, it is a str. Other than that, here is a tip: use ext.commands off the bat, it is easier to use, and if you do not use it (I made this mistake) you will make something quite painful in the end. (Mine had main, main1, main2, and the code was super messy)

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.