Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/natsuozawa/discord-scrapbox
Discord Scrapbox integration
https://github.com/natsuozawa/discord-scrapbox
Last synced: about 13 hours ago
JSON representation
Discord Scrapbox integration
- Host: GitHub
- URL: https://github.com/natsuozawa/discord-scrapbox
- Owner: natsuozawa
- License: mit
- Created: 2022-06-04T18:57:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-16T15:59:17.000Z (9 months ago)
- Last Synced: 2024-02-16T16:54:12.956Z (9 months ago)
- Language: JavaScript
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# discord-scrapbox
Discord Scrapbox integration# How to use
Currently, the only feature is to create a new Scrapbox page based on a Discord message. The Discord message must have a link. The following formats are accepted:```
Title Link Body
Link Body (title will be the title of the linked resource, body will be the link + body)
Link (title will be the title of the linked resource, body is the link)
```In order to create a new Scrapbox page, the user reacts with an emoji specified below in the Configuration section. The bot will then add the page and send a message. If the bot is successful, the bot reacts with a checkmark. Otherwise, it will react with a cross mark.
# Discord bot setup
Before use, set up a Discord App with bot features. Enable the `Read Message`, `Send Message`, and `Add Reactions` permissions. Make sure the bot is not public. Then, add the bot to the designated server. Keep the authorization token for configuration below.# Repository setup
```
$ chmod +x index.js
```For linux, use
```
$ sudo apt-get install chromium
```# Configuration
Create a `config.json` as follows.```json
{
"token": "abcd...",
"cookie": "s%3....",
"projects": [
{
"url": "https://scrapbox.io/testproject/",
"emoji": "🔲"
}
]
}
```Note that `cookie` refers to the `connect.sid` cookie value, and `token` refers to the Discord auth token. To obtain the cookie, simply log in to Scrapbox in your browser and use inspect element. To obtain the token, set up the Bot on Discord, and click Reset Token.
To use a custom chromium distribution, include a property called `executablePath` in `config.json` with the path to the binary.