refactor: rename controllers to handlers and handlers to helpers (#660)

* refactor: rename controllers to handlers and handlers to helpers

* fmt
This commit is contained in:
ayntee
2021-03-11 21:41:03 +04:00
committed by GitHub
parent aaed064709
commit 8654aeded5
72 changed files with 271 additions and 296 deletions
@@ -0,0 +1,29 @@
import { eventHandlers } from "../../bot.ts";
import {
DiscordPayload,
IntegrationCreateUpdateEvent,
} from "../../types/mod.ts";
export function handleIntegrationUpdate(data: DiscordPayload) {
const {
enable_emoticons: enableEmoticons,
expire_behavior: expireBehavior,
expire_grace_period: expireGracePeriod,
role_id: roleID,
subscriber_count: subscriberCount,
synced_at: syncedAt,
guild_id: guildID,
...rest
} = data.d as IntegrationCreateUpdateEvent;
eventHandlers.integrationUpdate?.({
...rest,
guildID,
subscriberCount,
enableEmoticons,
expireGracePeriod,
roleID,
expireBehavior,
syncedAt,
});
}