机器人不';t正确发送表情符号(Python 3.9.2.2021.1)
我正忙着在我的机器人里制作我的经济命令,我想有一个自定义的货币表情符号。所以我做了一个,我很快把它放到我的代码中。然后,当我激活机器人时,它只发送表情符号名称!(不,它没有发送我用来识别表情符号的小代码,它只发送了:currency\u symbol:) 我需要表情符号像表情符号一样表现出来 我是如何在PyCharm中制作表情符号的:机器人不';t正确发送表情符号(Python 3.9.2.2021.1),python,discord.py,emoji,Python,Discord.py,Emoji,我正忙着在我的机器人里制作我的经济命令,我想有一个自定义的货币表情符号。所以我做了一个,我很快把它放到我的代码中。然后,当我激活机器人时,它只发送表情符号名称!(不,它没有发送我用来识别表情符号的小代码,它只发送了:currency\u symbol:) 我需要表情符号像表情符号一样表现出来 我是如何在PyCharm中制作表情符号的: <a:currency_symbol:832506821675057173> 代码: @commands.command(pass_conte
<a:currency_symbol:832506821675057173>
代码:
@commands.command(pass_context=True,别名=['bal'])
异步def余额(自身、ctx):
id=str(ctx.message.author.id)
embed=discord.embed(title=“CatsyBot经济”,description=f“{ctx.message.author}的平衡”,color=discord.color.blue())
embed.add_字段(name=“Bank”,value=“{}”。格式(金额[id]))
如果id的金额为:
等待ctx.send(嵌入=嵌入)
其他:
等待ctx.send(embed=“您没有帐户”)
如果表情符号没有设置动画,只需写下:
代码:
@commands.command(pass_context=True,别名=['bal'])
异步def余额(自身、ctx):
id=str(ctx.message.author.id)
embed=discord.embed(title=“CatsyBot经济”,description=f“{ctx.message.author}的平衡”,color=discord.color.blue())
embed.add_字段(name=“Bank”,value=“{}”。格式(金额[id]))
如果id的金额为:
等待ctx.send(嵌入=嵌入)
其他:
等待ctx.send(embed=“您没有帐户”)
我认为你应该改进你的问题。标签是关于Python和pycharm的,但是您似乎讨论了一些特定的Python库。我假设不是IRC机器人(文本中有一个discord
)。如果你想针对正确的受众,你应该正确地标记(没有人可以阅读所有新问题[每分钟太多])。还有你的问题。。。你假设我们知道你在做什么:不要那样做!更好地解释你在做什么,你得到了什么,你期望什么。一个大巧合!我刚刚按下了编辑按钮,添加了正确的标签!我们通过过滤标签来寻找问题。(使用Edit,您可以更改标记)。这样做很好吗?您的问题中没有关于json的内容,没有关于python-3.9的特定内容。但是有很多关于不和谐的标签。检查标签,看哪一个更好。并在您的问题上使用标记或描述:什么是discord
(不是服务,而是您正在使用的特定库),什么是commands
(相同的库?不同的库?)。可能这些库的版本比PyCharm或python版本更相关。或者他可以尝试的只是输入表情符号,比如“它仍然不起作用。现在它显示了表情符号的全部代码。”。
@commands.command(pass_context=True, aliases=['bal'])
async def balance(self, ctx):
id = str(ctx.message.author.id)
embed = discord.Embed(title="CatsyBot Economy", description=f"{ctx.message.author}'s Balance", colour=discord.Colour.blue())
embed.add_field(name="Bank", value="{} <a:currency_symbol:832506821675057173>".format(amounts[id]))
if id in amounts:
await ctx.send(embed=embed)
else:
await ctx.send(embed="You do not have an account")
@commands.command(pass_context=True, aliases=['bal'])
async def balance(self, ctx):
id = str(ctx.message.author.id)
embed = discord.Embed(title="CatsyBot Economy", description=f"{ctx.message.author}'s Balance", colour=discord.Colour.blue())
embed.add_field(name="Bank", value="{} <currency_symbol:832506821675057173>".format(amounts[id]))
if id in amounts:
await ctx.send(embed=embed)
else:
await ctx.send(embed="You do not have an account")