style: auto-fix ESLint issues (curly braces and formatting)
- Add curly braces to all if/else/for/while statements - Fix indentation and trailing spaces - Auto-fixed 372 linting errors using eslint --fix - Remaining issues are warnings only (non-null assertions, explicit any types)
This commit is contained in:
@@ -146,7 +146,7 @@ export class WhatsAppAdapter implements ChannelAdapter {
|
||||
|
||||
/** Send an outbound message, automatically chunking if it exceeds 4096 chars. */
|
||||
async send(peerId: string, message: OutboundMessage): Promise<void> {
|
||||
if (!this.client) throw new Error('WhatsApp adapter not connected');
|
||||
if (!this.client) {throw new Error('WhatsApp adapter not connected');}
|
||||
|
||||
const text = message.text;
|
||||
|
||||
@@ -169,7 +169,7 @@ export class WhatsAppAdapter implements ChannelAdapter {
|
||||
|
||||
/** Send a single outbound attachment via WhatsApp using MessageMedia. */
|
||||
private async sendAttachment(peerId: string, attachment: OutboundAttachment): Promise<void> {
|
||||
if (!this.client) return;
|
||||
if (!this.client) {return;}
|
||||
|
||||
try {
|
||||
if (attachment.data) {
|
||||
@@ -194,10 +194,10 @@ export class WhatsAppAdapter implements ChannelAdapter {
|
||||
|
||||
/** Internal: process an inbound WhatsApp message. */
|
||||
private async handleMessage(message: WhatsAppMessage): Promise<void> {
|
||||
if (!this.messageHandler) return;
|
||||
if (!this.messageHandler) {return;}
|
||||
|
||||
// Ignore messages from the bot itself
|
||||
if (message.fromMe) return;
|
||||
if (message.fromMe) {return;}
|
||||
|
||||
const from = message.from;
|
||||
|
||||
@@ -223,7 +223,7 @@ export class WhatsAppAdapter implements ChannelAdapter {
|
||||
? message.body?.includes(`@${this.botId.replace(/@c\.us$/, '')}`) ||
|
||||
(message as any).mentionedIds?.some((id: string) => id === this.botId)
|
||||
: false;
|
||||
if (!mentionsBot) return;
|
||||
if (!mentionsBot) {return;}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user