Utilisation d'un .env pour le webhook (ça sert à rien d'aller chercher l'ancien dans le git le webhook est supprimé)
This commit is contained in:
parent
efb2184245
commit
fa66d7ed2b
2 changed files with 7 additions and 5 deletions
9
index.ts
9
index.ts
|
|
@ -176,10 +176,9 @@ const server = new Server(
|
||||||
if (userWindow.contactFormSelectedField === "message") {
|
if (userWindow.contactFormSelectedField === "message") {
|
||||||
userWindow.contactFormData.message += newLine;
|
userWindow.contactFormData.message += newLine;
|
||||||
} else if (userWindow.contactFormSelectedField === "submit") {
|
} else if (userWindow.contactFormSelectedField === "submit") {
|
||||||
const webhookUrl =
|
const webhookUrl = process.env.DISCORD_WEBHOOK_URL!;
|
||||||
"https://discord.com/api/webhooks/1349123668914999361/2rvvgNNRyzgGpKFJ0JLnT-PbkbM-phyQZwTxRBkxDWSA_9SybsP2eILbxsegthsWsu8d";
|
|
||||||
const messageData = {
|
const messageData = {
|
||||||
content: `<@323206956640763916>\nName: ${
|
content: `<@${process.env.DISCORD_USER_ID}>\nName: ${
|
||||||
userWindow.contactFormData.name
|
userWindow.contactFormData.name
|
||||||
}\nEmail: ${
|
}\nEmail: ${
|
||||||
userWindow.contactFormData.email
|
userWindow.contactFormData.email
|
||||||
|
|
@ -273,6 +272,6 @@ const server = new Server(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
server.listen(2222, "0.0.0.0", () => {
|
server.listen(+process.env.PORT!, "0.0.0.0", () => {
|
||||||
console.log("🚀 SSH server running on port 2222");
|
console.log(`🚀 SSH server running on port ${process.env.PORT!}`);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
3
template.env
Normal file
3
template.env
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
DISCORD_WEBHOOK_URL=<your-webhook-url>
|
||||||
|
DISCORD_USER_ID=<your-user-id>
|
||||||
|
PORT=2222
|
||||||
Loading…
Add table
Reference in a new issue