seyfert/src/events/hooks/integration.ts
Marcos Susaña bd951397a2
feat: Reduce dependencies (#221)
* feat: add support for new Discord application emojis features

* feat: add support for new Discord application emojis features

* feat: applications emojis routes

* chore: switch typings provider

* fix: unnecesary type

* feat: magic bytes

* chore: move api-types

* chore: ?

* fix: omg npm

* chore: apply formatting

* fix: for fast merge

---------

Co-authored-by: Tony Supremacy <165050835+VanStk@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-21 22:58:40 -04:00

35 lines
945 B
TypeScript

import type {
GatewayIntegrationCreateDispatchData,
GatewayIntegrationDeleteDispatchData,
GatewayIntegrationUpdateDispatchData,
} from '../../types';
import { toCamelCase } from '../../common';
import type { UsingClient } from '../../commands';
import { Transformers } from '../../client/transformers';
export const INTEGRATION_CREATE = (self: UsingClient, data: GatewayIntegrationCreateDispatchData) => {
return data.user
? {
...toCamelCase(data),
user: Transformers.User(self, data.user!),
}
: toCamelCase(data);
};
export const INTEGRATION_UPDATE = (self: UsingClient, data: GatewayIntegrationUpdateDispatchData) => {
return data.user
? {
...toCamelCase(data),
user: Transformers.User(self, data.user!),
}
: toCamelCase(data);
};
export const INTEGRATION_DELETE = (
_self: UsingClient,
data: GatewayIntegrationDeleteDispatchData,
) => {
return toCamelCase(data);
};