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

Linking discord thread into "my_raids" #24

Closed Reekfrin closed 11 months ago

Reekfrin commented 11 months ago

Hey, would be nice to have the link to the discord thread integrated into the embed field:

@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'))

        channel = await bot.fetch_channel(g.get('dc_id'))
        #link = await channel.create_invite()
        print(channel.jump_url)
        title.append(channel.jump_url)

    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 11 months ago

Duplicate of #22 and already integrated :)