Skip to content

Commit

Permalink
fix: unused declaration of var
Browse files Browse the repository at this point in the history
  • Loading branch information
shakkernerd committed Jan 16, 2025
1 parent 4f5c05d commit 0c55316
Show file tree
Hide file tree
Showing 2 changed files with 377 additions and 335 deletions.
90 changes: 46 additions & 44 deletions packages/client-instagram/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,52 @@ import { InstagramInteractionService } from "./services/interaction";
import { InstagramPostService } from "./services/post";

export const InstagramClientInterface: Client = {
async start(runtime: IAgentRuntime) {
try {
// Validate configuration
const config = await validateInstagramConfig(runtime);
elizaLogger.log("Instagram client configuration validated");

// Initialize client and get initial state
const state = await initializeClient(runtime, config);
elizaLogger.log("Instagram client initialized");

// Create services
const postService = new InstagramPostService(runtime, state);
const interactionService = new InstagramInteractionService(runtime, state);

// Start services
if (!config.INSTAGRAM_DRY_RUN) {
await postService.start();
elizaLogger.log("Instagram post service started");

if (config.INSTAGRAM_ENABLE_ACTION_PROCESSING) {
await interactionService.start();
elizaLogger.log("Instagram interaction service started");
async start(runtime: IAgentRuntime) {
try {
// Validate configuration
const config = await validateInstagramConfig(runtime);
elizaLogger.log("Instagram client configuration validated");

// Initialize client and get initial state
const state = await initializeClient(runtime, config);
elizaLogger.log("Instagram client initialized");

// Create services
const postService = new InstagramPostService(runtime, state);
const interactionService = new InstagramInteractionService(
runtime,
state
);

// Start services
if (!config.INSTAGRAM_DRY_RUN) {
await postService.start();
elizaLogger.log("Instagram post service started");

if (config.INSTAGRAM_ENABLE_ACTION_PROCESSING) {
await interactionService.start();
elizaLogger.log("Instagram interaction service started");
}
} else {
elizaLogger.log("Instagram client running in dry-run mode");
}

// Return manager instance
return {
post: postService,
interaction: interactionService,
state,
};
} catch (error) {
elizaLogger.error("Failed to start Instagram client:", error);
throw error;
}
} else {
elizaLogger.log("Instagram client running in dry-run mode");
}

// Return manager instance
return {
post: postService,
interaction: interactionService,
state
};

} catch (error) {
elizaLogger.error("Failed to start Instagram client:", error);
throw error;
}
},

async stop(runtime: IAgentRuntime) {
elizaLogger.log("Stopping Instagram client services...");
// Cleanup will be handled by the services themselves
}
},

async stop(_runtime: IAgentRuntime) {
elizaLogger.log("Stopping Instagram client services...");
// Cleanup will be handled by the services themselves
},
};

export default InstagramClientInterface;
export default InstagramClientInterface;
Loading

0 comments on commit 0c55316

Please sign in to comment.