nuxt-discord 0.0.17 → 0.2.0
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/README.md +249 -171
- package/dist/module.d.mts +146 -10
- package/dist/module.json +3 -3
- package/dist/module.mjs +1077 -348
- package/dist/runtime/acknowledgement.d.ts +11 -0
- package/dist/runtime/acknowledgement.js +156 -0
- package/dist/runtime/client/chat-theme.css +52 -0
- package/dist/runtime/client/components/ChatAvatar.d.vue.ts +6 -0
- package/dist/runtime/client/components/ChatAvatar.vue +11 -0
- package/dist/runtime/client/components/ChatAvatar.vue.d.ts +6 -0
- package/dist/runtime/client/components/CommandPicker.d.vue.ts +24 -0
- package/dist/runtime/client/components/CommandPicker.vue +67 -0
- package/dist/runtime/client/components/CommandPicker.vue.d.ts +24 -0
- package/dist/runtime/client/components/CommandReference.d.vue.ts +20 -0
- package/dist/runtime/client/components/CommandReference.vue +21 -0
- package/dist/runtime/client/components/CommandReference.vue.d.ts +20 -0
- package/dist/runtime/client/components/CommandTestBar.d.vue.ts +60 -0
- package/dist/runtime/client/components/CommandTestBar.vue +332 -0
- package/dist/runtime/client/components/CommandTestBar.vue.d.ts +60 -0
- package/dist/runtime/client/components/CommandTranscript.d.vue.ts +39 -0
- package/dist/runtime/client/components/CommandTranscript.vue +147 -0
- package/dist/runtime/client/components/CommandTranscript.vue.d.ts +39 -0
- package/dist/runtime/client/components/ProjectLogo.d.vue.ts +3 -0
- package/dist/runtime/client/components/ProjectLogo.vue +31 -0
- package/dist/runtime/client/components/ProjectLogo.vue.d.ts +3 -0
- package/dist/runtime/client/components/ReferenceContent.d.ts +26 -0
- package/dist/runtime/client/components/ReferenceContent.js +73 -0
- package/dist/runtime/client/components/TheHeader.d.vue.ts +3 -0
- package/dist/runtime/client/components/TheHeader.vue +53 -16
- package/dist/runtime/client/components/TheHeader.vue.d.ts +2 -2
- package/dist/runtime/client/components/appearance-select.d.ts +17 -0
- package/dist/runtime/client/components/appearance-select.js +15 -0
- package/dist/runtime/client/pages/activity.d.vue.ts +3 -0
- package/dist/runtime/client/pages/activity.vue +202 -0
- package/dist/runtime/client/pages/activity.vue.d.ts +3 -0
- package/dist/runtime/client/pages/context-menus.d.vue.ts +3 -0
- package/dist/runtime/client/pages/context-menus.vue +120 -0
- package/dist/runtime/client/pages/context-menus.vue.d.ts +3 -0
- package/dist/runtime/client/pages/listeners.d.vue.ts +3 -0
- package/dist/runtime/client/pages/listeners.vue +68 -0
- package/dist/runtime/client/pages/listeners.vue.d.ts +3 -0
- package/dist/runtime/client/pages/overview.d.vue.ts +3 -0
- package/dist/runtime/client/pages/overview.vue +280 -0
- package/dist/runtime/client/pages/overview.vue.d.ts +3 -0
- package/dist/runtime/client/pages/slash-commands.d.vue.ts +3 -0
- package/dist/runtime/client/pages/slash-commands.vue +185 -359
- package/dist/runtime/client/pages/slash-commands.vue.d.ts +2 -3
- package/dist/runtime/client/reference.css +46 -0
- package/dist/runtime/client/style.css +4 -1
- package/dist/runtime/client/useActivityLog.d.ts +7 -0
- package/dist/runtime/client/useActivityLog.js +76 -0
- package/dist/runtime/client/useCommandRegistry.d.ts +7 -0
- package/dist/runtime/client/useCommandRegistry.js +34 -0
- package/dist/runtime/client/useDashboardCatalog.d.ts +5 -0
- package/dist/runtime/client/useDashboardCatalog.js +9 -0
- package/dist/runtime/client/useDiscordCommandReference.d.ts +2 -0
- package/dist/runtime/client/useDiscordCommandReference.js +6 -0
- package/dist/runtime/dashboard/auth.d.ts +4 -0
- package/dist/runtime/dashboard/auth.js +55 -0
- package/dist/runtime/dashboard/oauth.d.ts +17 -0
- package/dist/runtime/dashboard/oauth.js +172 -0
- package/dist/runtime/dashboard/origin.d.ts +3 -0
- package/dist/runtime/dashboard/origin.js +15 -0
- package/dist/runtime/dashboard/permissions.d.ts +4 -0
- package/dist/runtime/dashboard/permissions.js +84 -0
- package/dist/runtime/dashboard/signin.d.ts +3 -0
- package/dist/runtime/dashboard/signin.js +42 -0
- package/dist/runtime/diagnostics.d.ts +4 -0
- package/dist/runtime/diagnostics.js +24 -0
- package/dist/runtime/discordInvocation.d.ts +14 -0
- package/dist/runtime/discordInvocation.js +28 -0
- package/dist/runtime/middleware.d.ts +1 -0
- package/dist/runtime/middleware.js +12 -0
- package/dist/runtime/reference/access.d.ts +6 -0
- package/dist/runtime/reference/access.js +143 -0
- package/dist/runtime/reference/catalog.d.ts +2 -0
- package/dist/runtime/reference/catalog.js +9 -0
- package/dist/runtime/reference/document.d.ts +2 -0
- package/dist/runtime/reference/document.js +22 -0
- package/dist/runtime/reference/hosted.d.ts +2 -0
- package/dist/runtime/reference/hosted.js +16 -0
- package/dist/runtime/reference/oauth.d.ts +2 -0
- package/dist/runtime/reference/oauth.js +4 -0
- package/dist/runtime/registration.d.ts +65 -0
- package/dist/runtime/registration.js +354 -0
- package/dist/runtime/server/api/discord/activity.get.d.ts +2 -0
- package/dist/runtime/server/api/discord/activity.get.js +6 -0
- package/dist/runtime/server/api/discord/catalog.get.d.ts +2 -0
- package/dist/runtime/server/api/discord/catalog.get.js +3 -0
- package/dist/runtime/server/api/discord/slash-command/autocomplete.post.d.ts +2 -0
- package/dist/runtime/server/api/discord/slash-command/autocomplete.post.js +14 -0
- package/dist/runtime/server/api/discord/slash-command/register.post.d.ts +1 -1
- package/dist/runtime/server/api/discord/slash-command/register.post.js +1 -1
- package/dist/runtime/server/api/discord/slash-command/remote-all.get.d.ts +1 -1
- package/dist/runtime/server/api/discord/slash-command/remote-diff.post.d.ts +1 -238
- package/dist/runtime/server/api/discord/slash-command/remote-diff.post.js +3 -1
- package/dist/runtime/server/api/discord/slash-command/test.post.d.ts +20 -0
- package/dist/runtime/server/api/discord/slash-command/test.post.js +19 -0
- package/dist/runtime/server/plugins/discord.js +95 -31
- package/dist/runtime/server/utils/client.d.ts +59 -246
- package/dist/runtime/server/utils/client.js +413 -451
- package/dist/runtime/server/utils/defineContextMenu.d.ts +49 -0
- package/dist/runtime/server/utils/defineContextMenu.js +12 -0
- package/dist/runtime/server/utils/defineListener.d.ts +24 -0
- package/dist/runtime/server/utils/defineListener.js +7 -0
- package/dist/runtime/server/utils/defineMiddleware.d.ts +29 -0
- package/dist/runtime/server/utils/defineMiddleware.js +24 -0
- package/dist/runtime/server/utils/describeCommand.d.ts +2 -0
- package/dist/runtime/server/utils/describeOption.d.ts +1 -1
- package/dist/runtime/server/utils/messageSender.d.ts +37 -0
- package/dist/runtime/server/utils/messageSender.js +149 -0
- package/dist/runtime/server/utils/middleware/cooldown.d.ts +1 -0
- package/dist/runtime/server/utils/middleware/cooldown.js +39 -0
- package/dist/runtime/server/utils/middleware/guildOnly.d.ts +1 -0
- package/dist/runtime/server/utils/middleware/guildOnly.js +6 -0
- package/dist/runtime/server/utils/middleware/ownerOnly.d.ts +1 -0
- package/dist/runtime/server/utils/middleware/ownerOnly.js +10 -0
- package/dist/runtime/server/utils/middleware/requireRole.d.ts +1 -0
- package/dist/runtime/server/utils/middleware/requireRole.js +15 -0
- package/dist/runtime/server/utils/reply.d.ts +13 -3
- package/dist/runtime/server/utils/reply.js +111 -162
- package/dist/runtime/server/utils/simulateInteraction.d.ts +20 -0
- package/dist/runtime/server/utils/simulateInteraction.js +127 -0
- package/dist/runtime/server/utils/useTextChannel.d.ts +56 -0
- package/dist/runtime/server/utils/useTextChannel.js +105 -0
- package/dist/types.d.mts +11 -1
- package/dist/types.d.ts +11 -1
- package/package.json +62 -44
- package/dist/runtime/client/components/TheHeader.css +0 -1
- package/dist/runtime/client/pages/slash-commands.css +0 -1
- package/dist/runtime/client/uno.config.d.ts +0 -2
- package/dist/runtime/client/uno.config.js +0 -10
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
|
|
2
|
+
ok: boolean;
|
|
3
|
+
command: string;
|
|
4
|
+
error: string;
|
|
5
|
+
replies?: undefined;
|
|
6
|
+
notices?: undefined;
|
|
7
|
+
response?: undefined;
|
|
8
|
+
responses?: undefined;
|
|
9
|
+
ephemeral?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
ok: boolean;
|
|
12
|
+
error: string | undefined;
|
|
13
|
+
command: string;
|
|
14
|
+
replies: import("../../../utils/simulateInteraction.js").RecordedReply[];
|
|
15
|
+
notices: string[];
|
|
16
|
+
response: string | undefined;
|
|
17
|
+
responses: string[];
|
|
18
|
+
ephemeral: boolean;
|
|
19
|
+
}>>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineEventHandler, readBody } from "h3";
|
|
2
|
+
import { simulateInteraction } from "../../../utils/simulateInteraction.js";
|
|
3
|
+
import { useDiscordClient } from "../../../utils/useDiscordClient.js";
|
|
4
|
+
export default defineEventHandler(async (event) => {
|
|
5
|
+
const body = await readBody(event);
|
|
6
|
+
if (!body?.name)
|
|
7
|
+
return { ok: false, command: "", error: "Missing command name" };
|
|
8
|
+
const { ok, error, replies, notices } = await simulateInteraction(useDiscordClient(), body);
|
|
9
|
+
return {
|
|
10
|
+
ok,
|
|
11
|
+
error,
|
|
12
|
+
command: body.name,
|
|
13
|
+
replies,
|
|
14
|
+
notices,
|
|
15
|
+
response: replies[0]?.content,
|
|
16
|
+
responses: replies.map((message) => message.content),
|
|
17
|
+
ephemeral: replies[0]?.ephemeral ?? false
|
|
18
|
+
};
|
|
19
|
+
});
|
|
@@ -1,49 +1,113 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import process from "node:process";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { Events } from "discord.js";
|
|
5
|
+
import contextMenus from "discord/contextMenus";
|
|
6
|
+
import listeners from "discord/listeners";
|
|
2
7
|
import slashCommands from "discord/slashCommands";
|
|
3
8
|
import { defineNitroPlugin, useRuntimeConfig } from "nitropack/runtime";
|
|
4
|
-
import {
|
|
9
|
+
import { logDiscordFailure } from "../../diagnostics.js";
|
|
5
10
|
import { DiscordClient } from "../utils/client.js";
|
|
6
11
|
export default defineNitroPlugin(async (nitro) => {
|
|
12
|
+
if (import.meta.prerender)
|
|
13
|
+
return;
|
|
7
14
|
const runtimeConfig = useRuntimeConfig();
|
|
8
|
-
|
|
15
|
+
if (!runtimeConfig.discord.autoStart && (!process.env.DISCORD_TOKEN || !process.env.DISCORD_CLIENT_ID))
|
|
16
|
+
return;
|
|
17
|
+
let closed = false;
|
|
18
|
+
function fail(message, error) {
|
|
19
|
+
logDiscordFailure(message, error);
|
|
20
|
+
if (!import.meta.dev && runtimeConfig.discord.autoStart && !closed)
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
let client;
|
|
24
|
+
try {
|
|
25
|
+
client = new DiscordClient();
|
|
26
|
+
} catch (error) {
|
|
27
|
+
fail("Failed to initialize Discord client:", error);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
;
|
|
9
31
|
globalThis[Symbol.for("discord-client")] = client;
|
|
10
|
-
|
|
11
|
-
|
|
32
|
+
const publicDiscord = runtimeConfig.public.discord;
|
|
33
|
+
if (import.meta.dev && publicDiscord?.wsUrl) {
|
|
34
|
+
let scheduleSync = function() {
|
|
35
|
+
if (!sync || closed)
|
|
36
|
+
return;
|
|
37
|
+
clearTimeout(syncTimer);
|
|
38
|
+
syncTimer = setTimeout(() => {
|
|
39
|
+
void client.syncCommandRegistrations({ changedOnly: true }).then((results) => {
|
|
40
|
+
if (results.length && socket.readyState === WebSocket.OPEN)
|
|
41
|
+
socket.send(JSON.stringify({ event: "registration-updated" }));
|
|
42
|
+
}).catch((error) => logDiscordFailure("Command sync failed:", error));
|
|
43
|
+
}, sync.debounce ?? 1e3);
|
|
44
|
+
};
|
|
45
|
+
const socket = new WebSocket(publicDiscord.wsUrl);
|
|
46
|
+
client.onActivity((entry) => {
|
|
47
|
+
try {
|
|
48
|
+
socket.send(JSON.stringify({ event: "activity", entry }));
|
|
49
|
+
} catch {
|
|
50
|
+
}
|
|
51
|
+
});
|
|
12
52
|
socket.addEventListener("error", (error) => {
|
|
13
|
-
|
|
53
|
+
logDiscordFailure("Dashboard WebSocket error:", error);
|
|
14
54
|
});
|
|
55
|
+
let syncTimer;
|
|
56
|
+
const sync = runtimeConfig.discord.sync;
|
|
57
|
+
let requested = 0;
|
|
58
|
+
socket.addEventListener("open", () => socket.send(JSON.stringify({ event: "command-revision" })));
|
|
15
59
|
socket.addEventListener("message", async (event) => {
|
|
16
60
|
const data = JSON.parse(event.data);
|
|
17
|
-
if (data.event
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
runtimeCommand.execute = existingCommand.execute;
|
|
28
|
-
} else {
|
|
29
|
-
logger.error(`Unable to dynamically load slash command at ${cmd.path}`);
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
commands.push(runtimeCommand);
|
|
61
|
+
if (data.event !== "command-revision" || !Number.isSafeInteger(data.revision) || data.revision <= requested)
|
|
62
|
+
return;
|
|
63
|
+
const revision = requested = data.revision;
|
|
64
|
+
const url = pathToFileURL(join(runtimeConfig.discord.buildDir, "discord/hmr", String(revision), "commands.mjs"));
|
|
65
|
+
try {
|
|
66
|
+
const { default: commands } = await import(url.href);
|
|
67
|
+
if (revision === requested) {
|
|
68
|
+
client.clearSlashCommands();
|
|
69
|
+
client.addSlashCommands(commands);
|
|
70
|
+
scheduleSync();
|
|
33
71
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} else {
|
|
37
|
-
socket.send(JSON.stringify({ event: "full-update" }));
|
|
72
|
+
} catch (error) {
|
|
73
|
+
logDiscordFailure("Could not load updated slash commands:", error);
|
|
38
74
|
}
|
|
39
75
|
});
|
|
40
|
-
nitro.hooks.hook("close", () =>
|
|
76
|
+
nitro.hooks.hook("close", () => {
|
|
77
|
+
closed = true;
|
|
78
|
+
clearTimeout(syncTimer);
|
|
79
|
+
socket.close();
|
|
80
|
+
});
|
|
41
81
|
}
|
|
42
82
|
client.addSlashCommands(slashCommands);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
83
|
+
client.addContextMenus(contextMenus);
|
|
84
|
+
client.registerListeners(listeners);
|
|
85
|
+
nitro.hooks.hook("close", () => {
|
|
86
|
+
closed = true;
|
|
87
|
+
return client.stop();
|
|
88
|
+
});
|
|
89
|
+
await Promise.resolve();
|
|
90
|
+
if (closed)
|
|
91
|
+
return;
|
|
46
92
|
if (runtimeConfig.discord.autoStart) {
|
|
47
|
-
|
|
93
|
+
try {
|
|
94
|
+
await client.start(runtimeConfig.discord.client);
|
|
95
|
+
const gateway = client.internalClient;
|
|
96
|
+
gateway?.on(Events.ShardDisconnect, (event, shard) => {
|
|
97
|
+
if (client.internalClient === gateway && !closed)
|
|
98
|
+
fail(`Discord shard ${shard} disconnected and cannot reconnect. Close code: ${event.code}`);
|
|
99
|
+
});
|
|
100
|
+
} catch (error) {
|
|
101
|
+
if (!closed)
|
|
102
|
+
fail("Failed to start Discord client:", error);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (!closed && runtimeConfig.discord.sync) {
|
|
107
|
+
try {
|
|
108
|
+
await client.syncCommandRegistrations();
|
|
109
|
+
} catch (error) {
|
|
110
|
+
logDiscordFailure("Command sync failed:", error);
|
|
111
|
+
}
|
|
48
112
|
}
|
|
49
113
|
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { NuxtDiscordOptions, SlashCommandRuntime,
|
|
3
|
-
import {
|
|
1
|
+
import type { ChatInputCommandInteraction, CommandInteraction, Interaction, TextBasedChannel } from 'discord.js';
|
|
2
|
+
import type { MiddlewareEntry, NuxtDiscordOptions, SlashCommandRuntime, SlashCommandSubcommandRuntime } from '../../../types.js';
|
|
3
|
+
import type { ContextMenuDefinition } from './defineContextMenu.js';
|
|
4
|
+
import type { ListenerDefinition } from './defineListener.js';
|
|
5
|
+
import { Client as InternalClient } from 'discord.js';
|
|
4
6
|
export interface DiscordClientErrorBase {
|
|
5
7
|
type: string;
|
|
6
8
|
client: DiscordClient;
|
|
@@ -26,262 +28,73 @@ export interface SlashCommandRegistrationError extends DiscordClientErrorBase {
|
|
|
26
28
|
error: unknown;
|
|
27
29
|
command?: SlashCommandRuntime;
|
|
28
30
|
}
|
|
29
|
-
export
|
|
31
|
+
export interface MiddlewareDeniedError extends DiscordClientErrorBase {
|
|
32
|
+
type: 'MiddlewareDeniedError';
|
|
33
|
+
interaction: Interaction;
|
|
34
|
+
middleware: string;
|
|
35
|
+
reason: string;
|
|
36
|
+
identifier?: string;
|
|
37
|
+
}
|
|
38
|
+
export type DiscordClientError = UnknownSlashCommandError | MissingRequiredOptionError | SlashCommandExecutionError | SlashCommandRegistrationError | MiddlewareDeniedError;
|
|
39
|
+
export interface ActivityLogEntry {
|
|
40
|
+
id: number;
|
|
41
|
+
timestamp: number;
|
|
42
|
+
type: 'command' | 'context-menu' | 'autocomplete' | 'error' | 'listener';
|
|
43
|
+
name: string;
|
|
44
|
+
userId?: string;
|
|
45
|
+
userName?: string;
|
|
46
|
+
guildId?: string;
|
|
47
|
+
guildName?: string;
|
|
48
|
+
channelId?: string;
|
|
49
|
+
duration?: number;
|
|
50
|
+
status: 'ok' | 'denied' | 'error';
|
|
51
|
+
detail?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface DispatchResult {
|
|
54
|
+
status: ActivityLogEntry['status'];
|
|
55
|
+
detail?: string;
|
|
56
|
+
dispose: () => void;
|
|
57
|
+
}
|
|
30
58
|
export declare function useInteraction(): ChatInputCommandInteraction | null;
|
|
59
|
+
export declare function setCurrentChannel(channel: TextBasedChannel | null): void;
|
|
60
|
+
export declare function getCurrentChannel(): TextBasedChannel | null;
|
|
31
61
|
export declare class DiscordClient {
|
|
32
62
|
#private;
|
|
33
63
|
get internalClient(): InternalClient<boolean> | null;
|
|
34
64
|
constructor();
|
|
35
65
|
start(options: NuxtDiscordOptions['client']): Promise<undefined>;
|
|
66
|
+
registerListeners(listeners: ListenerDefinition[]): void;
|
|
67
|
+
addContextMenus(menus: (ContextMenuDefinition & {
|
|
68
|
+
name: string;
|
|
69
|
+
})[]): void;
|
|
70
|
+
getContextMenus(): (ContextMenuDefinition & {
|
|
71
|
+
name: string;
|
|
72
|
+
middleware?: string[];
|
|
73
|
+
middlewareEntries?: MiddlewareEntry[];
|
|
74
|
+
})[];
|
|
75
|
+
dispatchInteraction(interaction: Interaction, options?: {
|
|
76
|
+
simulation?: boolean;
|
|
77
|
+
}): Promise<DispatchResult>;
|
|
78
|
+
resolveSlashCommand(name: string, group?: string | null, leaf?: string | null, commandGuildId?: string | null): SlashCommandRuntime | SlashCommandSubcommandRuntime | undefined;
|
|
79
|
+
onActivity(callback: (entry: ActivityLogEntry) => void): void;
|
|
80
|
+
getActivityLog(): ActivityLogEntry[];
|
|
36
81
|
stop(): Promise<void>;
|
|
37
82
|
startScope(): void;
|
|
38
83
|
stopScope(): void;
|
|
39
84
|
isReady(): boolean;
|
|
40
85
|
addSlashCommand(command: SlashCommandRuntime): void;
|
|
41
86
|
addSlashCommands(commands: SlashCommandRuntime[]): void;
|
|
42
|
-
removeSlashCommand(name: string): void;
|
|
87
|
+
removeSlashCommand(name: string, commandGuildId?: string | null): void;
|
|
43
88
|
clearSlashCommands(): void;
|
|
44
89
|
getSlashCommands(): SlashCommandRuntime[];
|
|
45
|
-
getSlashCommand(name: string): SlashCommandRuntime | undefined;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
55
|
-
description: string;
|
|
56
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
57
|
-
required?: boolean;
|
|
58
|
-
} | {
|
|
59
|
-
name: string;
|
|
60
|
-
subcommands: {
|
|
61
|
-
name: string;
|
|
62
|
-
subcommands: never[];
|
|
63
|
-
options?: import("discord.js").APIApplicationCommandBasicOption[];
|
|
64
|
-
type: ApplicationCommandOptionType.Subcommand;
|
|
65
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
66
|
-
description: string;
|
|
67
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
68
|
-
required?: boolean;
|
|
69
|
-
}[];
|
|
70
|
-
options?: import("discord.js").APIApplicationCommandSubcommandOption[];
|
|
71
|
-
type: ApplicationCommandOptionType.SubcommandGroup;
|
|
72
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
73
|
-
description: string;
|
|
74
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
75
|
-
required?: boolean;
|
|
76
|
-
} | {
|
|
77
|
-
subcommands: ({
|
|
78
|
-
name: string;
|
|
79
|
-
subcommands: never[];
|
|
80
|
-
options?: import("discord.js").APIApplicationCommandBasicOption[];
|
|
81
|
-
type: ApplicationCommandOptionType.Subcommand;
|
|
82
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
83
|
-
description: string;
|
|
84
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
85
|
-
required?: boolean;
|
|
86
|
-
} | {
|
|
87
|
-
name: string;
|
|
88
|
-
subcommands: {
|
|
89
|
-
name: string;
|
|
90
|
-
subcommands: never[];
|
|
91
|
-
options?: import("discord.js").APIApplicationCommandBasicOption[];
|
|
92
|
-
type: ApplicationCommandOptionType.Subcommand;
|
|
93
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
94
|
-
description: string;
|
|
95
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
96
|
-
required?: boolean;
|
|
97
|
-
}[];
|
|
98
|
-
options?: import("discord.js").APIApplicationCommandSubcommandOption[];
|
|
99
|
-
type: ApplicationCommandOptionType.SubcommandGroup;
|
|
100
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
101
|
-
description: string;
|
|
102
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
103
|
-
required?: boolean;
|
|
104
|
-
})[];
|
|
105
|
-
id: import("discord.js").Snowflake;
|
|
106
|
-
type: import("discord.js").ApplicationCommandType;
|
|
107
|
-
application_id: import("discord.js").Snowflake;
|
|
108
|
-
guild_id?: import("discord.js").Snowflake;
|
|
109
|
-
name: string;
|
|
110
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
111
|
-
name_localized?: string;
|
|
112
|
-
description: string;
|
|
113
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
114
|
-
description_localized?: string;
|
|
115
|
-
options?: APIApplicationCommandOption[];
|
|
116
|
-
default_member_permissions: import("discord.js").Permissions | null;
|
|
117
|
-
dm_permission?: boolean;
|
|
118
|
-
default_permission?: boolean;
|
|
119
|
-
nsfw?: boolean;
|
|
120
|
-
integration_types?: import("discord.js").ApplicationIntegrationType[];
|
|
121
|
-
contexts?: import("discord.js").InteractionContextType[] | null;
|
|
122
|
-
version: import("discord.js").Snowflake;
|
|
123
|
-
handler?: import("discord.js").EntryPointCommandHandlerType;
|
|
124
|
-
})[];
|
|
125
|
-
changed: {
|
|
126
|
-
local: SlashCommandRuntime | SlashCommandSubcommandRuntime | SlashCommandSubcommandGroupRuntime;
|
|
127
|
-
remote: {
|
|
128
|
-
name: string;
|
|
129
|
-
subcommands: never[];
|
|
130
|
-
options?: import("discord.js").APIApplicationCommandBasicOption[];
|
|
131
|
-
type: ApplicationCommandOptionType.Subcommand;
|
|
132
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
133
|
-
description: string;
|
|
134
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
135
|
-
required?: boolean;
|
|
136
|
-
} | {
|
|
137
|
-
name: string;
|
|
138
|
-
subcommands: {
|
|
139
|
-
name: string;
|
|
140
|
-
subcommands: never[];
|
|
141
|
-
options?: import("discord.js").APIApplicationCommandBasicOption[];
|
|
142
|
-
type: ApplicationCommandOptionType.Subcommand;
|
|
143
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
144
|
-
description: string;
|
|
145
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
146
|
-
required?: boolean;
|
|
147
|
-
}[];
|
|
148
|
-
options?: import("discord.js").APIApplicationCommandSubcommandOption[];
|
|
149
|
-
type: ApplicationCommandOptionType.SubcommandGroup;
|
|
150
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
151
|
-
description: string;
|
|
152
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
153
|
-
required?: boolean;
|
|
154
|
-
} | {
|
|
155
|
-
subcommands: ({
|
|
156
|
-
name: string;
|
|
157
|
-
subcommands: never[];
|
|
158
|
-
options?: import("discord.js").APIApplicationCommandBasicOption[];
|
|
159
|
-
type: ApplicationCommandOptionType.Subcommand;
|
|
160
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
161
|
-
description: string;
|
|
162
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
163
|
-
required?: boolean;
|
|
164
|
-
} | {
|
|
165
|
-
name: string;
|
|
166
|
-
subcommands: {
|
|
167
|
-
name: string;
|
|
168
|
-
subcommands: never[];
|
|
169
|
-
options?: import("discord.js").APIApplicationCommandBasicOption[];
|
|
170
|
-
type: ApplicationCommandOptionType.Subcommand;
|
|
171
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
172
|
-
description: string;
|
|
173
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
174
|
-
required?: boolean;
|
|
175
|
-
}[];
|
|
176
|
-
options?: import("discord.js").APIApplicationCommandSubcommandOption[];
|
|
177
|
-
type: ApplicationCommandOptionType.SubcommandGroup;
|
|
178
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
179
|
-
description: string;
|
|
180
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
181
|
-
required?: boolean;
|
|
182
|
-
})[];
|
|
183
|
-
id: import("discord.js").Snowflake;
|
|
184
|
-
type: import("discord.js").ApplicationCommandType;
|
|
185
|
-
application_id: import("discord.js").Snowflake;
|
|
186
|
-
guild_id?: import("discord.js").Snowflake;
|
|
187
|
-
name: string;
|
|
188
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
189
|
-
name_localized?: string;
|
|
190
|
-
description: string;
|
|
191
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
192
|
-
description_localized?: string;
|
|
193
|
-
options?: APIApplicationCommandOption[];
|
|
194
|
-
default_member_permissions: import("discord.js").Permissions | null;
|
|
195
|
-
dm_permission?: boolean;
|
|
196
|
-
default_permission?: boolean;
|
|
197
|
-
nsfw?: boolean;
|
|
198
|
-
integration_types?: import("discord.js").ApplicationIntegrationType[];
|
|
199
|
-
contexts?: import("discord.js").InteractionContextType[] | null;
|
|
200
|
-
version: import("discord.js").Snowflake;
|
|
201
|
-
handler?: import("discord.js").EntryPointCommandHandlerType;
|
|
202
|
-
};
|
|
203
|
-
}[];
|
|
204
|
-
synced: {
|
|
205
|
-
local: SlashCommandRuntime | SlashCommandSubcommandRuntime | SlashCommandSubcommandGroupRuntime;
|
|
206
|
-
remote: {
|
|
207
|
-
name: string;
|
|
208
|
-
subcommands: never[];
|
|
209
|
-
options?: import("discord.js").APIApplicationCommandBasicOption[];
|
|
210
|
-
type: ApplicationCommandOptionType.Subcommand;
|
|
211
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
212
|
-
description: string;
|
|
213
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
214
|
-
required?: boolean;
|
|
215
|
-
} | {
|
|
216
|
-
name: string;
|
|
217
|
-
subcommands: {
|
|
218
|
-
name: string;
|
|
219
|
-
subcommands: never[];
|
|
220
|
-
options?: import("discord.js").APIApplicationCommandBasicOption[];
|
|
221
|
-
type: ApplicationCommandOptionType.Subcommand;
|
|
222
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
223
|
-
description: string;
|
|
224
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
225
|
-
required?: boolean;
|
|
226
|
-
}[];
|
|
227
|
-
options?: import("discord.js").APIApplicationCommandSubcommandOption[];
|
|
228
|
-
type: ApplicationCommandOptionType.SubcommandGroup;
|
|
229
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
230
|
-
description: string;
|
|
231
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
232
|
-
required?: boolean;
|
|
233
|
-
} | {
|
|
234
|
-
subcommands: ({
|
|
235
|
-
name: string;
|
|
236
|
-
subcommands: never[];
|
|
237
|
-
options?: import("discord.js").APIApplicationCommandBasicOption[];
|
|
238
|
-
type: ApplicationCommandOptionType.Subcommand;
|
|
239
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
240
|
-
description: string;
|
|
241
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
242
|
-
required?: boolean;
|
|
243
|
-
} | {
|
|
244
|
-
name: string;
|
|
245
|
-
subcommands: {
|
|
246
|
-
name: string;
|
|
247
|
-
subcommands: never[];
|
|
248
|
-
options?: import("discord.js").APIApplicationCommandBasicOption[];
|
|
249
|
-
type: ApplicationCommandOptionType.Subcommand;
|
|
250
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
251
|
-
description: string;
|
|
252
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
253
|
-
required?: boolean;
|
|
254
|
-
}[];
|
|
255
|
-
options?: import("discord.js").APIApplicationCommandSubcommandOption[];
|
|
256
|
-
type: ApplicationCommandOptionType.SubcommandGroup;
|
|
257
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
258
|
-
description: string;
|
|
259
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
260
|
-
required?: boolean;
|
|
261
|
-
})[];
|
|
262
|
-
id: import("discord.js").Snowflake;
|
|
263
|
-
type: import("discord.js").ApplicationCommandType;
|
|
264
|
-
application_id: import("discord.js").Snowflake;
|
|
265
|
-
guild_id?: import("discord.js").Snowflake;
|
|
266
|
-
name: string;
|
|
267
|
-
name_localizations?: import("discord.js").LocalizationMap | null;
|
|
268
|
-
name_localized?: string;
|
|
269
|
-
description: string;
|
|
270
|
-
description_localizations?: import("discord.js").LocalizationMap | null;
|
|
271
|
-
description_localized?: string;
|
|
272
|
-
options?: APIApplicationCommandOption[];
|
|
273
|
-
default_member_permissions: import("discord.js").Permissions | null;
|
|
274
|
-
dm_permission?: boolean;
|
|
275
|
-
default_permission?: boolean;
|
|
276
|
-
nsfw?: boolean;
|
|
277
|
-
integration_types?: import("discord.js").ApplicationIntegrationType[];
|
|
278
|
-
contexts?: import("discord.js").InteractionContextType[] | null;
|
|
279
|
-
version: import("discord.js").Snowflake;
|
|
280
|
-
handler?: import("discord.js").EntryPointCommandHandlerType;
|
|
281
|
-
};
|
|
282
|
-
}[];
|
|
283
|
-
conflict: (SlashCommandRuntime | SlashCommandSubcommandRuntime | SlashCommandSubcommandGroupRuntime)[];
|
|
284
|
-
}>;
|
|
285
|
-
registerSlashCommands(): Promise<RESTPutAPIApplicationCommandsResult | PromiseSettledResult<import("discord.js").APIApplicationCommand>[]>;
|
|
90
|
+
getSlashCommand(name: string, commandGuildId?: string | null): SlashCommandRuntime | undefined;
|
|
91
|
+
static DISCORD_TOKEN_LIFETIME: number;
|
|
92
|
+
getRemoteSlashCommands(): Promise<import("discord.js").APIApplicationCommand[]>;
|
|
93
|
+
diffRemoteSlashCommands(commands?: SlashCommandRuntime[], _forceRefresh?: boolean): Promise<import("../../registration.js").RegistrationDiff>;
|
|
94
|
+
syncCommandRegistrations(options?: {
|
|
95
|
+
changedOnly?: boolean;
|
|
96
|
+
guilds?: string[];
|
|
97
|
+
}): Promise<import("../../registration.js").RegistrationResult[]>;
|
|
98
|
+
registerSlashCommands(guilds?: string[]): Promise<import("discord.js").APIApplicationCommand[]>;
|
|
286
99
|
}
|
|
287
100
|
export declare function isPromise(value: any): value is Promise<unknown>;
|