feat: Integration with Captain (alpha) (#9834)
- Integration with captain (alpha) Co-authored-by: Pranav <pranavrajs@gmail.com>
This commit is contained in:
@@ -129,7 +129,16 @@ class Inbox < ApplicationRecord
|
||||
end
|
||||
|
||||
def active_bot?
|
||||
agent_bot_inbox&.active? || hooks.where(app_id: 'dialogflow', status: 'enabled').count.positive?
|
||||
agent_bot_inbox&.active? || hooks.where(app_id: %w[dialogflow],
|
||||
status: 'enabled').count.positive? || captain_enabled?
|
||||
end
|
||||
|
||||
def captain_enabled?
|
||||
captain_hook = account.hooks.where(
|
||||
app_id: %w[captain], status: 'enabled'
|
||||
).first
|
||||
|
||||
captain_hook.present? && captain_hook.settings['inbox_ids'].split(',').include?(id.to_s)
|
||||
end
|
||||
|
||||
def inbox_type
|
||||
|
||||
Reference in New Issue
Block a user