![](/img/trans.png)
[英]I am trying to delete some emails, but when I run the code I get the following error: TypeError: 'module' object is not callable (env)
[英]TypeError: 'module' object is not callable. When I run it it does not work cuz there is some sort of error in line 4.What should I do?
import discord
from discord.ext import commands
bot = commands.bot(command_prefix='#')
@bot.command()
async def add(ctx, num1:int, num2:int):
await ctx.reply(num1+num2)
@bot.command()
async def subtract(ctx, num1:int, num2:int):
await ctx.reply(num1-num2)
@bot.command()
async def multiply(ctx, num1:int, num2:int):
await ctx.reply(num1*num2)
@bot.command()
async def divide(ctx, num1:int, num2:int):
await ctx.reply(num1/num2)
@bot.command()
async def square(ctx, num1:int, num2:int):
await ctx.reply(num1**num2)
bot.run('TOKEN')
嘗試做bot = commands.Bot(command_prefix = '#')
而不是bot = commands.bot(command_prefix='#')
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.