Home > Blockchain >  TypeError: 'module' object is not callable on discord py
TypeError: 'module' object is not callable on discord py

Time:11-26

from discord.ext import commands

token = 'token goess here'

client = commands.bot(command_prefix = '__')

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

client.run(token)

The code works fine before, and now I am getting a "TypeError: 'module' is not callable" error I can't find what is wrong with my code so...any idea what went wrong? Thanks

CodePudding user response:

Change

client = commands.bot(command_prefix = '__')

to

client = commands.Bot(command_prefix = '__')

discord.ext.commands contains bot.py module which causes the error you're getting, you're looking for a Bot class exposed by that module.

  • Related