【发布时间】:2020-12-20 13:19:22
【问题描述】:
我确实构建了一个不和谐的机器人,我想添加一个命令来运行并读取 python 中的另一个脚本输出 我怎么能这样做? 这是我在 discord 上的新机器人
import discord
from discord.ext import commands, tasks
import discord
from discord.ext import commands, tasks
from itertools import cycle
flashing = commands.Bot(command_prefix='.')
@flashing.command()
async def ping(ctx):
await ctx.send(f'Pong! {round(flashing.latency * 1000)} ms' )
print('bot is ready.')
@flashing.event
async def on_ready():
change_status.start()
flashing.run('token')
另一个脚本名称是 base_script.py
【问题讨论】:
标签: python scripting command discord