mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-27 07:37:44 -06:00
refactor(chatbot): streamline media message handling across chatbot services
- Removed redundant instance name references in EvolutionStartupService to enhance data consistency. - Updated media message processing in various chatbot services to utilize base64 and mediaUrl more effectively, ensuring better handling of image messages. - Improved overall code readability and maintainability by simplifying media handling logic.
This commit is contained in:
@@ -331,7 +331,6 @@ export class EvolutionStartupService extends ChannelStartupService {
|
||||
messageTimestamp: Math.round(new Date().getTime() / 1000),
|
||||
webhookUrl,
|
||||
source: 'unknown',
|
||||
instanceName: this.instance.name,
|
||||
instanceId: this.instanceId,
|
||||
};
|
||||
} else if (message?.mediaType === 'video') {
|
||||
@@ -346,7 +345,6 @@ export class EvolutionStartupService extends ChannelStartupService {
|
||||
messageTimestamp: Math.round(new Date().getTime() / 1000),
|
||||
webhookUrl,
|
||||
source: 'unknown',
|
||||
instanceName: this.instance.name,
|
||||
instanceId: this.instanceId,
|
||||
};
|
||||
} else if (message?.mediaType === 'audio') {
|
||||
@@ -361,7 +359,6 @@ export class EvolutionStartupService extends ChannelStartupService {
|
||||
messageTimestamp: Math.round(new Date().getTime() / 1000),
|
||||
webhookUrl,
|
||||
source: 'unknown',
|
||||
instanceName: this.instance.name,
|
||||
instanceId: this.instanceId,
|
||||
};
|
||||
|
||||
@@ -383,7 +380,6 @@ export class EvolutionStartupService extends ChannelStartupService {
|
||||
messageTimestamp: Math.round(new Date().getTime() / 1000),
|
||||
webhookUrl,
|
||||
source: 'unknown',
|
||||
instanceName: this.instance.name,
|
||||
instanceId: this.instanceId,
|
||||
};
|
||||
} else if (message.buttonMessage) {
|
||||
@@ -400,7 +396,6 @@ export class EvolutionStartupService extends ChannelStartupService {
|
||||
messageTimestamp: Math.round(new Date().getTime() / 1000),
|
||||
webhookUrl,
|
||||
source: 'unknown',
|
||||
instanceName: this.instance.name,
|
||||
instanceId: this.instanceId,
|
||||
};
|
||||
} else if (message.listMessage) {
|
||||
@@ -414,7 +409,6 @@ export class EvolutionStartupService extends ChannelStartupService {
|
||||
messageTimestamp: Math.round(new Date().getTime() / 1000),
|
||||
webhookUrl,
|
||||
source: 'unknown',
|
||||
instanceName: this.instance.name,
|
||||
instanceId: this.instanceId,
|
||||
};
|
||||
} else {
|
||||
@@ -428,7 +422,6 @@ export class EvolutionStartupService extends ChannelStartupService {
|
||||
messageTimestamp: Math.round(new Date().getTime() / 1000),
|
||||
webhookUrl,
|
||||
source: 'unknown',
|
||||
instanceName: this.instance.name,
|
||||
instanceId: this.instanceId,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user