mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
35 lines
887 B
TypeScript
35 lines
887 B
TypeScript
import type {
|
|
GatewayIntegrationCreateDispatchData,
|
|
GatewayIntegrationDeleteDispatchData,
|
|
GatewayIntegrationUpdateDispatchData,
|
|
} from 'discord-api-types/v10';
|
|
import type { BaseClient } from '../../client/base';
|
|
import { toCamelCase } from '../../common';
|
|
import { User } from '../../structures';
|
|
|
|
export const INTEGRATION_CREATE = (self: BaseClient, data: GatewayIntegrationCreateDispatchData) => {
|
|
return data.user
|
|
? {
|
|
...toCamelCase(data),
|
|
user: new User(self, data.user!),
|
|
}
|
|
: toCamelCase(data);
|
|
};
|
|
|
|
export const INTEGRATION_UPDATE = (self: BaseClient, data: GatewayIntegrationUpdateDispatchData) => {
|
|
return data.user
|
|
? {
|
|
...toCamelCase(data),
|
|
user: new User(self, data.user!),
|
|
}
|
|
: toCamelCase(data);
|
|
};
|
|
|
|
export const INTEGRATION_DELETE = (
|
|
_self: BaseClient,
|
|
|
|
data: GatewayIntegrationDeleteDispatchData,
|
|
) => {
|
|
return toCamelCase(data);
|
|
};
|