Create remove_user command.

This commit is contained in:
alwayscompiling
2022-08-13 21:46:41 -04:00
parent 652533d071
commit d2f33959ed
2 changed files with 55 additions and 1 deletions
+10 -1
View File
@@ -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)