access profiles with username instead of id

This commit is contained in:
AdrienLSH
2024-01-18 10:31:56 +01:00
parent 1af55795d9
commit dee71c7c8d
7 changed files with 22 additions and 21 deletions

View File

@ -20,14 +20,14 @@ class Profiles
let profiles = []
response_data.forEach((profile) => {
profiles.push(new Profile(this.client, profile.user_id, profile.username, profile.avatar_url))
profiles.push(new Profile(this.client, profile.username, profile.user_id, profile.avatar_url))
});
return profiles;
}
async getProfile(user_id)
async getProfile(username)
{
let profile = new Profile(this.client, user_id);
let profile = new Profile(this.client, username);
if (await profile.init())
return null;
return profile;