使用不和谐表情符号时要记住的一些事项:您不能使用 :one: 来表示反应,您必须使用 unicode 符号。 1️⃣2️⃣3️⃣4️⃣
一般来说,对于表情符号,您一次只能添加一个作为反应,但您可以创建一个 for 循环来从列表中添加表情符号
我看到您希望机器人删除嵌入,然后发送一个新的。如何编辑发送的嵌入?看看答案here。
只是为了向您展示如何使用嵌入,我在这里添加了代码的编辑版本。
将嵌入更改为您需要的样式。
import asyncio
@bot.command(name='plugins')
async def plugins(ctx):
message = ctx.message
embed_1 = discord.Embed(title='Welcometo to SteinerCraft plugin page!', color=0xFFC71C)
embed_1.set_author(name='SC.B#4073', icon_url='https://cdn.discordapp.com/attachments/765665083082407976/767456901398921246/SC.B_remix_profile.png')
embed_1.add_field(name='Select what type of help you need.', value='.', inline=False)
embed_1.add_field(name='Home => :one:', value='Friend => :two:', inline=True)
embed_1.add_field(name='Community => :three:', value='Other => :four:', inline=True)
embed_2 = discord.Embed(title='A second embed page', color=0xFFC71C)
embed_2.set_author(name='SC.B#4073', icon_url='https://cdn.discordapp.com/attachments/765665083082407976/767456901398921246/SC.B_remix_profile.png')
embed_2.add_field(name='Select what type of help you need.', value='.', inline=False)
embed_2.add_field(name='Home => :one:', value='Friend => :two:', inline=True)
embed_2.add_field(name='Community => :three:', value='Other => :four:', inline=True)
embed_3 = discord.Embed(title='A third embed page', color=0xFFC71C)
embed_3.set_author(name='SC.B#4073', icon_url='https://cdn.discordapp.com/attachments/765665083082407976/767456901398921246/SC.B_remix_profile.png')
embed_3.add_field(name='Select what type of help you need.', value='.', inline=False)
embed_3.add_field(name='Home => :one:', value='Friend => :two:', inline=True)
embed_3.add_field(name='Community => :three:', value='Other => :four:', inline=True)
embed_4 = discord.Embed(title='A fourth embed page', color=0xFFC71C)
embed_4.set_author(name='SC.B#4073', icon_url='https://cdn.discordapp.com/attachments/765665083082407976/767456901398921246/SC.B_remix_profile.png')
embed_4.add_field(name='Select what type of help you need.', value='.', inline=False)
embed_4.add_field(name='Home => :one:', value='Friend => :two:', inline=True)
embed_4.add_field(name='Community => :three:', value='Other => :four:', inline=True)
emb_message = await ctx.message.channel.send(embed=embed_1)
emoji_list = ['1️⃣','2️⃣','3️⃣','4️⃣']
for i in emoji_list:
await emb_message.add_reaction(i)
def check(reaction, user):
return user == ctx.author and str(reaction.emoji) in emoji_list
# This makes sure nobody except the command sender can interact
while True:
try:
reaction, user = await bot.wait_for("reaction_add", timeout=60, check=check)
if str(reaction.emoji) == "1️⃣":
await emb_message.edit(embed = embed_1)
await emb_message.remove_reaction(reaction, user)
elif str(reaction.emoji) == "2️⃣":
await emb_message.edit(embed = embed_2)
await emb_message.remove_reaction(reaction, user)
elif str(reaction.emoji) == "3️⃣":
await emb_message.edit(embed = embed_3)
await emb_message.remove_reaction(reaction, user)
elif str(reaction.emoji) == "4️⃣":
# await emb_message.edit(embed = embed_4)
await emb_message.remove_reaction(reaction, user)
else:
await message.remove_reaction(reaction, user)
except asyncio.TimeoutError:
break
# ending the loop if user doesn't react after x seconds
在终端中打印您的表情符号以便您可以复制它们:
@bot.command()
async def emojiprint(ctx, *, emojis):
print(emojis)
添加任意数量的表情符号,自定义的,不和谐的......它将在终端中打印所有的表情符号。自定义显示为 <:emoji_name:emoji_id> (或 如果动画)