mirror of
https://github.com/xHyroM/roles-bot.git
synced 2024-11-22 00:11:06 +01:00
errors
This commit is contained in:
parent
c948cda4ef
commit
9496c741c8
2 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "dist/worker.production.js",
|
"main": "dist/worker.production.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack ./src/bot",
|
"build": "webpack ./packages/bot",
|
||||||
"dev": "cross-env NODE_ENV=development npm run build"
|
"dev": "cross-env NODE_ENV=development npm run build"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
|
|
@ -80,7 +80,7 @@ export const handleRequest = async(request: Request): Promise<Response> => {
|
||||||
finalComponents.push(row);
|
finalComponents.push(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
await fetch(`${RouteBases.api}/channels/${channelId}/messages`, {
|
const fetched = await fetch(`${RouteBases.api}/channels/${channelId}/messages`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': `Bot ${CLIENT_TOKEN}`,
|
'Authorization': `Bot ${CLIENT_TOKEN}`,
|
||||||
|
@ -90,13 +90,13 @@ export const handleRequest = async(request: Request): Promise<Response> => {
|
||||||
content: message,
|
content: message,
|
||||||
components: finalComponents
|
components: finalComponents
|
||||||
})
|
})
|
||||||
}).catch(e => e);
|
}).catch(() => {});
|
||||||
|
|
||||||
return respond({
|
return respond({
|
||||||
type: InteractionResponseType.ChannelMessageWithSource,
|
type: InteractionResponseType.ChannelMessageWithSource,
|
||||||
data: {
|
data: {
|
||||||
flags: 64,
|
flags: 64,
|
||||||
content: 'Done!'
|
content: fetched?.ok ? 'Done!' : 'Error, invalid channelId'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (interaction.type === InteractionType.MessageComponent) {
|
} else if (interaction.type === InteractionType.MessageComponent) {
|
||||||
|
|
Loading…
Reference in a new issue