I want to add multiple custom reaction for multiple commands Or if we add reaction lists it will add random reactions from that lists. So how to do that.
from discord.utils import get
Add Emoji by Name.
reactions = ['emoji_name_1', 'emoji_name_2', 'emoji_name_3']
@bot.command(pass_context=True)
async def ping1(ctx):
msg = "Pong {0.author.mention}".format(ctx.message)
reply = await bot.say(msg)
for emoji_name in reactions:
emoji = get(bot.get_all_emojis(), name=emoji_name)
await bot.add_reaction(reply, emoji)
Add Emoji by ID.
reactions = ['a:abc:78768768768', 'a:def:768768766', 'a:ghi:878768787687']
@bot.command(pass_context=True)
async def ping2(ctx):
msg = "Pong {0.author.mention}".format(ctx.message)
reply = await bot.say(msg)
for emoji in emojilist:
await bot.add_reaction(reply, emoji)
random reaction
reactions = ['a:abc:78768768768', 'a:def:768768766', 'a:ghi:878768787687']
@bot.command(pass_context=True)
async def ping2(ctx):
msg = "Pong {0.author.mention}".format(ctx.message)
reply = await bot.say(msg)
emojiresult = random.shuffle(reactions)
for emoji in emojiresult:
await bot.add_reaction(reply, emoji)