[NEW] Assign new Livechat conversations to bot agents first (#15317)
* Add a new setting to allow routing new Livechat conversations to Bot Agents first. * Removed invalid console.log.pull/9058/head^2
parent
28e290cc46
commit
0e696d7119
@ -0,0 +1,16 @@ |
||||
|
||||
import { callbacks } from '../../../callbacks'; |
||||
import { settings } from '../../../settings'; |
||||
import { Users, LivechatDepartmentAgents } from '../../../models'; |
||||
|
||||
callbacks.add('livechat.beforeGetNextAgent', (department) => { |
||||
if (!settings.get('Livechat_assign_new_conversation_to_bot')) { |
||||
return null; |
||||
} |
||||
|
||||
if (department) { |
||||
return LivechatDepartmentAgents.getNextBotForDepartment(department); |
||||
} |
||||
|
||||
return Users.getNextBotAgent(); |
||||
}, callbacks.priority.HIGH, 'livechat-before-get-next-agent'); |
||||
Loading…
Reference in new issue