Estou usando o seguinte pacote [https://unpkg.com/blip-chat-widget]
E cada vez que o usuário fosse começar um atendimento via chat, gostaria de mostrar o tempo médio de espera.
O código para criação do chat é o seguinte
> var chat = new BlipChat()
> .withAppKey('minha_api_key')
> .withButton({
> "color": "#00af86",
> "icon":"https://s3-sa-east-1.amazonaws.com/msging.net/iris/Media_c9fd19cc-ee3d-47c5-8c97-52cd85367bd6"
> })
> .withAuth({
> authType: BlipChat.DEV_AUTH,
> userIdentity: '{{Auth::user()->id}}',
> userPassword: '{{Auth::user()->id}}',
> })
> .withAccount({
> photoUri: '{{Auth::user()->foto}}',
> fullName: '{{Auth::user()->name}}',
> email: '{{Auth::user()->email}}',
> phoneNumber: '{{Auth::user()->child()->telefone}}',
> city: '{{Auth::user()->child()->cidade->nome}}',
> extras: {
> tipo: '{{Auth::user()->tipo}}',
> gestor: '{{is_object(Auth::user()->child()->admins) ? (Auth::user()->child()->admins->first() ? Auth::user()->child()->admins->first()->name : '-') : '-'}}',
> }
> })
> .withEventHandler(BlipChat.ENTER_EVENT, function() {
> console.log('enter')
> })
> .withEventHandler(BlipChat.LEAVE_EVENT, function() {
> console.log('leave')
> })
> .withEventHandler(BlipChat.LOAD_EVENT, function() {
> console.log('chat loaded')
>
> })
> .withEventHandler(BlipChat.CREATE_ACCOUNT_EVENT, function() {
> console.log('account created')
> });
> chat.build();
> });
Na documentação, gostaria de uma função como essa, para conseguir pegar as métricas do meu chat
client.sendCommand({
id: Lime.Guid(),
to: "[email protected]",
method: "get",
uri: "/monitoring/tickets?version=2"
})
Para consegui