【发布时间】:2021-07-11 17:19:30
【问题描述】:
@commands.has_permissions(administrator=True)
@bot.command()
async def ban(ctx, member : discord.Member, *, reason=None):
await member.send (f"{member.mention} text {ctx.guild.name} for the reason: {reason} ")
await member.ban(reason=reason)
await ctx.send (title=f"**__text:__**", description=f"{member.mention} \n **text:** \n *{reason}*", timestamp=datetime.datetime.utcnow(),color=discord.Color.blue()) .embed.set_footer (text="text ", icon_url="url")
if reason is None:
reason = f"{member.mention} was banned without reasons {ctx.guild.name} "
return reason
我没有错误,并且嵌入 didint 发送
【问题讨论】:
-
第5行的语法并不是真正有效的python语法
-
??????????它是
-
我使用 discord py{member.mention} 它在 discord py 上可能阅读了文档,我使用了 f 字符串
-
不,不是那个,这个 -
timestamp=datetime.datetime.utcnow(),color=discord.Color.blue()) .embed.set_footer (text="text ", icon_url="url") -
哦,是的,也许它不起作用所以......
标签: python discord.py embed