#mentions in embeds

1 messages · Page 1 of 1 (latest)

celest pasture
#

the following code is not working with mentions

async def r_start(ctx):
    global plrr
    pl = 0
    plrra = []
    rounds = random.randint(0,6)
    await ctx.respond("game started:")
    while True:
        time.sleep(1)
        if len(plrra) == 0:
            plrra += plrr.copy()
        win = plrra.pop(0)
        embed = hikari.Embed(title="Russian Roulette", color="FF0000")
        embed.add_field(f'{win} spins the chamber...','spin spin spin...')
        embed.set_thumbnail('https://i.imgur.com/fSPCKtB.gif')
        message = await bot.rest.create_message(ctx.channel_id,embed)
        time.sleep(3)
        if pl != rounds:
            embed.add_field('The gun didnt go off!','how sad')
            embed.set_thumbnail('https://i.imgur.com/APhwQbX.gif')
            await message.edit(embed)
            pl += 1       
        else:
            embed.add_field(f'you shot your brains out and died!','join me in the shadows')
            embed.set_thumbnail('https://i.imgur.com/Xuf8oww.gif')
            await message.edit(embed)
            rounds=random.randint(0,6)
            pl = 0
            plrr.remove(win)
            if len(plrr) <= 1:
                await bot.rest.create_message(ctx.channel_id, win+" wins")
                plrr = []
                plrra = []
                break
#

plrr is a list of user mention's

sinful hornet
#

can you print win and check it's a user mention?

#

cause it should be fine I think

celest pasture
#

it also works with my other commands

sinful hornet
#

what's in the embed then?

celest pasture
sinful hornet
#

oh

#

that's a field name

#

mentions can only go in the field value

celest pasture
#

is there a way to extract a string from a mention?

#

like get their nickname?