Skip to content

Scrappy is the Discord bot that posts updates from scrapbook.kisk.cz to our Discord community.

License

Notifications You must be signed in to change notification settings

kisk-muni/scrappy-discord-bot

Repository files navigation

Scrappy

Scrappy is the Discord bot that posts updates from scrapbook.kisk.cz to our Discord community.

Scrappy is powered by Discord.js, Express.js, Supabase Postgres database and runs on Digitalocean’s App Platform.

Geting started

At this point we develop Scrappy on production database and make sure that all testing is done in private channel, so community members don’t notice.

To get into development, please reach out to @eventually-consistent on our Discord community. You will be provided with access to the database and Discord application.

Useful resources:

  • Discord.js Guide - covers the most common Discord bot scenarios with code examples
  • Next.js Discord Bot - battle tested Discord.js bot that powers Next.js community and has small codebase
  • Hack Clubs’s Scrappy - our spiritual ancestor with lots of social learning infrastructuring work and experience
  1. install dependencies
npm i
  1. set environmental variables
cp .env.example .env
  1. run local development server
npm run dev

Useful snippets

invoke post synchronization

curl --request POST \
  --url 'http://localhost:3000/sync-post?env=development' \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "type": "INSERT",
    "table": "portfolio_posts",
    "schema": "public",
    "record": {
       "created_at": "2022-11-20 19:48:24.495018+00",
       "title": "Reflexe: Connectivism: A Learning Theory for the Digital Age",
       "url": "https://daliborcernocky.wordpress.com/2020/11/22/reflexe-connectivism-a-learning-theory-for-the-digital-age/",
       "description": "Siemens, G. (2015). Connectivism: A Learning Theory for the Digital Age: A knowledge learning theory for the digital age? International Journal &#8230; <a class=\"more-link\" href=\"https://daliborcernocky.wordpress.com/2020/11/22/reflexe-connectivism-a-learning-theory-for-the-digital-age/\">Další</a>",
       "published_at": "2023-02-25 19:43:05+00",
       "id": "non-existing-id",
       "portfolio_id": "bc1cf22a-f2d9-4bcd-8e44-f3286f33b40d",
       "thumbnail_url": "",
       "discord_message_id": ""
     },
     "old_record": null
   }'

re-collect message reactions in scrapbook channel

curl --request POST \
  --url 'http://localhost:3000/collect-old-reactions' \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json'

Origin of Scrappy

Scrappy is a Discord sibling of Hack Clubs’s Slack bot Scrappy.

About

Scrappy is the Discord bot that posts updates from scrapbook.kisk.cz to our Discord community.

Topics

Resources

License

Stars

Watchers

Forks