Skip to content

Commit 6757fd8

Browse files
authored
fix(typo): remove typo in telegram set (#263)
1 parent 931a65b commit 6757fd8

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

api/telegram/set.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
1-
import fetch from 'node-fetch';
2-
import * as Sentry from '@sentry/node';
1+
import fetch from "node-fetch";
2+
import * as Sentry from "@sentry/node";
33

44
const { TELEGRAM_BOT_TOKEN, APP_URL, SENTRY_DSN } = process.env;
55

66
Sentry.init({ dsn: SENTRY_DSN });
77

88
/* used to activate webhook whenever we change the APP_URL */
9-
export default async(request, response) => {
9+
export default async (request, response) => {
1010
try {
1111
if (request.query.token === TELEGRAM_BOT_TOKEN) {
12-
const fetchResponse = await fetch(`https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/setWebhook?url=${APP_URL}/api/telegram/update?token=${TELEGRAM_BOT_TOKEN}}`, {
13-
method: 'POST',
14-
headers: {
15-
'Content-Type': 'application/json',
16-
},
17-
});
12+
const fetchResponse = await fetch(
13+
`https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/setWebhook?url=${APP_URL}/api/telegram/update?token=${TELEGRAM_BOT_TOKEN}`,
14+
{
15+
method: "POST",
16+
headers: {
17+
"Content-Type": "application/json"
18+
}
19+
}
20+
);
1821
const jsonResponse = await fetchResponse.json();
1922

2023
response.status(200).json(jsonResponse);
2124
} else {
22-
response.status(401).send('Unauthorized');
25+
response.status(401).send("Unauthorized");
2326
}
2427
} catch (error) {
2528
Sentry.captureException(error);
2629

27-
response.status(400).send('not ok');
30+
response.status(400).send("not ok");
2831
}
2932
};

0 commit comments

Comments
 (0)