generated from dvdksn/clockbox
-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
140 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Chatwoot with Unoapi inbox | ||
|
||
|
||
Up the unoapi service with `https://github.com/clairton/unoapi-cloud/tree/main?tab=readme-ov-file#start-options` or `https://github.com/clairton/unoapi-cloud/#install-as-systemctl`, use version >= 1.17.0 | ||
|
||
|
||
Get the chatwoot in `https://github.com/clairton/chatwoot` ou docker tag `clairton/chatwoot:v3.10.6-uno` change the env `UNOAPI_AUTH_TOKEN` with the same value of unoapi | ||
|
||
Got to inboxes and choose whatsapp | ||
|
||
![image](prints/channel.png) | ||
|
||
Create with provider unoapi | ||
|
||
![image](prints/create.png) | ||
|
||
After save, edit the channel and in tab configuration | ||
|
||
![image](prints/configuration.png) | ||
|
||
Click em connect | ||
|
||
![image](prints/connect.png) | ||
|
||
Read de qrcode | ||
|
||
![image](prints/read.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Broadcast } from '../services/broadcast' | ||
|
||
export class BroacastJob { | ||
private broadcast: Broadcast | ||
|
||
constructor(broadcast: Broadcast) { | ||
this.broadcast = broadcast | ||
} | ||
|
||
async consume(_: string, { phone, type, content }) { | ||
return this.broadcast.send(phone, type, content) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Server } from 'socket.io' | ||
|
||
export class Broadcast { | ||
private server: Server | ||
|
||
public setSever(server: Server) { | ||
this.server = server | ||
} | ||
|
||
public async send(phone: string, type: string, content: string) { | ||
if (!this.server) { | ||
throw 'Set the socket server' | ||
} | ||
await this.server.emit('broadcast', { phone, type, content }) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { amqpEnqueue } from '../amqp' | ||
import { UNOAPI_JOB_BROADCAST } from '../defaults' | ||
import { Broadcast } from './broadcast' | ||
|
||
export class BroadcastAmqp extends Broadcast { | ||
private queueName: string | ||
|
||
constructor(queueName: string = UNOAPI_JOB_BROADCAST) { | ||
super() | ||
this.queueName = queueName | ||
} | ||
|
||
public async send(phone: string, type: string, content: string) { | ||
const payload = { phone, type, content } | ||
await amqpEnqueue(this.queueName, '', payload) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters