Skip to content

Commit

Permalink
Added mentions in update_member_list
Browse files Browse the repository at this point in the history
  • Loading branch information
Endyya committed Dec 5, 2024
1 parent 389add1 commit b345dd4
Showing 1 changed file with 44 additions and 13 deletions.
57 changes: 44 additions & 13 deletions src/SilicaAnimus/discord_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,31 +329,62 @@ async def update_member_list(interaction: discord.Interaction):
embed = MessageTemplate(
title = """ Mise à jour des adhérents sur le Discord""")

to_mem_str = ', '.join([member for member in to_member])
to_mem_str = ', '.join(
[interaction.guild.get_member_named(member).mention
for member in to_member])
if len(to_mem_str) > 1000:
self.logger.info(f"hidden users to member :\n{to_mem_str}")
to_mem_str = f'{len(to_member)} utilisateurs concernés'
to_unmem_str = ', '.join([member for member in to_unmember])

to_unmem_str = ', '.join(
[interaction.guild.get_member_named(member).mention
for member in to_unmember])
if len(to_unmem_str) > 1000:
self.logger.info(f"hidden users to unmember :\n{to_unmem_str}")
to_unmem_str = f'{len(to_unmember)} utilisateurs concernés'
to_keep_str = ', '.join([member for member in to_keep])

to_keep_str = ', '.join(
[interaction.guild.get_member_named(member).mention
for member in to_keep])
if len(to_keep_str) > 1000:
self.logger.info(f"hidden users to keep :\n{to_keep_str}")

to_keep_str = f'{len(to_keep)} utilisateurs concernés'

embed.add_field(name = 'Ces utilisateurs gagneront le role membre :',
value = to_mem_str,
inline = False)
embed.add_field(name = 'Ces utilisateurs conserveront leur role membre :',
value = to_keep_str,
inline = False)
embed.add_field(name = 'Ces utilisateurs perdront leur role membre :',
value = to_unmem_str,
inline = False)
embed.add_field(
name = 'Ces utilisateurs gagneront le role membre :',
value = to_mem_str,
inline = False)
embed.add_field(
name = 'Ces utilisateurs conserveront leur role membre :',
value = to_keep_str,
inline = False)
embed.add_field(
name = 'Ces utilisateurs perdront leur role membre :',
value = to_unmem_str,
inline = False)

class Buttons(discord.ui.View):
@discord.ui.button(label = 'Afficher les membres masqués',
style = discord.ButtonStyle.primary)
async def button_display(self, interaction, button):
pass

@discord.ui.button(label = 'Confirmer',
style = discord.ButtonStyle.success)
async def button_confirm(self, interaction, button):
pass

@discord.ui.button(label = 'Annuler',
style = discord.ButtonStyle.danger)
async def button_cancel(self, interaction, button):
pass


buttons = Buttons()

await interaction.response.send_message(embed = embed)
await interaction.response.send_message(embed = embed,
view = buttons)


@app_commands.checks.has_any_role('Administrateurs', 'Bureau')
Expand Down

0 comments on commit b345dd4

Please sign in to comment.