mirror of
https://github.com/versia-pub/api.git
synced 2025-12-06 08:28:19 +01:00
feat(client): ✨ Add getAccountByUsername method
This commit is contained in:
parent
0c30b024cd
commit
0945a72a79
|
|
@ -546,6 +546,25 @@ export class LysandClient extends BaseClient {
|
|||
return this.get<Account>(`/api/v1/accounts/${id}`, extra);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /api/v1/accounts/id
|
||||
*
|
||||
* Lysand API only.
|
||||
* @param username The username.
|
||||
* @return An account.
|
||||
*/
|
||||
public getAccountByUsername(
|
||||
username: string,
|
||||
extra?: RequestInit,
|
||||
): Promise<Output<Account>> {
|
||||
return this.get<Account>(
|
||||
`/api/v1/accounts/id?${new URLSearchParams({
|
||||
username,
|
||||
}).toString()}`,
|
||||
extra,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /api/v1/accounts/:id/followers
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue