Skip to content

Commit

Permalink
fix: fix build script and disable Discord transport
Browse files Browse the repository at this point in the history
  • Loading branch information
Patsagorn committed Dec 2, 2023
1 parent 76b8118 commit e3d781a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --write . --ignore-unknown",
"start": "node ./dist/patsabot/start.js",
"build": "tsc",
"build": "tsc && cd web && npm run build",
"prepare": "husky install"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/patsabot/discord-transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface DiscordTransportOptions extends TransportStreamOptions {
}

// @ts-ignore
const http = RateLimit.default(Axios.create(), {
const http = RateLimit(Axios.create(), {
maxRequests: 1,
perMilliseconds: 1000,
});
Expand Down Expand Up @@ -103,7 +103,7 @@ export default class DiscordTransport extends Transport {
this.sendToDiscord(info);
})
.catch((err) => {
console.log('Error sending message to discord', err);
console.error('Error sending message to discord', err.message);
});
});
}
Expand Down
9 changes: 5 additions & 4 deletions src/patsabot/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ const logger = createLogger({
)
),
}),
new DiscordTransport({
webhook: process.env.BOT_DISCORD_WEBHOOK_LOGGER,
defaultMeta: { service: 'patsabot' },
}),
// until discord transport is fixed
// new DiscordTransport({
// webhook: process.env.BOT_DISCORD_WEBHOOK_LOGGER,
// defaultMeta: { service: 'patsabot' },
// }),
],
exceptionHandlers: [
new transports.File({
Expand Down

0 comments on commit e3d781a

Please sign in to comment.