好的,我想这样做,它会问你想给它命名什么角色,然后你输入它,它会说键入“?验证以获得对服务器的访问权限!”我目前得到了这个,但它不起作用:/需要帮助吗
@bot.command()
async def verification(ctx, *args):
guild = ctx.guild
msg = ' '.join(args)
def check(message):
return message.author == ctx.author and message.channel == ctx.channel and message.content.lower() == msg
await ctx.send("What do you want to Name the Role?")
await bot.wait_for('message', check=check, timeout=60)
await guild.create_role(name=msg, hoist=True, reason="Verification Role Creation", colour=discord.Colour(0x979c9f))
await ctx.send("**Type ?verify to gain Access to the Server!**")
您的命令逻辑不正确:
?verification test string
→(test, string)
)我建议采用以下方法之一:
使用命令参数(
?verification Role Name
→ 角色Role Name
创建)使用实际的消息响应(
?verification
→ Bot询问:What do you want to Name the Role?
→用户响应(示例中)Role Name
→角色Role Name
创建`相关问题 更多 >
编程相关推荐