summaryrefslogtreecommitdiff
path: root/src/wasp-event-handlers.el
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2024-04-26 01:53:24 -0400
committerLLLL Colonq <llll@colonq>2024-04-26 01:53:24 -0400
commit6fa49e57f7313aad8852ce2721c2fcf7d0cec030 (patch)
tree34a2e4a851c663bc6d71d148e59b59ba345a5fdb /src/wasp-event-handlers.el
parent782c667e824d426b5443591afeefc37d0ae17785 (diff)
Updates
Diffstat (limited to 'src/wasp-event-handlers.el')
-rw-r--r--src/wasp-event-handlers.el55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/wasp-event-handlers.el b/src/wasp-event-handlers.el
index 6702d3d1..01e68b32 100644
--- a/src/wasp-event-handlers.el
+++ b/src/wasp-event-handlers.el
@@ -2,14 +2,69 @@
;;; Commentary:
;;; Code:
+(require 'soundboard)
(require 'wasp-bus)
(require 'wasp-twitch)
+(require 'wasp-friend)
+(require 'wasp-model)
(setf
w/bus-event-handlers
(list
(cons '(monitor twitch chat incoming) #'w/twitch-handle-incoming-chat)
(cons '(monitor twitch redeem incoming) #'w/twitch-handle-redeem)
+ (cons
+ '(monitor twitch raid)
+ (lambda (msg)
+ (let ((user (car msg)))
+ (soundboard//play-clip "rampage.mp3")
+ (w/write-chat-event (format "%s just raided!" user))
+ (w/friend-respond (format "%s just came to visit" user))
+ (run-with-timer
+ 15 nil
+ (lambda ()
+ (w/twitch-get-user-recent-clips
+ user
+ (lambda (clips)
+ (w/model-region-word "hair" (s-concat user "_"))
+ (w/model-region-word "eyes" "WELCOME")
+ (if clips
+ (w/model-region-video "hair" (car clips))
+ (w/model-region-user-avatar "hair" user)))))))))
+ (cons
+ '(monitor twitch follow)
+ (lambda (msg)
+ (let ((user (car msg)))
+ ;; (soundboard//play-clip "firstblood.mp3")
+ ;; (w/model-region-word "skin" (format "welcome_%s_" user))
+ (w/friend-respond (format "%s just followed the stream" user))
+ ;; (w/write-chat-event (format "New follower: %s" user))
+ )
+ ))
+ (cons
+ '(monitor twitch poll begin)
+ (lambda (_)
+ (w/write-chat-event "Poll started")
+ (w/friend-respond "The chatters are doing a poll")))
+ (cons
+ '(monitor twitch poll end)
+ (lambda (msg)
+ (let ((winner (car (-max-by (-on #'> #'cadr) (cadr msg)))))
+ (w/write-chat-event (format "Poll finished, winner is: %s" winner))
+ (when w/twitch-current-poll-callback
+ (funcall w/twitch-current-poll-callback winner))
+ (setq w/twitch-current-poll-callback nil))))
+ (cons
+ '(monitor twitch prediction begin)
+ (lambda (msg)
+ (w/write-chat-event "Gamble started")
+ (w/friend-respond "The chatters are gambling")
+ (setq w/twitch-current-prediction-ids msg)))
+ (cons
+ '(monitor twitch prediction end)
+ (lambda (_)
+ (w/write-chat-event "Gamble finished")
+ (setq w/twitch-current-prediction-ids nil)))
))
(provide 'wasp-event-handlers)