# discord-sleep-rich-presence

> Discord Rich Presence that shows how long you have been sleeping (From computer shutdown to computer startup)

Latest version **1.0.0** (published 2021-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install discord-sleep-rich-presence
pnpm add discord-sleep-rich-presence
yarn add discord-sleep-rich-presence
bun add discord-sleep-rich-presence
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-02-28 |
| First published | 2021-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | nathanw1510 |
| Maintainers | nathanw1510 |

## Links

- npm: https://www.npmjs.com/package/discord-sleep-rich-presence
- Repository: https://github.com/nathanw1510/discord-sleep-rich-presence
- Homepage: https://github.com/nathanw1510/discord-sleep-rich-presence#readme
- Issues: https://github.com/nathanw1510/discord-sleep-rich-presence/issues
- npm.io page: https://npm.io/package/discord-sleep-rich-presence

## Dependencies (3)

- [ngrok](https://npm.io/package/ngrok.md) ^3.4.0
- [express](https://npm.io/package/express.md) ^4.17.1
- [discord-rpc](https://npm.io/package/discord-rpc.md) ^3.2.0

## Recent versions

- 1.0.0 (latest) — 2021-02-28

## README

# discord-sleep-rich-presence
Node.js module to create a Discord Rich Presence that shows how long you have been sleeping for (from computer shutdown to computer startup)

It is recommended to use a Windows server and installing Discord on it

This module creates a web server that allows your main computer to send shutdown/startup commands which will then change your Discord presence

![Image1](https://i.gyazo.com/f497bf389e537fdc3b3320538b6d62ec.png)

![Image2](https://i.gyazo.com/dfa1a3ad79d61562374f44598d93223b.png)


## Getting started

```
npm install discord-sleep-rich-presence
```

```javascript
const SleepPresence = require('discord-sleep-rich-presence');

const clientId = '703777701370265680';

const presence = new SleepPresence(clientId);

presence.setText('Currently sleeping...');
presence.setLargeImage('name-of-large-image');
presence.setSmallImage('name-of-small-image');

const PORT = 3000
presence.create(PORT);
```

For Windows:

On your main computer, run `gpedit.msc`

Navigate to `Windows Settings > Scripts (Startup/Shutdown)`

For Startup, add a bat file script that GET requests to (ngrok link)/online

Example:

```
curl https://asdf.ngrok.io/online
```

For Shutdown, do the same, but with the path `/offline`

Example:

```
curl https://asdf.ngrok.io/offline
```


On your Windows server, install Discord and log into your account (leave Discord running)

Also install Node.js and the program you just created

Run the program on the Windows server as well

---
_Source: https://npm.io/package/discord-sleep-rich-presence · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
