mirror of
https://github.com/xHyroM/roles-bot.git
synced 2024-11-12 20:18: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",
|
||||
"main": "dist/worker.production.js",
|
||||
"scripts": {
|
||||
"build": "webpack ./src/bot",
|
||||
"build": "webpack ./packages/bot",
|
||||
"dev": "cross-env NODE_ENV=development npm run build"
|
||||
},
|
||||
"keywords": [],
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue