completionId: cgen-ce592773dc0f457985655594c56bb089
cgen-ce592773dc0f457985655594c56bb089
This commit is contained in:
parent
8dedb4ed5c
commit
26aa9078c0
1 changed files with 5 additions and 1 deletions
|
|
@ -962,6 +962,8 @@ export function createServer() {
|
|||
];
|
||||
|
||||
const registerUrl = `https://discord.com/api/v10/applications/${clientId}/commands`;
|
||||
console.log("[Discord] Calling Discord API:", registerUrl);
|
||||
|
||||
const response = await fetch(registerUrl, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
|
|
@ -971,6 +973,8 @@ export function createServer() {
|
|||
body: JSON.stringify(commands),
|
||||
});
|
||||
|
||||
console.log("[Discord] Discord API response status:", response.status);
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.text();
|
||||
console.error(
|
||||
|
|
@ -979,7 +983,7 @@ export function createServer() {
|
|||
errorData,
|
||||
);
|
||||
return res.status(response.status).json({
|
||||
error: `Failed to register commands: ${errorData}`,
|
||||
error: `Discord API error (${response.status}): ${errorData}`,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue