This commit is contained in:
xhyrom 2022-03-11 18:19:48 +01:00
parent c948cda4ef
commit 9496c741c8
2 changed files with 4 additions and 4 deletions

View file

@ -3,7 +3,7 @@
"version": "1.0.0",
"main": "dist/worker.production.js",
"scripts": {
"build": "webpack ./src/bot",
"build": "webpack ./packages/bot",
"dev": "cross-env NODE_ENV=development npm run build"
},
"keywords": [],

View file

@ -80,7 +80,7 @@ export const handleRequest = async(request: Request): Promise<Response> => {
finalComponents.push(row);
}
await fetch(`${RouteBases.api}/channels/${channelId}/messages`, {
const fetched = await fetch(`${RouteBases.api}/channels/${channelId}/messages`, {
method: 'POST',
headers: {
'Authorization': `Bot ${CLIENT_TOKEN}`,
@ -90,13 +90,13 @@ export const handleRequest = async(request: Request): Promise<Response> => {
content: message,
components: finalComponents
})
}).catch(e => e);
}).catch(() => {});
return respond({
type: InteractionResponseType.ChannelMessageWithSource,
data: {
flags: 64,
content: 'Done!'
content: fetched?.ok ? 'Done!' : 'Error, invalid channelId'
}
});
} else if (interaction.type === InteractionType.MessageComponent) {