mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
chore: apply formatting
This commit is contained in:
parent
a45069ea5f
commit
113e315e07
@ -1,45 +1,45 @@
|
||||
import type { RESTPostAPIChannelInviteJSONBody } from '../../types';
|
||||
import { toCamelCase } from '../it/utils';
|
||||
import { BaseShorter } from './base';
|
||||
|
||||
export class InvitesShorter extends BaseShorter {
|
||||
get(code: string) {
|
||||
return this.client.proxy
|
||||
.invites(code)
|
||||
.get()
|
||||
.then(x => toCamelCase(x));
|
||||
}
|
||||
|
||||
delete(code: string, reason?: string) {
|
||||
return this.client.proxy
|
||||
.invites(code)
|
||||
.delete({ reason })
|
||||
.then(x => toCamelCase(x));
|
||||
}
|
||||
|
||||
channels = {
|
||||
create: ({ channelId, reason, ...body }: CreateInviteFromChannel) =>
|
||||
this.client.proxy
|
||||
.channels(channelId)
|
||||
.invites.post({ body, reason })
|
||||
.then(x => toCamelCase(x)),
|
||||
list: (channelId: string) =>
|
||||
this.client.proxy
|
||||
.channels(channelId)
|
||||
.invites.get()
|
||||
.then(x => toCamelCase(x)),
|
||||
};
|
||||
|
||||
guilds = {
|
||||
list: (guildId: string) =>
|
||||
this.client.proxy
|
||||
.guilds(guildId)
|
||||
.invites.get()
|
||||
.then(x => toCamelCase(x)),
|
||||
};
|
||||
}
|
||||
|
||||
export interface CreateInviteFromChannel extends RESTPostAPIChannelInviteJSONBody {
|
||||
channelId: string;
|
||||
reason?: string;
|
||||
}
|
||||
import type { RESTPostAPIChannelInviteJSONBody } from '../../types';
|
||||
import { toCamelCase } from '../it/utils';
|
||||
import { BaseShorter } from './base';
|
||||
|
||||
export class InvitesShorter extends BaseShorter {
|
||||
get(code: string) {
|
||||
return this.client.proxy
|
||||
.invites(code)
|
||||
.get()
|
||||
.then(x => toCamelCase(x));
|
||||
}
|
||||
|
||||
delete(code: string, reason?: string) {
|
||||
return this.client.proxy
|
||||
.invites(code)
|
||||
.delete({ reason })
|
||||
.then(x => toCamelCase(x));
|
||||
}
|
||||
|
||||
channels = {
|
||||
create: ({ channelId, reason, ...body }: CreateInviteFromChannel) =>
|
||||
this.client.proxy
|
||||
.channels(channelId)
|
||||
.invites.post({ body, reason })
|
||||
.then(x => toCamelCase(x)),
|
||||
list: (channelId: string) =>
|
||||
this.client.proxy
|
||||
.channels(channelId)
|
||||
.invites.get()
|
||||
.then(x => toCamelCase(x)),
|
||||
};
|
||||
|
||||
guilds = {
|
||||
list: (guildId: string) =>
|
||||
this.client.proxy
|
||||
.guilds(guildId)
|
||||
.invites.get()
|
||||
.then(x => toCamelCase(x)),
|
||||
};
|
||||
}
|
||||
|
||||
export interface CreateInviteFromChannel extends RESTPostAPIChannelInviteJSONBody {
|
||||
channelId: string;
|
||||
reason?: string;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user