Pestilent Lieutenant
Receive an embedded message from Discord whenever you save something on Reddit
Installation
npm install pestilent-lieutenant
How to use
Create a Discord webhook
- Go to the Discord channel you want to receive Reddit embeds
- From the channel menu, select Edit Channel
- Click on Integrations on the left menu
- Click on Webhooks and then press the Create Webhook button
- (Optional) Name the bot to whatever you prefer and set an avatar
- Click Copy Webhook URL and save this link for later
Step 1 and 2 | Step 3 | Step 4 and 5 |
---|---|---|
Create a Reddit app
- 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
- Save your client ID and client secret on the dashboard for later
Step 1 | Step 2 |
---|---|
config.json
Configure Open config.json
from the repository and edit the following fields:
Field | What it is | Example |
---|---|---|
discordWebhook.id | https://discord.com/api/webhooks/this-part-of-the-url/long-token | 199737254929760256 |
discordWebhook.token | https://discord.com/api/webhooks/18-digit-number/this-part-of-the-url | 5j-0Uj72BkzYcRt1rL56wVdm7OCIixAAL-nrhLrt41QSw9yDa3jdbT8dFSiRcDjDoeEp |
redditAuth.clientId | The client ID you saved from earlier | p-jcoLKBynTLew |
redditAuth.clientSecret | The client secret you saved from earlier | gko_LXELoV07ZBNUXrvWZfzE3aI |
redditAuth.username | Your Reddit username | Choby9 |
redditAuth.password | Your Reddit password | abcd1234!@#$ |
interval | Time interval in milliseconds for how often to check for new saved posts | 6000 |
maxIdleCount | Number of requests with no new saved posts before going idle | 5 |
idleInterval | Time interval in milliseconds for how often to check for new saved posts when idle | 30000 |
avatar_url (optional) | Image url for the webhook avatar. This overwrites the avatar you set from step 5 | https://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...