oceanic.js 1.0.0-dev.92e6f50 → 1.0.0-dev.971dfd7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/dev-publish.yml +6 -4
- package/.github/workflows/docs.yml +2 -6
- package/.github/workflows/should-publish-dev.yml +29 -0
- package/dist/lib/Client.d.ts +2 -2
- package/dist/lib/Client.js +3 -2
- package/dist/lib/Constants.js +2 -1
- package/dist/lib/gateway/GatewayError.d.ts +2 -0
- package/dist/lib/gateway/GatewayError.js +3 -1
- package/dist/lib/gateway/Shard.d.ts +1 -1
- package/dist/lib/gateway/Shard.js +22 -9
- package/dist/lib/gateway/ShardManager.d.ts +2 -0
- package/dist/lib/gateway/ShardManager.js +3 -1
- package/dist/lib/rest/Bucket.d.ts +1 -0
- package/dist/lib/rest/Bucket.js +2 -1
- package/dist/lib/rest/DiscordHTTPError.d.ts +2 -0
- package/dist/lib/rest/DiscordHTTPError.js +2 -1
- package/dist/lib/rest/DiscordRESTError.d.ts +2 -0
- package/dist/lib/rest/DiscordRESTError.js +2 -1
- package/dist/lib/rest/RESTManager.d.ts +6 -2
- package/dist/lib/rest/RESTManager.js +10 -8
- package/dist/lib/rest/RequestHandler.d.ts +1 -0
- package/dist/lib/rest/RequestHandler.js +2 -1
- package/dist/lib/rest/SequentialBucket.d.ts +1 -0
- package/dist/lib/rest/SequentialBucket.js +2 -1
- package/dist/lib/routes/ApplicationCommands.d.ts +1 -0
- package/dist/lib/routes/ApplicationCommands.js +3 -1
- package/dist/lib/routes/Channels.d.ts +9 -7
- package/dist/lib/routes/Channels.js +30 -6
- package/dist/lib/routes/Guilds.d.ts +4 -1
- package/dist/lib/routes/Guilds.js +45 -20
- package/dist/lib/routes/Interactions.d.ts +2 -0
- package/dist/lib/routes/Interactions.js +2 -1
- package/dist/lib/routes/OAuth.d.ts +2 -0
- package/dist/lib/routes/OAuth.js +2 -1
- package/dist/lib/routes/Users.d.ts +2 -0
- package/dist/lib/routes/Users.js +2 -1
- package/dist/lib/routes/Webhooks.d.ts +2 -0
- package/dist/lib/routes/Webhooks.js +2 -1
- package/dist/lib/structures/AnnouncementChannel.d.ts +4 -3
- package/dist/lib/structures/AnnouncementChannel.js +4 -3
- package/dist/lib/structures/AnnouncementThreadChannel.d.ts +2 -1
- package/dist/lib/structures/AnnouncementThreadChannel.js +3 -2
- package/dist/lib/structures/Application.d.ts +1 -0
- package/dist/lib/structures/Application.js +1 -1
- package/dist/lib/structures/ApplicationCommand.d.ts +2 -0
- package/dist/lib/structures/ApplicationCommand.js +3 -1
- package/dist/lib/structures/Attachment.d.ts +1 -0
- package/dist/lib/structures/Attachment.js +2 -1
- package/dist/lib/structures/AuditLogEntry.d.ts +1 -0
- package/dist/lib/structures/AuditLogEntry.js +2 -1
- package/dist/lib/structures/AutoModerationRule.d.ts +1 -0
- package/dist/lib/structures/AutoModerationRule.js +2 -1
- package/dist/lib/structures/AutocompleteInteraction.d.ts +2 -0
- package/dist/lib/structures/AutocompleteInteraction.js +3 -1
- package/dist/lib/structures/Base.d.ts +1 -0
- package/dist/lib/structures/Base.js +7 -6
- package/dist/lib/structures/CategoryChannel.d.ts +1 -0
- package/dist/lib/structures/CategoryChannel.js +2 -1
- package/dist/lib/structures/Channel.d.ts +1 -0
- package/dist/lib/structures/Channel.js +2 -1
- package/dist/lib/structures/ClientApplication.d.ts +1 -0
- package/dist/lib/structures/ClientApplication.js +2 -1
- package/dist/lib/structures/CommandInteraction.d.ts +2 -0
- package/dist/lib/structures/CommandInteraction.js +3 -1
- package/dist/lib/structures/ComponentInteraction.d.ts +3 -1
- package/dist/lib/structures/ComponentInteraction.js +4 -2
- package/dist/lib/structures/ExtendedUser.d.ts +2 -1
- package/dist/lib/structures/ExtendedUser.js +3 -2
- package/dist/lib/structures/ForumChannel.d.ts +1 -0
- package/dist/lib/structures/ForumChannel.js +2 -1
- package/dist/lib/structures/GroupChannel.d.ts +4 -3
- package/dist/lib/structures/GroupChannel.js +2 -1
- package/dist/lib/structures/Guild.d.ts +4 -5
- package/dist/lib/structures/Guild.js +3 -2
- package/dist/lib/structures/GuildChannel.d.ts +1 -0
- package/dist/lib/structures/GuildChannel.js +2 -1
- package/dist/lib/structures/GuildPreview.d.ts +2 -1
- package/dist/lib/structures/GuildPreview.js +3 -2
- package/dist/lib/structures/GuildScheduledEvent.d.ts +2 -0
- package/dist/lib/structures/GuildScheduledEvent.js +3 -1
- package/dist/lib/structures/GuildTemplate.d.ts +2 -0
- package/dist/lib/structures/GuildTemplate.js +8 -7
- package/dist/lib/structures/Integration.d.ts +12 -3
- package/dist/lib/structures/Integration.js +15 -4
- package/dist/lib/structures/Interaction.d.ts +2 -0
- package/dist/lib/structures/Interaction.js +3 -1
- package/dist/lib/structures/Invite.d.ts +4 -3
- package/dist/lib/structures/Invite.js +26 -23
- package/dist/lib/structures/Member.d.ts +1 -0
- package/dist/lib/structures/Member.js +2 -1
- package/dist/lib/structures/Message.d.ts +2 -0
- package/dist/lib/structures/Message.js +3 -1
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +2 -0
- package/dist/lib/structures/ModalSubmitInteraction.js +3 -1
- package/dist/lib/structures/PartialApplication.d.ts +2 -0
- package/dist/lib/structures/PartialApplication.js +3 -1
- package/dist/lib/structures/Permission.d.ts +2 -0
- package/dist/lib/structures/Permission.js +8 -6
- package/dist/lib/structures/PermissionOverwrite.d.ts +2 -0
- package/dist/lib/structures/PermissionOverwrite.js +3 -1
- package/dist/lib/structures/PingInteraction.d.ts +1 -0
- package/dist/lib/structures/PingInteraction.js +2 -1
- package/dist/lib/structures/PrivateChannel.d.ts +1 -0
- package/dist/lib/structures/PrivateChannel.js +2 -1
- package/dist/lib/structures/PrivateThreadChannel.d.ts +2 -1
- package/dist/lib/structures/PrivateThreadChannel.js +3 -2
- package/dist/lib/structures/PublicThreadChannel.d.ts +2 -1
- package/dist/lib/structures/PublicThreadChannel.js +3 -2
- package/dist/lib/structures/Role.d.ts +1 -0
- package/dist/lib/structures/Role.js +2 -1
- package/dist/lib/structures/StageChannel.d.ts +4 -3
- package/dist/lib/structures/StageChannel.js +2 -1
- package/dist/lib/structures/StageInstance.d.ts +3 -1
- package/dist/lib/structures/StageInstance.js +3 -1
- package/dist/lib/structures/Team.d.ts +2 -0
- package/dist/lib/structures/Team.js +3 -1
- package/dist/lib/structures/TextChannel.d.ts +1 -0
- package/dist/lib/structures/TextChannel.js +2 -1
- package/dist/lib/structures/TextableChannel.d.ts +2 -1
- package/dist/lib/structures/TextableChannel.js +3 -2
- package/dist/lib/structures/ThreadChannel.d.ts +1 -0
- package/dist/lib/structures/ThreadChannel.js +2 -1
- package/dist/lib/structures/UnavailableGuild.d.ts +1 -0
- package/dist/lib/structures/UnavailableGuild.js +2 -1
- package/dist/lib/structures/User.d.ts +1 -0
- package/dist/lib/structures/User.js +2 -1
- package/dist/lib/structures/VoiceChannel.d.ts +2 -1
- package/dist/lib/structures/VoiceChannel.js +2 -1
- package/dist/lib/structures/VoiceState.d.ts +1 -0
- package/dist/lib/structures/VoiceState.js +2 -1
- package/dist/lib/structures/Webhook.d.ts +2 -0
- package/dist/lib/structures/Webhook.js +3 -1
- package/dist/lib/types/application-commands.d.ts +1 -0
- package/dist/lib/types/audit-log.d.ts +1 -0
- package/dist/lib/types/auto-moderation.d.ts +1 -0
- package/dist/lib/types/channels.d.ts +4 -0
- package/dist/lib/types/client.d.ts +1 -7
- package/dist/lib/types/events.d.ts +1 -3
- package/dist/lib/types/gateway-raw.d.ts +2 -1
- package/dist/lib/types/gateway.d.ts +1 -0
- package/dist/lib/types/guild-template.d.ts +1 -0
- package/dist/lib/types/guilds.d.ts +14 -2
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/interactions.d.ts +1 -0
- package/dist/lib/types/json.d.ts +1 -0
- package/dist/lib/types/oauth.d.ts +1 -0
- package/dist/lib/types/request-handler.d.ts +1 -0
- package/dist/lib/types/scheduled-events.d.ts +1 -0
- package/dist/lib/types/shared.d.ts +2 -2
- package/dist/lib/types/users.d.ts +1 -0
- package/dist/lib/types/voice.d.ts +20 -0
- package/dist/lib/types/webhooks.d.ts +1 -0
- package/dist/lib/util/Collection.d.ts +1 -0
- package/dist/lib/util/Collection.js +2 -1
- package/dist/lib/util/InteractionOptionsWrapper.d.ts +7 -0
- package/dist/lib/util/InteractionOptionsWrapper.js +22 -1
- package/dist/lib/util/Routes.d.ts +1 -0
- package/dist/lib/util/Routes.js +2 -1
- package/dist/lib/util/TypedCollection.d.ts +1 -0
- package/dist/lib/util/TypedCollection.js +2 -1
- package/dist/lib/util/TypedEmitter.d.ts +1 -0
- package/dist/lib/util/TypedEmitter.js +2 -1
- package/dist/lib/util/Util.js +2 -1
- package/dist/package.json +3 -2
- package/examples/applicationCommand.js +9 -9
- package/examples/audio.mp3 +0 -0
- package/examples/components.js +7 -7
- package/examples/embeds.js +10 -10
- package/examples/intents.js +4 -4
- package/examples/interactions.js +171 -0
- package/examples/voice.js +47 -0
- package/package.json +3 -2
- package/build.js +0 -6
- package/dist/lib/types/discordjs-voice.d.ts +0 -18
- package/dist/lib/types/stage-instances.d.ts +0 -12
- package/dist/lib/util/Properties.d.ts +0 -9
- package/dist/lib/util/Properties.js +0 -27
- package/doc-test.js +0 -39
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
const { Client, InteractionTypes, MessageFlags, ComponentTypes, ApplicationCommandTypes } = require("oceanic.js");
|
|
2
|
+
|
|
3
|
+
const client = new Client({
|
|
4
|
+
auth: "Bot [TOKEN]",
|
|
5
|
+
gateway: {
|
|
6
|
+
intents: 0 // No intents are needed if you are only using interactions
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
client.on("ready", async() => {
|
|
12
|
+
console.log("Ready as", client.user.tag);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
client.on("interactionCreate", async(interaction) => {
|
|
16
|
+
switch(interaction.type) {
|
|
17
|
+
// https://oceanic.owo-whats-this.dev/latest/classes/CommandInteraction.CommandInteraction.html
|
|
18
|
+
case InteractionTypes.APPLICATION_COMMAND: {
|
|
19
|
+
// defer interactions as soon as possible, you have three seconds to send any initial response
|
|
20
|
+
// if you wait too long, the interaction may be invalidated
|
|
21
|
+
await interaction.defer();
|
|
22
|
+
// If you want the response to be ephemeral, you can provide the flag to the defer function, like so:
|
|
23
|
+
// await interaction.defer(MessageFlags.EPHEMERAL);
|
|
24
|
+
|
|
25
|
+
// data = https://oceanic.owo-whats-this.dev/latest/interfaces/Types_Interactions.ApplicationCommandInteractionData.html
|
|
26
|
+
switch(interaction.data.type) {
|
|
27
|
+
// Chat Input commands are what you use in the chat, i.e. slash commands
|
|
28
|
+
case ApplicationCommandTypes.CHAT_INPUT: {
|
|
29
|
+
if(interaction.data.name === "greet") {
|
|
30
|
+
// assume we have two options, user (called user) then string (called greeting) - first is required, second is not
|
|
31
|
+
|
|
32
|
+
// Get an option named `user` with the type USER - https://oceanic.owo-whats-this.dev/dev/classes/InteractionOptionsWrapper.InteractionOptionsWrapper.html#getUser
|
|
33
|
+
// Setting the second parameter to true will throw an error if the option is not present
|
|
34
|
+
const user = interaction.data.options.getUser("user", true);
|
|
35
|
+
const greeting = interaction.data.options.getString("greeting", false) || "Hello, ";
|
|
36
|
+
|
|
37
|
+
// since we've already deferred the interaction, we cannot use createMessage (this is an initial response)
|
|
38
|
+
// we can only have one initial response, so we use createFollowup
|
|
39
|
+
await interaction.createFollowup({
|
|
40
|
+
content: `${greeting} ${user.mention}!`,
|
|
41
|
+
allowedMentions: {
|
|
42
|
+
users: [user.id]
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Chat Input application command interactions also have a set of resolved data, which is structured as so:
|
|
48
|
+
// https://oceanic.owo-whats-this.dev/latest/interfaces/Types_Interactions.ApplicationCommandInteractionResolvedData.html
|
|
49
|
+
// the options wrapper pulls values out of resolved automatically, if you use the right method
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// User application commands are shown in the context menu when right clicking on users
|
|
54
|
+
// `data` will have a target (and targetID) property with the user that the command was executed on
|
|
55
|
+
// These don't have options
|
|
56
|
+
case ApplicationCommandTypes.USER: {
|
|
57
|
+
if(interaction.data.name === "ping") {
|
|
58
|
+
await interaction.createFollowup({
|
|
59
|
+
content: `Pong! ${interaction.data.target.mention}`,
|
|
60
|
+
allowedMentions: {
|
|
61
|
+
users: [interaction.data.target.id]
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Message application commands are shown in the context menu when right clicking on essages
|
|
69
|
+
// `data` will have a target (and targetID) property with the message that the command was executed on
|
|
70
|
+
// Same as user commands, these don't have options
|
|
71
|
+
case ApplicationCommandTypes.MESSAGE: {
|
|
72
|
+
if(interaction.data.name === "author") {
|
|
73
|
+
await interaction.createFollowup({
|
|
74
|
+
content: `${interaction.data.target.author.mention} is the author of that message!`,
|
|
75
|
+
allowedMentions: {
|
|
76
|
+
users: [interaction.data.target.author.id]
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// https://oceanic.owo-whats-this.dev/latest/classes/ComponentInteraction.ComponentInteraction.html
|
|
87
|
+
case InteractionTypes.MESSAGE_COMPONENT: {
|
|
88
|
+
// same spiel as above
|
|
89
|
+
await interaction.defer();
|
|
90
|
+
// when you create a message with components, this will correspond with what you provided as the customID there
|
|
91
|
+
if(interaction.data.componentType === ComponentTypes.BUTTON) {
|
|
92
|
+
if(interaction.data.customID === "edit-message") {
|
|
93
|
+
// Edits the original message. This has an initial response variant: editParent
|
|
94
|
+
await interaction.editOriginal({
|
|
95
|
+
content: `This message was edited by ${interaction.user.mention}!`,
|
|
96
|
+
allowedMentions: {
|
|
97
|
+
users: [interaction.user.id]
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
} else if(interaction.data.customID === "my-amazing-button") {
|
|
101
|
+
await interaction.createFollowup({
|
|
102
|
+
content: "You clicked an amazing button!"
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
} else if(interaction.data.componentType === ComponentTypes.SELECT_MENU) {
|
|
106
|
+
// The `values` property under data contains all of the selected values
|
|
107
|
+
await interaction.createFollowup({
|
|
108
|
+
content: `You selected: **${interaction.data.values.join("**, **")}**`
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// https://oceanic.owo-whats-this.dev/latest/classes/AutocompleteInteraction.AutocompleteInteraction.html
|
|
115
|
+
case InteractionTypes.APPLICATION_COMMAND_AUTOCOMPLETE: {
|
|
116
|
+
// Autocomplete Interactions cannot be deferred
|
|
117
|
+
switch(interaction.data.name) {
|
|
118
|
+
case "test-autocomplete": {
|
|
119
|
+
// Autocomplete interactions data has a partial `options` property, which is the tree of options that are currently being filled in
|
|
120
|
+
// along with one at the end, which will have focused
|
|
121
|
+
// Setting the first parameter to true will throw an error if no focused option is present
|
|
122
|
+
const option = interaction.data.options.getFocused(true);
|
|
123
|
+
switch(option.name) {
|
|
124
|
+
case "test-option": {
|
|
125
|
+
return interaction.result([
|
|
126
|
+
{
|
|
127
|
+
name: "Choice 1",
|
|
128
|
+
nameLocalizations: {
|
|
129
|
+
"es-ES": "Opción 1"
|
|
130
|
+
},
|
|
131
|
+
value: "choice-1"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "Choice 2",
|
|
135
|
+
nameLocalizations: {
|
|
136
|
+
"es-ES": "Opción 2"
|
|
137
|
+
},
|
|
138
|
+
value: "choice-2"
|
|
139
|
+
}
|
|
140
|
+
]);
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// https://oceanic.owo-whats-this.dev/latest/classes/ModalSubmitInteraction.ModalSubmitInteraction.html
|
|
150
|
+
case InteractionTypes.MODAL_SUBMIT: {
|
|
151
|
+
// this will correspond with the customID you provided when creating the modal
|
|
152
|
+
switch(interaction.data.customID) {
|
|
153
|
+
case "test-modal": {
|
|
154
|
+
// the `components` property under data contains all of the components that were submitted
|
|
155
|
+
// https://oceanic.owo-whats-this.dev/latest/interfaces/Types_Channels.ModalActionRow.html
|
|
156
|
+
console.log(interaction.data.components);
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// An error handler
|
|
166
|
+
client.on("error", (error) => {
|
|
167
|
+
console.error("Something went wrong:", error);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// Connect to Discord
|
|
171
|
+
client.connect();
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const { Client } = require("oceanic.js");
|
|
2
|
+
const { VoiceConnectionStatus, AudioPlayerStatus, createAudioPlayer, createAudioResource } = require("@discordjs/voice");
|
|
3
|
+
|
|
4
|
+
const client = new Client({
|
|
5
|
+
auth: "Bot [TOKEN]",
|
|
6
|
+
gateway: {
|
|
7
|
+
intents: ["GUILDS", "GUILD_VOICE_STATES"] // Voice connections require the GUILDS intent; We specify the GUILD_VOICE_STATES intent to reconnect to the voice channel in case we get disconnected
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
client.on("ready", () => {
|
|
12
|
+
console.log("Ready as", client.user.tag);
|
|
13
|
+
|
|
14
|
+
const guild = client.guilds.get("1005489770278953112"); // We need the guild to get the voiceAdapterCreator
|
|
15
|
+
|
|
16
|
+
const voiceConnection = client.joinVoiceChannel({
|
|
17
|
+
channelID: "1005489770849382443", // The ID of the channel to connect to
|
|
18
|
+
guildID: "1005489770278953112", // The ID of the guild the channel belongs to
|
|
19
|
+
selfDeaf: true, // Whether our client joins defeaned
|
|
20
|
+
selfMute: false, // Whether our client joins muted
|
|
21
|
+
voiceAdapterCreator: guild.voiceAdapterCreator // The voiceAdapterCreator the guild provides
|
|
22
|
+
})
|
|
23
|
+
voiceConnection.on(VoiceConnectionStatus.Disconnected, () => {
|
|
24
|
+
voiceConnection.rejoin(); // In case we get disconnected, rejoin
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const player = createAudioPlayer(); // Create the player we will use to play audio
|
|
28
|
+
voiceConnection.subscribe(player); // Subscribe the player to the voice connection to the channel we have
|
|
29
|
+
|
|
30
|
+
player.on(AudioPlayerStatus.Playing, () => {
|
|
31
|
+
console.log("Audio started playing");
|
|
32
|
+
});
|
|
33
|
+
player.on(AudioPlayerStatus.Idle, () => {
|
|
34
|
+
console.log("The player is not playing any audio");
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const audio = createAudioResource(`${__dirname}/audio.mp3`); // Create the audio resource from the mp3 we have to play through the player
|
|
38
|
+
player.play(audio); // Play the audio
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// An error handler
|
|
42
|
+
client.on("error", (error) => {
|
|
43
|
+
console.error("Something went wrong:", error);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Connect to Discord
|
|
47
|
+
client.connect();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oceanic.js",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.971dfd7",
|
|
4
4
|
"description": "A NodeJS library for interfacing with Discord.",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"types": "./dist/lib/index.d.ts",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"lint": "eslint lib --ext .ts",
|
|
17
17
|
"lint:fix": "eslint lib --ext .ts --fix",
|
|
18
|
-
"prepublishOnly": "node build"
|
|
18
|
+
"prepublishOnly": "node scripts/build",
|
|
19
|
+
"test:docs": "npm i --no-save --ignore-scripts typedoc typedoc-plugin-extras typedoc-plugin-rename-defaults && node scripts/doc-test.js && npx --yes typedoc"
|
|
19
20
|
},
|
|
20
21
|
"repository": {
|
|
21
22
|
"type": "git",
|
package/build.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const { execSync } = require("child_process");
|
|
2
|
-
const { rmSync, readFileSync, writeFileSync, existsSync, cpSync } = require("fs");
|
|
3
|
-
if(existsSync(`${__dirname}/dist`)) rmSync(`${__dirname}/dist`, { recursive: true });
|
|
4
|
-
execSync("tsc", { stdio: "inherit" });
|
|
5
|
-
writeFileSync(`${__dirname}/dist/lib/index.js`, readFileSync(`${__dirname}/dist/lib/index.js`).toString().replace(/__exportStar\(require\("\.\/types\/index"\), exports\);\r?\n/, ""))
|
|
6
|
-
cpSync(`${__dirname}/lib/types`, `${__dirname}/dist/lib/types`, { recursive: true });
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
-
// @ts-ignore
|
|
3
|
-
import { DiscordGatewayAdapterCreator } from "@discordjs/voice";
|
|
4
|
-
|
|
5
|
-
export interface JoinVoiceChannelOptions {
|
|
6
|
-
/** The ID of the channel to join. */
|
|
7
|
-
channelID: string;
|
|
8
|
-
/** Whether debug messages are enabled. Defaults to false. */
|
|
9
|
-
debug?: boolean;
|
|
10
|
-
/** The ID of the guild the channel to join belongs to. */
|
|
11
|
-
guildID: string;
|
|
12
|
-
/** Whether to join the channel deafened. Defaults to true. */
|
|
13
|
-
selfDeaf?: boolean;
|
|
14
|
-
/** Whether to join the channel muted. Defaults to true. */
|
|
15
|
-
selfMute?: boolean;
|
|
16
|
-
/** The voice adapter creator for this voice connection. Use the \<Guild\>.voiceAdapterCreator property for this. */
|
|
17
|
-
voiceAdapterCreator: DiscordGatewayAdapterCreator;
|
|
18
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { StageInstancePrivacyLevels } from "../Constants";
|
|
2
|
-
|
|
3
|
-
export interface RawStageInstance {
|
|
4
|
-
channel_id: string;
|
|
5
|
-
/** @deprecated */
|
|
6
|
-
discoverable_disabled: boolean;
|
|
7
|
-
guild_id: string;
|
|
8
|
-
guild_scheduled_event_id?: string;
|
|
9
|
-
id: string;
|
|
10
|
-
privacy_level: StageInstancePrivacyLevels;
|
|
11
|
-
topic: string;
|
|
12
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export default class Properties<C = unknown> {
|
|
2
|
-
#private;
|
|
3
|
-
constructor(obj: unknown);
|
|
4
|
-
static define<T, K extends keyof T>(obj: T, property: K, value: T[K], writable?: boolean, configurable?: boolean, enumerable?: boolean): Properties<T>;
|
|
5
|
-
static looseDefine<T>(obj: T, property: string, value: unknown, writable?: boolean, configurable?: boolean, enumerable?: boolean): Properties<T>;
|
|
6
|
-
static new<T>(obj: T): Properties<T>;
|
|
7
|
-
define<K extends keyof C>(property: K, value: C[K], writable?: boolean, configurable?: boolean, enumerable?: boolean): this;
|
|
8
|
-
looseDefine(property: string, value: unknown, writable?: boolean, configurable?: boolean, enumerable?: boolean): this;
|
|
9
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class Properties {
|
|
4
|
-
#object;
|
|
5
|
-
constructor(obj) {
|
|
6
|
-
this.#object = obj;
|
|
7
|
-
}
|
|
8
|
-
static define(obj, property, value, writable = false, configurable = false, enumerable = false) {
|
|
9
|
-
return new Properties(obj).define(property, value, writable, configurable, enumerable);
|
|
10
|
-
}
|
|
11
|
-
static looseDefine(obj, property, value, writable = false, configurable = false, enumerable = false) {
|
|
12
|
-
return new Properties(obj).looseDefine(property, value, writable, configurable, enumerable);
|
|
13
|
-
}
|
|
14
|
-
static new(obj) {
|
|
15
|
-
return new Properties(obj);
|
|
16
|
-
}
|
|
17
|
-
define(property, value, writable = false, configurable = false, enumerable = false) {
|
|
18
|
-
Object.defineProperty(this.#object, property, { value, writable, configurable, enumerable });
|
|
19
|
-
return this;
|
|
20
|
-
}
|
|
21
|
-
looseDefine(property, value, writable = false, configurable = false, enumerable = false) {
|
|
22
|
-
Object.defineProperty(this.#object, property, { value, writable, configurable, enumerable });
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.default = Properties;
|
|
27
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUHJvcGVydGllcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi91dGlsL1Byb3BlcnRpZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFxQixVQUFVO0lBQzNCLE9BQU8sQ0FBVTtJQUNqQixZQUFZLEdBQVk7UUFDcEIsSUFBSSxDQUFDLE9BQU8sR0FBRyxHQUFHLENBQUM7SUFDdkIsQ0FBQztJQUVELE1BQU0sQ0FBQyxNQUFNLENBQXVCLEdBQU0sRUFBRSxRQUFXLEVBQUUsS0FBVyxFQUFFLFFBQVEsR0FBRyxLQUFLLEVBQUUsWUFBWSxHQUFHLEtBQUssRUFBRSxVQUFVLEdBQUcsS0FBSztRQUM1SCxPQUFPLElBQUksVUFBVSxDQUFJLEdBQUcsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxRQUFRLEVBQUUsS0FBSyxFQUFFLFFBQVEsRUFBRSxZQUFZLEVBQUUsVUFBVSxDQUFDLENBQUM7SUFDOUYsQ0FBQztJQUVELE1BQU0sQ0FBQyxXQUFXLENBQUksR0FBTSxFQUFFLFFBQWdCLEVBQUUsS0FBYyxFQUFFLFFBQVEsR0FBRyxLQUFLLEVBQUUsWUFBWSxHQUFHLEtBQUssRUFBRSxVQUFVLEdBQU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n\
|
|
4
|
-
const { JSX } = require(\"typedoc\");\n\
|
|
5
|
-
\n\
|
|
6
|
-
// https://github.com/TypeStrong/typedoc/issues/1840#issuecomment-1012736455\n\
|
|
7
|
-
exports.load = function load(app) {\n\
|
|
8
|
-
app.renderer.hooks.on(\"head.begin\", () => {\n\
|
|
9
|
-
return JSX.createElement(\"script\", null,\n\
|
|
10
|
-
JSX.createElement(JSX.Raw, { html: \"localStorage.setItem('tsd-theme', localStorage.getItem('tsd-theme') || 'dark')\" }));\n\
|
|
11
|
-
});\n\
|
|
12
|
-
}");
|
|
13
|
-
// note for anyone changing this, this does not effect the docs on https://oceanic.owo-whats-thos.dev
|
|
14
|
-
// this only effects the test workflow - let Donovan know if something needs to change here
|
|
15
|
-
writeFileSync(`${__dirname}/typedoc.json`, JSON.stringify({
|
|
16
|
-
name: "Oceanic",
|
|
17
|
-
entryPoints: [
|
|
18
|
-
"lib/"
|
|
19
|
-
],
|
|
20
|
-
plugin: [
|
|
21
|
-
"typedoc-plugin-rename-defaults",
|
|
22
|
-
"typedoc-plugin-extras",
|
|
23
|
-
`${__dirname}/dark.js`
|
|
24
|
-
],
|
|
25
|
-
tsconfig: "tsconfig.json",
|
|
26
|
-
entryPointStrategy: "expand",
|
|
27
|
-
excludePrivate: true,
|
|
28
|
-
excludeProtected: true,
|
|
29
|
-
githubPages: false,
|
|
30
|
-
hideGenerator: true,
|
|
31
|
-
gitRemote: "origin",
|
|
32
|
-
readme: "README.md",
|
|
33
|
-
out: "docs",
|
|
34
|
-
exclude: [
|
|
35
|
-
"lib/util/Properties.ts"
|
|
36
|
-
],
|
|
37
|
-
favicon: "favicon.ico"
|
|
38
|
-
}));
|
|
39
|
-
writeFileSync(`${__dirname}/favicon.ico`, Buffer.from("AAABAAEAIBUAAAEAIAD8CgAAFgAAACgAAAAgAAAAKgAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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