aPerson
aPerson

Reputation: 11

when i try to run my discord bot it tells gives me a module error

    import discord 
from discord.ext import commands


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

@client.command(name='scp')
async def scp(context):
    mods_channel = client.get_channel(806352117442543616)
    
    scp = discord.embed(title="scp wiki", description="http://www.scpwiki.com/scp-series", color=0xCC0000)

    await context.message.channel.send(embed=scp)

@client.event
async def on_ready():
    #do stuff

    mods_channel = client.get_channel(806352117442543616)
    await mods_channel.send('i work! ')

@client.event
async def on_typing():
    mods_channel = client.get_channel(806352117442543616)
    await mods_channel.send('i wonder what you are going to say :thinking:')

@client.event
async def on_message(message):
    if message.content == 'hello Irantu' or message.content == 'hello irantu':
        mods_channel = client.get_channel(806352117442543616)
        await mods_channel.send('HI! :smile:')
#run client

Whenever I run it, it gives me TypeError: 'module' object is not callable. this is for a discord bot that i am making for an scp themed discord server This was all done with Visual Studio Code using Python 3.9.4.

Upvotes: 1

Views: 57

Answers (1)

Jacob Lee
Jacob Lee

Reputation: 4700

You are trying to call discord.ext.commands.bot, which is a module. You are probably looking for discord.ext.commands.Bot:

from discord.ext import commands

client = commands.Bot(command_prefix="%")

Upvotes: 1

Related Questions