uppercased environment variables
This commit is contained in:
parent
7392039ba8
commit
18bbfe775e
2 changed files with 6 additions and 6 deletions
|
@ -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=Auction_Notifier
|
||||
WEBHOOK_PROFILE_PICTURE=<picture_url>
|
||||
```
|
||||
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`
|
||||
|
||||
|
|
6
index.js
6
index.js
|
@ -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],
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue