1.3.2 • Published 4 years ago

pestilent-lieutenant v1.3.2

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Pestilent Lieutenant

npm version npm total downloads code size

Receive an embedded message from Discord whenever you save something on Reddit

Installation

npm install pestilent-lieutenant

How to use

Create a Discord webhook

  1. Go to the Discord channel you want to receive Reddit embeds
  2. From the channel menu, select Edit Channel
  3. Click on Integrations on the left menu
  4. Click on Webhooks and then press the Create Webhook button
  5. (Optional) Name the bot to whatever you prefer and set an avatar
  6. Click Copy Webhook URL and save this link for later
Step 1 and 2Step 3Step 4 and 5
Discord step 1 and 2Discord step 3Discord step 4 and 5

Create a Reddit app

  1. Create a Reddit app. Select "script" and put in any url and uri. It doesn't matter what you put here, as long as they are valid links
  2. Save your client ID and client secret on the dashboard for later
Step 1Step 2
Reddit step 1Reddit step 2

Configure config.json

Open config.json from the repository and edit the following fields:

FieldWhat it isExample
discordWebhook.idhttps://discord.com/api/webhooks/this-part-of-the-url/long-token199737254929760256
discordWebhook.tokenhttps://discord.com/api/webhooks/18-digit-number/this-part-of-the-url5j-0Uj72BkzYcRt1rL56wVdm7OCIixAAL-nrhLrt41QSw9yDa3jdbT8dFSiRcDjDoeEp
redditAuth.clientIdThe client ID you saved from earlierp-jcoLKBynTLew
redditAuth.clientSecretThe client secret you saved from earliergko_LXELoV07ZBNUXrvWZfzE3aI
redditAuth.usernameYour Reddit usernameChoby9
redditAuth.passwordYour Reddit passwordabcd1234!@#$
intervalTime interval in milliseconds for how often to check for new saved posts6000
maxIdleCountNumber of requests with no new saved posts before going idle5
idleIntervalTime interval in milliseconds for how often to check for new saved posts when idle30000
avatar_url (optional)Image url for the webhook avatar. This overwrites the avatar you set from step 5https://i.redd.it/snoovatar/avatars/ffa9205e-9356-43fd-acb1-12c11c6d4b97.png

Once you're done, you're all set! Now go ahead and start the program with

node .

and enjoy the Reddit posts while I pour this pestilence into your ear...