mirror of
https://github.com/kiranshila/Doplarr.git
synced 2026-03-31 06:24:10 -04:00
Send message to channel that item has been requested
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
(defn request [payload media-type]
|
||||
(a/go
|
||||
(let [{:keys [format id season season-count discord-id]} payload
|
||||
{:keys [default-id]} env
|
||||
{:overseerr/keys [default-id]} env
|
||||
details (a/<! (impl/details id media-type))
|
||||
ovsr-id ((a/<! (impl/discord-users)) discord-id)
|
||||
status (impl/media-status details media-type
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
:type (interaction-types (:type interaction))
|
||||
:token (:token interaction)
|
||||
:user-id (s/select-one [:member :user :id] interaction)
|
||||
:channel-id (:channel-id interaction)
|
||||
:payload
|
||||
{:component-type (component-types (get-in interaction [:data :component-type]))
|
||||
:component-id (s/select-one [:data :custom-id] interaction)
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
(defmethod process-event! "request" [_ interaction uuid format]
|
||||
(let [{:keys [messaging bot-id]} @state/discord
|
||||
{:keys [payload media-type token]} (get @state/cache uuid)
|
||||
{:keys [user-id]} interaction]
|
||||
{:keys [user-id channel-id]} interaction]
|
||||
(letfn [(msg-resp [msg] (->> @(m/edit-original-interaction-response! messaging bot-id token (discord/content-response msg))
|
||||
(else #(fatal % "Error in message response"))))]
|
||||
(->> (log-on-error
|
||||
@@ -109,7 +109,9 @@
|
||||
:processing (msg-resp "This is currently processing and should be available soon!")
|
||||
:available (msg-resp "This selection is already available!")
|
||||
(do
|
||||
#_(m/create-message! messaging)
|
||||
(m/create-message! messaging channel-id
|
||||
:content
|
||||
(str "<@" user-id "> has requested the " (name media-type) " " (:title payload) " and it should be available soon!"))
|
||||
(msg-resp "Request performed!")))))
|
||||
(else (fn [e]
|
||||
(let [{:keys [status body] :as data} (ex-data e)]
|
||||
|
||||
Reference in New Issue
Block a user