Reputation: 11
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
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