summaryrefslogtreecommitdiff
path: root/src/wasp-event-handlers-binary.el
blob: 2698d68680d80ea5056bf38c086b96570cbc5899 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
;;; wasp-event-handlers-binary --- Event handlers -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:

(require 'dash)
(require 's)
(require 'wasp-utils)
(require 'wasp-twitch)
(require 'wasp-bus-binary)

(setf
  w/bus-binary-event-handlers
  (list
    (cons "monitor twitch chat incoming"
      (lambda (d)
        (-let [(user stags msg) (s-split-up-to " " (w/utf8 d) 2)]
          (w/twitch-handle-incoming-chat
            user
            (--map (s-split "\t" it) (s-split "\n" stags))
            msg))))
    (cons "frontend redeem incoming"
      (lambda (d)
        (-let [(user redeem input) (s-split-up-to "\t" (w/utf8 d) 2)]
          (w/twitch-handle-redeem-helper user redeem input 1000))))
    ))

(provide 'wasp-event-handlers-binary)
;;; wasp-event-handlers-binary.el ends here