[英]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")
如果表情符號沒有動畫,只需寫:<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="{} <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")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.