discord.py在使用多处理时引发错误

2024-09-29 20:19:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我在discord.py中有另一个进程。我想运行2机器人类

我试过了

from multiprocessing import Process
from discord.ext.commands import Bot

bot01 = Bot(command_prefix="!")
bot02 = Bot(command_prefix="2!")

def run_bot(bot, token):
    bot.run(token)

if __name__ == "__main__":
    Process(target=run_bot, args=(bot, "bot01_token")).start()
    Process(target=run_bot, args=(bot, "bot02_token")).start()

但它抛出:EOFError: Ran out of input


Tags: runfromimporttokentargetprefixbotargs

热门问题