File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ yarn-error.log*
1212lerna-debug.log *
1313
1414/docker-compose-data
15+ /docker-data
1516
1617# Package
1718/yarn.lock
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ ENV DATABASE_SAVE_DATA_CHATS=$DATABASE_SAVE_DATA_CHATS
4848
4949ENV REDIS_ENABLED=$REDIS_ENABLED
5050ENV REDIS_URI=$REDIS_URI
51+ ENV REDIS_PREFIX_KEY=$REDIS_PREFIX_KEY
5152
5253ENV WEBHOOK_GLOBAL_URL=$WEBHOOK_GLOBAL_URL
5354ENV WEBHOOK_GLOBAL_ENABLED=$WEBHOOK_GLOBAL_ENABLED
Original file line number Diff line number Diff line change 4040 },
4141 "homepage" : " https://github.com/EvolutionAPI/evolution-api#readme" ,
4242 "dependencies" : {
43- "@whiskeysockets/baileys" : " github:EvolutionAPI/Baileys" ,
4443 "@adiwajshing/keyed-db" : " ^0.2.4" ,
4544 "@ffmpeg-installer/ffmpeg" : " ^1.1.0" ,
4645 "@hapi/boom" : " ^10.0.1" ,
46+ "@whiskeysockets/baileys" : " github:EvolutionAPI/Baileys" ,
4747 "axios" : " ^1.3.5" ,
4848 "class-validator" : " ^0.13.2" ,
4949 "compression" : " ^1.7.4" ,
6565 "node-cache" : " ^5.1.2" ,
6666 "node-mime-types" : " ^1.1.0" ,
6767 "pino" : " ^8.11.0" ,
68+ "proxy-agent" : " ^6.2.1" ,
6869 "qrcode" : " ^1.5.1" ,
6970 "qrcode-terminal" : " ^0.12.0" ,
7071 "redis" : " ^4.6.5" ,
Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ import { useMultiFileAuthStateRedisDb } from '../../utils/use-multi-file-auth-st
119119import sharp from 'sharp' ;
120120import { RedisCache } from '../../db/redis.client' ;
121121import { Log } from '../../config/env.config' ;
122+ import ProxyAgent from 'proxy-agent' ;
122123
123124export class WAStartupService {
124125 constructor (
@@ -1421,16 +1422,27 @@ export class WAStartupService {
14211422 } ;
14221423 }
14231424 if ( status . type === 'audio' ) {
1424- return {
1425- content : {
1426- audio : {
1427- url : status . content ,
1425+ const convert = await this . processAudio ( status . content , 'status@broadcast' ) ;
1426+ if ( typeof convert === 'string' ) {
1427+ const audio = fs . readFileSync ( convert ) . toString ( 'base64' ) ;
1428+
1429+ const result = {
1430+ content : {
1431+ audio : Buffer . from ( audio , 'base64' ) ,
1432+ ptt : true ,
1433+ mimetype : 'audio/mp4' ,
14281434 } ,
1429- } ,
1430- option : {
1431- statusJidList : status . statusJidList ,
1432- } ,
1433- } ;
1435+ option : {
1436+ statusJidList : status . statusJidList ,
1437+ } ,
1438+ } ;
1439+
1440+ fs . unlinkSync ( convert ) ;
1441+
1442+ return result ;
1443+ } else {
1444+ throw new InternalServerErrorException ( convert ) ;
1445+ }
14341446 }
14351447
14361448 throw new BadRequestException ( 'Type not found' ) ;
You can’t perform that action at this time.
0 commit comments