profiles
This commit is contained in:
@ -5,7 +5,7 @@ class Profile
|
||||
/**
|
||||
* @param {Client} client
|
||||
*/
|
||||
constructor (client, username, id = undefined, avatar_url = undefined)
|
||||
constructor (client, username=undefined, id=undefined, avatar_url=undefined)
|
||||
{
|
||||
/**
|
||||
* @type {Client} client
|
||||
@ -36,7 +36,11 @@ class Profile
|
||||
|
||||
async init()
|
||||
{
|
||||
let response = await this.client._get(`/api/profiles/${this.username}`);
|
||||
let response;
|
||||
if (this.username !== undefined)
|
||||
response = await this.client._get(`/api/profiles/${this.username}`);
|
||||
else
|
||||
response = await this.client._get(`/api/profiles/id/${this.id}`);
|
||||
|
||||
if (response.status !== 200)
|
||||
return response.status;
|
||||
|
Reference in New Issue
Block a user