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
+269
View File
@@ -0,0 +1,269 @@
import {
channelOverwriteHasPermission,
createInvite,
deleteInvite,
deleteMessages,
editChannel,
followChannel,
getChannelInvites,
getChannelWebhooks,
getInvite,
getMessage,
getMessages,
getPins,
isChannelSynced,
sendMessage,
startTyping,
} from "./channel.ts";
import { getGatewayBot } from "./gateway.ts";
import {
ban,
categoryChildrenIDs,
createEmoji,
createGuild,
createGuildChannel,
createGuildFromTemplate,
createGuildTemplate,
createRole,
deleteChannel,
deleteChannelOverwrite,
deleteEmoji,
deleteGuildTemplate,
deleteIntegration,
deleteRole,
deleteServer,
editChannelOverwrite,
editEmoji,
editGuild,
editGuildTemplate,
editIntegration,
editRole,
editWidget,
emojiURL,
fetchMembers,
getAuditLogs,
getAvailableVoiceRegions,
getBan,
getBans,
getChannel,
getChannels,
getEmoji,
getEmojis,
getGuild,
getGuildPreview,
getGuildTemplate,
getGuildTemplates,
getIntegrations,
getInvites,
getMember,
getMembers,
getMembersByQuery,
getPruneCount,
getRoles,
getTemplate,
getUser,
getVanityURL,
getVoiceRegions,
getWebhooks,
getWidget,
getWidgetImageUrl,
getWidgetSettings,
guildBannerURL,
guildIconURL,
guildSplashURL,
leaveGuild,
pruneMembers,
swapChannels,
swapRoles,
syncGuildTemplate,
syncIntegration,
unban,
} from "./guild.ts";
import {
addRole,
avatarURL,
editBotNickname,
editBotProfile,
editMember,
kick,
kickFromVoiceChannel,
moveMember,
rawAvatarURL,
removeRole,
sendDirectMessage,
} from "./member.ts";
import {
addReaction,
addReactions,
deleteMessage,
deleteMessageByID,
editMessage,
getReactions,
pin,
publishMessage,
removeAllReactions,
removeReaction,
removeReactionEmoji,
removeUserReaction,
unpin,
} from "./message.ts";
import { getApplicationInformation } from "./oauth.ts";
import {
createSlashCommand,
createWebhook,
deleteSlashCommand,
deleteSlashResponse,
deleteWebhookMessage,
editSlashCommand,
editSlashResponse,
editWebhookMessage,
executeSlashCommand,
executeWebhook,
getSlashCommand,
getSlashCommands,
getWebhook,
upsertSlashCommand,
upsertSlashCommands,
} from "./webhook.ts";
export let helpers = {
// Channel handler
channelOverwriteHasPermission,
createInvite,
deleteMessages,
editChannel,
followChannel,
getChannelInvites,
getChannelWebhooks,
getMessage,
getMessages,
getPins,
isChannelSynced,
sendMessage,
getInvite,
deleteInvite,
startTyping,
// Gateway handler
getGatewayBot,
// Guild handler
ban,
categoryChildrenIDs,
createEmoji,
createGuildChannel,
createGuildFromTemplate,
createRole,
createGuildTemplate,
createGuild,
deleteChannel,
deleteEmoji,
deleteGuildTemplate,
deleteIntegration,
deleteRole,
deleteServer,
editWidget,
editEmoji,
editGuild,
editGuildTemplate,
editIntegration,
editRole,
emojiURL,
fetchMembers,
getAuditLogs,
getBan,
getBans,
getChannel,
getChannels,
getWidgetSettings,
getEmoji,
getEmojis,
getGuild,
getGuildPreview,
getGuildTemplate,
getGuildTemplates,
getAvailableVoiceRegions,
getIntegrations,
getInvites,
getMember,
getMembers,
getTemplate,
getMembersByQuery,
getPruneCount,
getRoles,
getUser,
getVanityURL,
getVoiceRegions,
getWebhooks,
getWidget,
getWidgetImageUrl,
guildBannerURL,
guildIconURL,
guildSplashURL,
leaveGuild,
pruneMembers,
swapChannels,
editChannelOverwrite,
deleteChannelOverwrite,
swapRoles,
syncGuildTemplate,
syncIntegration,
unban,
// Member handler
addRole,
avatarURL,
editBotProfile,
editBotNickname,
editMember,
kick,
moveMember,
rawAvatarURL,
removeRole,
sendDirectMessage,
kickFromVoiceChannel,
// Message handler
addReaction,
addReactions,
deleteMessage,
deleteMessageByID,
editMessage,
getReactions,
pin,
publishMessage,
removeAllReactions,
removeReaction,
removeReactionEmoji,
removeUserReaction,
unpin,
// Webhook handler
createWebhook,
executeWebhook,
getWebhook,
editWebhookMessage,
deleteWebhookMessage,
createSlashCommand,
getSlashCommand,
getSlashCommands,
upsertSlashCommand,
upsertSlashCommands,
editSlashCommand,
deleteSlashCommand,
executeSlashCommand,
deleteSlashResponse,
editSlashResponse,
// OAuth handler
getApplicationInformation,
};
export type Helpers = typeof helpers;
export function updateHelpers(newHelpers: Partial<Helpers>) {
helpers = {
...helpers,
...newHelpers,
};
}