我用的是不和谐.py图书馆和我正在尝试做一个可调用的前缀。
但是,每当发布消息时,我都会遇到此错误。
prefix_callable
函数应该返回两个可能的前缀,但它会抛出一个错误。你知道吗
TypeError: prefix_callable() takes 0 positional arguments but 2 were given
也许这是一个愚蠢的错误,但我对Python还不熟悉,不能理解这个错误。谢谢您!你知道吗
代码如下:
import discord
from discord.ext import commands
import asyncio
import json
import bot_modules
from bot_modules import misc
import Utilities
from Utilities import manageDataStores
botconfigf = open("./Utilities/botconfig.json", "r")
botconfig = json.load(botconfigf)
def prefix_callable(bot, message):
return "!", "@()"
client = commands.Bot(command_prefix = prefix_callable, case_insensitive = True)
@commands.command
async def info (ctx):
await ctx.send("ayy")
@client.event
async def on_ready():
print("ADAB is online!")
client.run("---")
看起来我没有使用重写,这就停止了重写中的错误。你知道吗
只是用重写来避免这种情况。你知道吗
相关问题 更多 >
编程相关推荐