cli tools and discord bots

📖 Outline

         ┌────────────────────────────────────────┐
         │            Discord Gateway             │
         └────────────▲────────────┳──────────────┘
                      ┃            ┃
                      s            r
                      e            e    op: 10 Hello
  op: 02 Identify     n            c    op: 00 Ready
  op: 01 Heartbeat    d            v    op: 11 Heartbeat ACK
                      ┃            ┃
             ┌────────┻────────────▼────────┐
   ━━ stdin ━▶ $ websocat wss://gatewa...   ┣━ stdout ━▶
             └──────────────────────────────┘
op: 10 Hello
          ┌────────────────────────────────────────┐
          │            Discord Gateway             │
          └────────────▲────────────┳──────────────┘
                       ┃            ┃
                       s            r
                       e            e    op: 10 Hello
   op: 02 Identify     n            c    op: 00 Ready
   op: 01 Heartbeat    d            v    op: 11 Heartbeat ACK
                       ┃            ┃
              ┌────────┻────────────▼────────┐
    ━━ stdin ━▶  $ websocat wss://gatewa...  ┣━ stdout ━▶
             ▲└──────────────────────────────┘  │
             │                                  │
  discord.ws.send                      discord.ws.recv
             │                                  │
            ┌┴──────────────────────────────────▼─┐
            │         $ xs serve ./store          │
            └─────────────────────────────────────┘

register heartbeat handler

tools used