现在我有一个命令,允许您将更改应用到我的托管服务器上的本地文件。有没有办法让bot将await ctx.send(...)
命令的输出发送到Discord?
通常,输出如下所示:
HEAD is now at f8dd7fe Slash Commands/Pull Feature/JSON Changes!
这是我当前的命令:
@client.command()
@commands.has_role('Bot Manager')
async def gitpull(ctx):
typebot = config['BotType']
if typebot == "BETA":
os.system("git fetch --all")
os.system("git reset --hard origin/TestingInstance")
await ctx.send("I have attempted to *pull* the most recent changes in **TestingInstance**")
elif typebot == "STABLE":
os.system("git fetch --all")
os.system("git reset --hard origin/master")
await ctx.send("I have attempted to *pull* the most recent changes in **Master**")
任何建议或提示都会大有帮助
使用^{} 模块而不是
os.system
。这将允许您捕获子流程的输出比如:
相关问题 更多 >
编程相关推荐