Bot 无法正确发送表情符号 (Python 3.9.2 PyCharm 2021.1)
Bot doesn't send emoji properly (Python 3.9.2 PyCharm 2021.1)
我正忙着在我的机器人中执行我的经济命令,我想要一个自定义货币表情符号。所以我做了一个,并迅速将其放入我的代码中。然后,当我激活机器人时,它只发送表情符号名称! (不,它没有发送我用来识别表情符号的小代码,它只是发送了:currency_symbol:)
我需要表情符号才能真正像表情符号一样显示自己。
PyCharm 中的表情符号我做了什么:
<a:currency_symbol:832506821675057173>
代码:
@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")
我正忙着在我的机器人中执行我的经济命令,我想要一个自定义货币表情符号。所以我做了一个,并迅速将其放入我的代码中。然后,当我激活机器人时,它只发送表情符号名称! (不,它没有发送我用来识别表情符号的小代码,它只是发送了:currency_symbol:)
我需要表情符号才能真正像表情符号一样显示自己。
PyCharm 中的表情符号我做了什么:
<a:currency_symbol:832506821675057173>
代码:
@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")