Skip to content

Commit 3541d0f

Browse files
committed
ignore haiku not in channel
1 parent a15cade commit 3541d0f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/interactions/haiku/notice_poetry.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ def self.call(event)
2222
return unless haiku
2323

2424
global_react(event, "haiku")
25-
reply_in_thread(event, Orpheus.transcript("haiku.template", { haiku:, user: }))
25+
begin
26+
reply_in_thread(event, Orpheus.transcript("haiku.template", { haiku:, user: }))
27+
rescue Slack::Web::Api::Errors::NotInChannel
28+
Orpheus.logger.info("[haiku] not in channel: #{event[:channel]}")
29+
return
30+
end
2631

2732
unless Orpheus.kv.get("haiku_hinted_#{user}")
2833
reply_ephemerally(event, Orpheus.transcript("haiku.optout_hint"), threaded: true)

0 commit comments

Comments
 (0)