Skip to content

Commit 98ca027

Browse files
committed
fix: remove goku fallback image, env variable renamed
1 parent c433dc4 commit 98ca027

File tree

6 files changed

+14
-19
lines changed

6 files changed

+14
-19
lines changed
-13.2 MB
Binary file not shown.

packages/client-instagram/src/environment.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ export async function validateInstagramConfig(
9090
),
9191

9292
INSTAGRAM_ENABLE_ACTION_PROCESSING: parseBooleanFromText(
93-
runtime.getSetting("ENABLE_ACTION_PROCESSING") ||
94-
process.env.ENABLE_ACTION_PROCESSING
93+
runtime.getSetting("INSTAGRAM_ENABLE_ACTION_PROCESSING") ||
94+
process.env.INSTAGRAM_ENABLE_ACTION_PROCESSING
9595
) ?? false,
9696

9797
INSTAGRAM_ACTION_INTERVAL: parseInt(
98-
runtime.getSetting("ACTION_INTERVAL") ||
99-
process.env.ACTION_INTERVAL ||
98+
runtime.getSetting("INSTAGRAM_ACTION_INTERVAL") ||
99+
process.env.INSTAGRAM_ACTION_INTERVAL ||
100100
DEFAULT_ACTION_INTERVAL.toString(),
101101
10
102102
),

packages/client-instagram/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const InstagramClientInterface: Client = {
2525
await postService.start();
2626
elizaLogger.log("Instagram post service started");
2727

28-
if (config.ENABLE_ACTION_PROCESSING) {
28+
if (config.INSTAGRAM_ENABLE_ACTION_PROCESSING) {
2929
await interactionService.start();
3030
elizaLogger.log("Instagram interaction service started");
3131
}

packages/client-instagram/src/lib/auth.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function authenticate(
3838

3939
// Proceed with fresh login
4040
try {
41-
const loggedInUser = await ig.account.login(
41+
await ig.account.login(
4242
config.INSTAGRAM_USERNAME,
4343
config.INSTAGRAM_PASSWORD
4444
);

packages/client-instagram/src/lib/media.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ export async function fetchRecentMedia(
1414
const feed = ig.feed.user(ig.state.cookieUserId);
1515
const items = await feed.items();
1616

17-
return items.slice(0, count).map(item => ({
17+
return items.slice(0, count).map((item: any) => ({
1818
id: item.id,
1919
mediaType: item.media_type as MediaItem['mediaType'],
2020
mediaUrl: item.media_url,
21-
thumbnailUrl: item.thumbnail_url,
21+
thumbnailUrl: item.thumbnail_url || null,
2222
permalink: item.permalink,
23-
caption: item.caption?.text,
23+
caption: item.caption?.text || null,
2424
timestamp: item.timestamp,
25-
children: item.children?.map(child => ({
25+
children: item.children?.map((child: any) => ({
2626
id: child.id,
2727
mediaType: child.media_type as MediaItem['mediaType'],
2828
mediaUrl: child.media_url,
29-
thumbnailUrl: child.thumbnail_url,
29+
thumbnailUrl: child.thumbnail_url || null,
3030
permalink: child.permalink,
3131
timestamp: child.timestamp
32-
}))
32+
})) || null
3333
}));
3434
} catch (error) {
3535
elizaLogger.error('Error fetching recent media:', error);

packages/client-instagram/src/services/post.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// src/services/post.ts
22
import { IAgentRuntime, ModelClass, composeContext, elizaLogger, generateImage, generateText, getEmbeddingZeroVector, stringToUuid } from "@elizaos/core";
33
import { promises as fs } from 'fs';
4-
import path, { dirname } from "path";
4+
import path from "path";
55
import sharp from 'sharp';
6-
import { fileURLToPath } from 'url';
76
import { getIgClient } from "../lib/state";
87
import { InstagramState } from "../types";
98

@@ -223,11 +222,7 @@ export class InstagramPostService {
223222
stack: error instanceof Error ? error.stack : undefined,
224223
phase: 'getOrGenerateImage'
225224
});
226-
227-
// Fallback to default image if generation fails
228-
const __filename = fileURLToPath(import.meta.url);
229-
const __dirname = dirname(__filename);
230-
return path.resolve(__dirname, '../assets/goku.png');
225+
throw error;
231226
}
232227
}
233228

0 commit comments

Comments
 (0)