-2

If I type in the command print in a python script nothing happens. In tutorials there is always the message or the value they want, but when I do there is no command line that opens.

Example:

import discord

from discord.ext import commands

client = commands.bot(command_prefix = "!bot")

@client.event

async def on_ready():
    
     print("bot is ready")
client.run("censoredtoken")

I think there should be a cmd window with the message: bot is ready.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437

2 Answers2

1

Your code has errors:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-db73a0b68049> in <module>
      3 from discord.ext import commands
      4 
----> 5 client = commands.bot(command_prefix = "!bot")
      6 
      7 @client.event

TypeError: 'module' object is not callable

Check here for further hints: TypeError: 'module' object is not callable

Anand
  • 2,239
  • 4
  • 32
  • 48
1

It should be client = commands.Bot(command_prefix = "!bot")

Maxsc
  • 229
  • 1
  • 5