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:
@@ -14,7 +14,7 @@ function createMockClient() {
|
||||
_handlers: handlers,
|
||||
user: null as { id: string; tag: string } | null,
|
||||
on: vi.fn((event: string, handler: (...args: unknown[]) => void) => {
|
||||
if (!handlers.has(event)) handlers.set(event, []);
|
||||
if (!handlers.has(event)) {handlers.set(event, []);}
|
||||
handlers.get(event)!.push(handler);
|
||||
}),
|
||||
login: vi.fn(async (_token: string) => {
|
||||
@@ -23,7 +23,7 @@ function createMockClient() {
|
||||
// Trigger ready event asynchronously
|
||||
setTimeout(() => {
|
||||
const readyHandlers = handlers.get('ready') ?? [];
|
||||
for (const h of readyHandlers) h();
|
||||
for (const h of readyHandlers) {h();}
|
||||
}, 0);
|
||||
}),
|
||||
destroy: vi.fn(),
|
||||
|
||||
@@ -117,7 +117,7 @@ export class DiscordAdapter implements ChannelAdapter {
|
||||
|
||||
/** Send an outbound message, automatically chunking if it exceeds Discord's 2000-char limit. */
|
||||
async send(peerId: string, message: OutboundMessage): Promise<void> {
|
||||
if (!this.client) throw new Error('Discord adapter not connected');
|
||||
if (!this.client) {throw new Error('Discord adapter not connected');}
|
||||
|
||||
const channel = await this.client.channels.fetch(peerId);
|
||||
if (!channel || !('send' in channel)) {
|
||||
@@ -163,10 +163,10 @@ export class DiscordAdapter implements ChannelAdapter {
|
||||
|
||||
/** Internal: process an inbound Discord message. */
|
||||
private handleMessage(message: DiscordMessage): void {
|
||||
if (!this.messageHandler) return;
|
||||
if (!this.messageHandler) {return;}
|
||||
|
||||
// Ignore bot messages
|
||||
if (message.author.bot) return;
|
||||
if (message.author.bot) {return;}
|
||||
|
||||
const isDM = !message.guild;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user