【发布时间】:2021-11-16 11:42:54
【问题描述】:
好的,所以我想使用 python 在 nextcord 中创建一个子命令
会是这样的:
我:.问题
机器人:1 米等于多少厘米?
我:100 厘米
机器人:正确!
这是我目前的代码...
from nextcord.ext import commands
class Fun(commands.Cog, name="Fun Cog"):
def __init__(self, bot:commands.Bot):
self.bot = bot
@commands.command(aliases = ["q/a"])
async def question(self, ctx: commands.Context):
await ctx.send("How many centimeters is in 1 meter?")
def setup(bot: commands.Bot):
bot.add_cog(Fun(bot))
有什么想法吗?
【问题讨论】:
-
如果我能猜出你想在这里问什么,你可能想向机器人添加一个状态变量,让它知道它正在等待答案,而不是任何一般输入。
标签: python question-answering nextcord