mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00

* fix: github actions * fix: pnpm version * fix: github actions checkout * fix: brackets in failure function * fix: github actions * fix: github actions * fix: github actions * fix: github actions * fix: github actions * fix: github actions * fix: github actions * fix: github actions * chore: apply formatting * fix: github actions --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
25 lines
747 B
TypeScript
25 lines
747 B
TypeScript
import type { GatewayReadyDispatchData, RESTPatchAPICurrentUserJSONBody } from 'discord-api-types/v10';
|
|
import type { UsingClient } from '../commands';
|
|
import { User } from './User';
|
|
|
|
export class ClientUser extends User {
|
|
bot = true;
|
|
constructor(
|
|
client: UsingClient,
|
|
data: GatewayReadyDispatchData['user'],
|
|
public application: GatewayReadyDispatchData['application'],
|
|
) {
|
|
super(client, data);
|
|
}
|
|
|
|
async fetch() {
|
|
const data = await this.api.users('@me').get();
|
|
return new ClientUser(this.client, data, this.application);
|
|
}
|
|
|
|
async edit(body: RESTPatchAPICurrentUserJSONBody) {
|
|
const data = await this.api.users('@me').patch({ body });
|
|
return new ClientUser(this.client, data, this.application);
|
|
}
|
|
}
|