Create remove_user command.
This commit is contained in:
@@ -54,6 +54,8 @@ class UpdateUsernameVerifyView(nextcord.ui.View):
|
||||
content += f"\nApproved by <@{interaction.user.id}>."
|
||||
await interaction.edit(content=content, view=None)
|
||||
|
||||
user_was_found: bool = False
|
||||
|
||||
# update username in all tables and categories
|
||||
for table in guild.tables:
|
||||
table_updated: bool = False
|
||||
@@ -64,10 +66,17 @@ class UpdateUsernameVerifyView(nextcord.ui.View):
|
||||
score.user = new_username
|
||||
category.add_score(score)
|
||||
table_updated = True
|
||||
user_was_found = True
|
||||
|
||||
if table_updated:
|
||||
await send_highscore_message(
|
||||
interaction.guild.get_channel(guild.highscore_channel), guild, table
|
||||
)
|
||||
|
||||
highscores_data.save_guild_data(guild)
|
||||
if not user_was_found:
|
||||
await interaction.send(
|
||||
f'User "{old_username}" was not found. Inform user to correct username.',
|
||||
ephemeral=True,
|
||||
)
|
||||
else:
|
||||
highscores_data.save_guild_data(guild)
|
||||
|
||||
Reference in New Issue
Block a user