gpt4 book ai didi

python - 如何在 discord.py 上制作关于前缀的信息?

转载 作者:行者123 更新时间:2023-12-05 05:50:15 24 4
gpt4 key购买 nike

我已经为我的机器人编写了一个代码来更改他的前缀,但我无法发出命令来显示有关他的前缀的信息。你能帮助我吗?我已经尝试过,但没有成功。

代码:

@client.command()
async def infoprefix(ctx, new : str):
await ctx.send(embed = discord.Embed(
title = 'Prefix',
description = (f'Prefix now: ```{new}```'),
colour = discord.Color.blue()
))

最佳答案

根据 official docs你应该这样做:

@client.command()
async def infoprefix(ctx):
new = await bot.get_prefix(ctx)
await ctx.send(embed = discord.Embed(
title = 'Prefix',
description = (f'Prefix now: ```{new}```'),
colour = discord.Color.blue()
))

进一步编码 - 回复答案因为它还 100% 不确定 ;)

关于python - 如何在 discord.py 上制作关于前缀的信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70544396/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com