mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-13 15:14:49 -06:00
feat: Route to send status broadcast
This commit is contained in:
parent
4bf4b4a045
commit
24712c4c2d
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,6 +12,7 @@ yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
/docker-compose-data
|
||||
/docker-data
|
||||
|
||||
# Package
|
||||
/yarn.lock
|
||||
|
@ -48,6 +48,7 @@ ENV DATABASE_SAVE_DATA_CHATS=$DATABASE_SAVE_DATA_CHATS
|
||||
|
||||
ENV REDIS_ENABLED=$REDIS_ENABLED
|
||||
ENV REDIS_URI=$REDIS_URI
|
||||
ENV REDIS_PREFIX_KEY=$REDIS_PREFIX_KEY
|
||||
|
||||
ENV WEBHOOK_GLOBAL_URL=$WEBHOOK_GLOBAL_URL
|
||||
ENV WEBHOOK_GLOBAL_ENABLED=$WEBHOOK_GLOBAL_ENABLED
|
||||
|
@ -40,10 +40,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/EvolutionAPI/evolution-api#readme",
|
||||
"dependencies": {
|
||||
"@whiskeysockets/baileys": "github:EvolutionAPI/Baileys",
|
||||
"@adiwajshing/keyed-db": "^0.2.4",
|
||||
"@ffmpeg-installer/ffmpeg": "^1.1.0",
|
||||
"@hapi/boom": "^10.0.1",
|
||||
"@whiskeysockets/baileys": "github:EvolutionAPI/Baileys",
|
||||
"axios": "^1.3.5",
|
||||
"class-validator": "^0.13.2",
|
||||
"compression": "^1.7.4",
|
||||
@ -65,6 +65,7 @@
|
||||
"node-cache": "^5.1.2",
|
||||
"node-mime-types": "^1.1.0",
|
||||
"pino": "^8.11.0",
|
||||
"proxy-agent": "^6.2.1",
|
||||
"qrcode": "^1.5.1",
|
||||
"qrcode-terminal": "^0.12.0",
|
||||
"redis": "^4.6.5",
|
||||
|
@ -119,6 +119,7 @@ import { useMultiFileAuthStateRedisDb } from '../../utils/use-multi-file-auth-st
|
||||
import sharp from 'sharp';
|
||||
import { RedisCache } from '../../db/redis.client';
|
||||
import { Log } from '../../config/env.config';
|
||||
import ProxyAgent from 'proxy-agent';
|
||||
|
||||
export class WAStartupService {
|
||||
constructor(
|
||||
@ -1421,16 +1422,27 @@ export class WAStartupService {
|
||||
};
|
||||
}
|
||||
if (status.type === 'audio') {
|
||||
return {
|
||||
content: {
|
||||
audio: {
|
||||
url: status.content,
|
||||
const convert = await this.processAudio(status.content, 'status@broadcast');
|
||||
if (typeof convert === 'string') {
|
||||
const audio = fs.readFileSync(convert).toString('base64');
|
||||
|
||||
const result = {
|
||||
content: {
|
||||
audio: Buffer.from(audio, 'base64'),
|
||||
ptt: true,
|
||||
mimetype: 'audio/mp4',
|
||||
},
|
||||
},
|
||||
option: {
|
||||
statusJidList: status.statusJidList,
|
||||
},
|
||||
};
|
||||
option: {
|
||||
statusJidList: status.statusJidList,
|
||||
},
|
||||
};
|
||||
|
||||
fs.unlinkSync(convert);
|
||||
|
||||
return result;
|
||||
} else {
|
||||
throw new InternalServerErrorException(convert);
|
||||
}
|
||||
}
|
||||
|
||||
throw new BadRequestException('Type not found');
|
||||
|
Loading…
Reference in New Issue
Block a user