Should have handled username updating code in the command, didn't need to create new functions for the command.

This commit is contained in:
alwayscompiling
2022-08-13 21:26:50 -04:00
parent 73e350c845
commit 652533d071
5 changed files with 24 additions and 84 deletions
-20
View File
@@ -209,23 +209,3 @@ class Guild:
str: string of json representation of Guild
"""
return json.dumps(self.to_dict(), indent=4)
def update_username(self, old_username: str, new_username: str) -> "list[Table]":
"""
Collects list of tables that had a username updated. Sends old and new username
to the table function to update username.
Args:
old_username (str): Username to replace. Sent to Table function
new_username (str): Username to replace with. Sent to Table function
Returns:
list[Table]: All the tables that had a username updated
"""
updated_tables: "list[Table]" = []
for table in self.tables:
if table.update_username(old_username, new_username):
updated_tables.append(table)
return updated_tables