【问题标题】:How to add custom emojis into an Embedded message?如何将自定义表情符号添加到嵌入式消息中?
【发布时间】:2021-08-08 14:02:13
【问题描述】:

我做了什么:

我尝试在我的嵌入中添加自定义表情符号。然而,这并没有成功。也许我正在使用过时的代码?我不确定到底是什么导致它不起作用。我没有从控制台得到任何反馈,我的所有其他命令都可以正常工作。

@bot.command()
async def react(ctx):
    channel = bot.get_channel(865698553737117696)
    firework = get(ctx.message.server.emojis, name="firework")
    phone = get(ctx.message.server.emojis, name= "socials")
    react = discord.Embed(title = 'Reaction Roles:',description = 'Below are a range of reaction roles that allows you to be pinged when we announce something exciting:\n',colour = 0xE23D6E)

    react.set_author(name='Disney Dreams', icon_url= 'https://cdn.discordapp.com/attachments/809937571793993730/866327668970881034/logogoosggs.png')
    react.add_field(name='**Shows**', value=f'{firework}' + ': Allows you to get pinged when we make an announcement relating to shows here at Disney Dreams', inline= False)
    react.add_field(name='**Social Media**',
    value=f'{phone}' + ': Allows you to get pinged when we make a post on one of our social media pages', inline=False)

    reactions = await channel.send(embed=react)

    await reactions.add_reaction(':firework:')
    await reactions.add_reaction(':socials:')

【问题讨论】:

    标签: python python-3.x discord discord.py


    【解决方案1】:

    是的,您获取表情符号的方式已经过时。要做到这一点非常简单。

    <a:emojiname:emojiid>
    

    您可以将emojiname 替换为表情符号的名称,将emojiid 替换为表情符号ID。您可以通过输入不和谐频道\emoji 轻松获得&lt;a:emojiname:emojiid&gt;,该消息会将其格式化为您需要的格式。当然用实际的表情符号替换\emoji中的emoji

    仅将&lt;a:emojiname:emojiid&gt; 用于动画表情符号

    要用于普通表情符号或静态表情符号,请使用&lt;:emojiname:emojiid&gt;

    【讨论】:

      猜你喜欢
      • 2018-07-23
      • 2022-08-18
      • 1970-01-01
      • 2015-02-20
      • 2019-07-23
      • 2019-05-07
      • 2020-04-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多