KineticFox / loa-lfgBot

A recreation of the famous lfg-Bot but only for Lost Ark (by now)
GNU General Public License v3.0
2 stars 1 forks source link

Group overview message link #22

Closed KineticFox closed 8 months ago

KineticFox commented 8 months ago

In the /my_raids embed should be also the message link of the given group titles appear

 @bot.slash_command(name="my_raids")
    async def my_raids(ctx):
        tablename = ''.join(l for l in ctx.guild.name if l.isalnum())
        db = LBDB()
        db.use_db()
        group_list = db.get_my_raids(ctx.author.name, tablename)
        db.close()

        panel = discord.Embed(
            title='Group overview / Gruppenübersicht',
            color=discord.Colour.green(),
        )
        chars = []
        raid = []
        title =[]

        #chardicts = [{k: item[k] for k in item.keys()} for item in result]
        for g in group_list:
            chars.append(g.get('char_name'))
            raid.append(g.get('raid'))
            title.append(g.get("raid_title"))
        e_chars = "\n".join(str(char) for char in chars)
        e_raid = "\n".join(str(r) for r in raid)
        e_title = "\n".join(str(t) for t in title)

        panel.add_field(name='Char', value=e_chars)
        panel.add_field(name='Raid', value=e_raid)
        panel.add_field(name='Title', value=e_title)

        await ctx.respond(f'Your active Groups / Deine aktiven Gruppen ', embed=panel, ephemeral=True)
KineticFox commented 8 months ago

thread/message id can be obtained with

g.get('dc_id')