Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksTeresh committed Jul 22, 2024
1 parent b7450de commit 0869e12
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/discordBot/services/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ const setupLogger = () => {
format.splat(),
format.colorize(),
errorStackTracerFormat(),
format.simple()
format.simple(),
),
transports: [],
});

logger.add(
new transports.Console({
format: format.simple(),
})
}),
);

if (!process.env.PAPERTRAIL_URL) return;
Expand All @@ -48,7 +48,7 @@ const setupLogger = () => {

logger.exceptions.handle(paperTrailTransport);

winstonPapertrail.on("connect", function () {
winstonPapertrail.on("connect", function() {
logger.info("Logger connected to Papertrail");
});
};
Expand Down Expand Up @@ -76,7 +76,7 @@ const logNoInteractionError = async (
member,
channel,
client,
error
error,
) => {
const msg = `ERROR DETECTED!\nMember: ${member}\nChannel: ${channel}`;
logger.error(msg);
Expand Down
29 changes: 15 additions & 14 deletions src/server/routes/webhookProxy.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
require("dotenv").config()
const axios = require("axios")
const router = require("express").Router()
require("dotenv").config();
const axios = require("axios");
const router = require("express").Router();

router.post("/:webhookId", async (req, res) => {
const webhookUrl = `${process.env.DISCORD_WEBHOOK_URL}/${req.params.webhookId}/${process.env.DISCORD_WEBHOOK_TOKEN}`
const webhookData = req.body
const webhookUrl = `${process.env.DISCORD_WEBHOOK_URL}/${req.params.webhookId}/${process.env.DISCORD_WEBHOOK_TOKEN}`;
const webhookData = req.body;
try {
await axios.post(webhookUrl, webhookData, {
params: req.query,
headers: req.headers,
})
res.status(200).send("Webhook sent successfully")
return
} catch (error) {
console.error(error)
res.status(500).send("Internal server error")
return
});
res.status(200).send("Webhook sent successfully");
return;
}
})
catch (error) {
console.error(error);
res.status(500).send("Internal server error");
return;
}
});

module.exports = router
module.exports = router;
2 changes: 1 addition & 1 deletion src/telegramBot/bridge/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const sendMessageToDiscord = async (ctx, message, channel) => {
if (message.content.text && message.content.text[0] === "/") {
return;
}
if(!isMessageSafeToSend(message.content.text)) {
if (!isMessageSafeToSend(message.content.text)) {
console.log("Message contains a telegram or discord link");
return;
}
Expand Down

0 comments on commit 0869e12

Please sign in to comment.