uppercased environment variables

This commit is contained in:
Heli-o 2024-12-27 01:16:47 +01:00
parent 7392039ba8
commit aad843d896
2 changed files with 6 additions and 6 deletions

View file

@ -26,9 +26,9 @@
`.env` file is needed due to docker compose. Even if you are not using docker and docker compose, **.ENV IS NEEDED**
the example .env is
```
webhook_url=<url_of_webhook>
webhook_name=Flipper
webhook_profile_picture_link=https://cdn.discordapp.com/avatars/486155512568741900/164084b936b4461fe9505398f7383a0e.png?size=4096
WEBHOOK_URL=<webhook_url>
WEBHOOK_NAME=Flipper
WEBHOOK_PROFILE_PICTURE=https://cdn.discordapp.com/avatars/486155512568741900/164084b936b4461fe9505398f7383a0e.png?size=4096
```
You can also add these as environment variables into your system when running Node or run the app via `node --env-file=.env index.js`

View file

@ -21,7 +21,7 @@ const bazaarPrice = {
};
async function initialize() {
const matches = process.env.webhook_url.match(webhookRegex);
const matches = process.env.WEBHOOK_URL.match(webhookRegex);
if (!matches) return console.log(`[Main thread] Couldn't parse Webhook URL`);
const webhook = new WebhookClient({ id: matches[1], token: matches[2] });
@ -70,8 +70,8 @@ async function initialize() {
);
await webhook.send({
username: process.env.webhook_name,
avatarURL: process.env.webhook_profile_picture_link,
username: process.env.WEBHOOK_NAME,
avatarURL: process.env.WEBHOOK_PROFILE_PICTURE,
embeds: [embed],
});
}