Skip to content

Commit

Permalink
change how everything is exported
Browse files Browse the repository at this point in the history
  • Loading branch information
Starman3787 committed Jul 14, 2024
1 parent c81d2bd commit 88d673f
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/structures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
output="$output $(basename $file .js.json): require('./structures/compiled/$(basename $file)'),"
done
output="$output };"
echo $output > ./src/structures.js
echo $output > ./src/compiledStructures.js
- name: Import bot's GPG key for signing commits
id: import-gpg
Expand Down
105 changes: 1 addition & 104 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,104 +1 @@
const Client = require("./src/Client");
const ActionRow = require("./src/util/actionRowBuilder");
const Button = require("./src/util/buttonBuilder");
const TextInput = require("./src/util/textInputBuilder");
const Dropdown = require("./src/util/dropdownBuilder");
const DropdownOption = require("./src/util/dropdownOption");
const Embed = require("./src/util/embedBuilder");
const MessageComponents = require("./src/util/messageComponents");
const Attachment = require("./src/structures/Attachment");
const AuditLog = require("./src/structures/AuditLog");
const ButtonClick = require("./src/structures/ButtonClick");
const Channel = require("./src/structures/Channel");
const Guild = require("./src/structures/Guild");
const Interaction = require("./src/structures/Interaction");
const Member = require("./src/structures/Member");
const Message = require("./src/structures/Message");
const OptionSelect = require("./src/structures/OptionSelect");
const Role = require("./src/structures/Role");
const SlashCommand = require("./src/structures/SlashCommand");
const TextChannel = require("./src/structures/TextChannel");
const Thread = require("./src/structures/Thread");
const User = require("./src/structures/User");
const VoiceChannel = require("./src/structures/VoiceChannel");
const VoiceState = require("./src/structures/VoiceState");
const Command = require("./src/util/commandBuilder");
const CommandOption = require("./src/util/commandOptionBuilder");
const CommandChoice = require("./src/util/commandChoiceBuilder");
const {
PERMISSIONS,
INTENTS,
COMPONENT_TYPES,
CHANNEL_TYPES,
AUTO_MODERATION_TRIGGER_TYPES,
AUTO_MODERATION_EVENT_TYPES,
AUTO_MODERATION_KEYWORD_PRESET_TYPES,
AUTO_MODERATION_ACTION_TYPES,
LIMITS,
} = require("./src/constants");
const getTimestamp = require("./src/util/getTimestampFromSnowflake");
const checkPermission = require("./src/util/checkPermission");
const hexToInt = require("./src/util/hexToInt");
const verifyMessageLink = require("./src/util/verifyMessageLink");
const updateGuildPreferences = require("./src/util/updateGuildPreferences");
const getAvatarUrl = require("./src/util/getAvatarUrl");
const Invite = require("./src/structures/Invite");
const encryptText = require("./src/util/encryptText");
const decryptText = require("./src/util/decryptText");
const getGuildIcon = require("./src/util/getGuildIcon");
const getRoleIcon = require("./src/util/getRoleIcon");
const getMemberAvatar = require("./src/util/getMemberAvatar");
const getEventImage = require("./src/util/getEventImage");

module.exports = {
Client,
ActionRow,
Button,
TextInput,
Dropdown,
DropdownOption,
Embed,
MessageComponents,
Attachment,
AuditLog,
ButtonClick,
Channel,
Guild,
Interaction,
Member,
Message,
OptionSelect,
Role,
SlashCommand,
TextChannel,
Thread,
User,
VoiceChannel,
VoiceState,
Command,
CommandOption,
CommandChoice,
Invite,
getTimestampFromSnowflake: getTimestamp,
checkPermission,
PERMISSIONS,
INTENTS,
VERSION: require("./package.json").version,
COMPONENT_TYPES,
CHANNEL_TYPES,
AUTO_MODERATION_TRIGGER_TYPES,
AUTO_MODERATION_EVENT_TYPES,
AUTO_MODERATION_KEYWORD_PRESET_TYPES,
AUTO_MODERATION_ACTION_TYPES,
LIMITS,
hexToInt,
verifyMessageLink,
updateGuildPreferences,
getAvatarUrl,
encryptText,
decryptText,
getGuildIcon,
getRoleIcon,
getMemberAvatar,
getEventImage,
};
module.exports = require("./src/Client");
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
"./constants": {
"default": "./src/constants.js"
},
"./util": {
"default": "./src/util.js"
},
"./structures": {
"default": "./src/structures.js"
},
"./structures/compiled": {
"default": "./src/compiledStructures.js"
}
},
"scripts": {
Expand Down
Empty file added src/compiledStructures.js
Empty file.
48 changes: 47 additions & 1 deletion src/structures.js
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
module.exports = { Message: require('./structures/compiled/Message.js.json'), ScheduledEvent: require('./structures/compiled/ScheduledEvent.js.json'), TextChannel: require('./structures/compiled/TextChannel.js.json'), Member: require('./structures/compiled/Member.js.json'), ModalResponse: require('./structures/compiled/ModalResponse.js.json'), Role: require('./structures/compiled/Role.js.json'), Emoji: require('./structures/compiled/Emoji.js.json'), Attachment: require('./structures/compiled/Attachment.js.json'), User: require('./structures/compiled/User.js.json'), Thread: require('./structures/compiled/Thread.js.json'), Channel: require('./structures/compiled/Channel.js.json'), ButtonClick: require('./structures/compiled/ButtonClick.js.json'), Reaction: require('./structures/compiled/Reaction.js.json'), Interaction: require('./structures/compiled/Interaction.js.json'), AuditLog: require('./structures/compiled/AuditLog.js.json'), Invite: require('./structures/compiled/Invite.js.json'), VoiceState: require('./structures/compiled/VoiceState.js.json'), SlashCommand: require('./structures/compiled/SlashCommand.js.json'), Guild: require('./structures/compiled/Guild.js.json'), Sticker: require('./structures/compiled/Sticker.js.json'), OptionSelect: require('./structures/compiled/OptionSelect.js.json'), VoiceChannel: require('./structures/compiled/VoiceChannel.js.json'), };
const Attachment = require("./structures/Attachment");
const AuditLog = require("./structures/AuditLog");
const ButtonClick = require("./structures/ButtonClick");
const Channel = require("./structures/Channel");
const Emoji = require("./structures/Emoji");
const Guild = require("./structures/Guild");
const Interaction = require("./structures/Interaction");
const Invite = require("./structures/Invite");
const Member = require("./structures/Member");
const Message = require("./structures/Message");
const ModalResponse = require("./structures/ModalResponse");
const OptionSelect = require("./structures/OptionSelect");
const Reaction = require("./structures/Reaction");
const Role = require("./structures/Role");
const ScheduledEvent = require("./structures/ScheduledEvent");
const SlashCommand = require("./structures/SlashCommand");
const Sticker = require("./structures/Sticker");
const TextChannel = require("./structures/TextChannel");
const Thread = require("./structures/Thread");
const User = require("./structures/User");
const VoiceChannel = require("./structures/VoiceChannel");
const VoiceState = require("./structures/VoiceState");

module.exports = {
Attachment,
AuditLog,
ButtonClick,
Channel,
Emoji,
Guild,
Interaction,
Invite,
Member,
Message,
ModalResponse,
OptionSelect,
Reaction,
Role,
ScheduledEvent,
SlashCommand,
Sticker,
TextChannel,
Thread,
User,
VoiceChannel,
VoiceState
};
61 changes: 61 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
const ActionRow = require("./util/actionRowBuilder");
const Button = require("./util/buttonBuilder");
const checkMemberPermissions = require("./util/checkMemberPermissions");
const checkPermission = require("./util/checkPermission");
const Command = require("./util/commandBuilder");
const CommandChoice = require("./util/commandChoiceBuilder");
const CommandOption = require("./util/commandOptionBuilder");
const decryptMessage = require("./util/decryptMessage");
const decryptText = require("./util/decryptText");
const deepCompare = require("./util/deepCompare");
const Dropdown = require("./util/dropdownBuilder");
const DropdownOption = require("./util/dropdownOption");
const Embed = require("./util/embedBuilder");
const encryptMessage = require("./util/encryptMessage");
const encryptText = require("./util/encryptText");
const getAvatarUrl = require("./util/getAvatarUrl");
const getEventImage = require("./util/getEventImage");
const getGuildIcon = require("./util/getGuildIcon");
const getMember = require("./util/getMember");
const getMemberAvatar = require("./util/getMemberAvatar");
const getMessage = require("./util/getMessage");
const getRoleIcon = require("./util/getRoleIcon");
const getTimestamp = require("./util/getTimestampFromSnowflake");
const hexToInt = require("./util/hexToInt");
const MessageComponents = require("./util/messageComponents");
const resolveEmoji = require("./util/resolveEmoji");
const TextInput = require("./util/textInputBuilder");
const updatePreferences = require("./util/updateGuildPreferences");
const verifyMessageLink = require("./util/verifyMessageLink");

module.exports = {
ActionRow,
Button,
checkMemberPermissions,
checkPermission,
Command,
CommandChoice,
CommandOption,
decryptMessage,
decryptText,
deepCompare,
Dropdown,
DropdownOption,
Embed,
encryptMessage,
encryptText,
getAvatarUrl,
getEventImage,
getGuildIcon,
getMember,
getMemberAvatar,
getMessage,
getRoleIcon,
getTimestamp,
hexToInt,
MessageComponents,
resolveEmoji,
TextInput,
updatePreferences,
verifyMessageLink
};

0 comments on commit 88d673f

Please sign in to comment.