我想用Discord.py脚本运行Bottlepy脚本,但只启动了Bottlepy脚本。
这是我的来源:
import asyncio
import bottle
import discord
from discord.ext import commands
client=commands.Bot(command_prefix=[">", "<", ".", "?", "!"])
#here where my script (not spectacular)
client.run("xxxxxXXXXxxXXetXxXXfXXxXXxXXXXxXxxxXxXX")
bottle.run(host='0.0.0.0', port=80)发布于 2021-01-30 09:42:14
瓶子永远不会运行,因为client.run阻塞了。所以你需要在不同的线程中运行bottle。
考虑一下这个
bot.run(TOKEN)
print("foobar") # this line will not run until the bot process ends.因此,其中一个进程需要在另一个线程中取消
发布于 2020-01-21 00:17:57
Client.start是一个协程。你需要使用一个事件循环来运行它。
https://stackoverflow.com/questions/59826254
复制相似问题