Skip to content

Commit

Permalink
add callback
Browse files Browse the repository at this point in the history
  • Loading branch information
tcm390 committed Jan 12, 2025
1 parent ae42629 commit 96b5d09
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/plugin-nft-collections/src/actions/get-collections.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { State } from "@elizaos/core";
import { HandlerCallback } from "@elizaos/core";
import { Action, IAgentRuntime, Memory, Provider } from "@elizaos/core";

export const getCollectionsAction = (
Expand All @@ -13,12 +15,21 @@ export const getCollectionsAction = (
.toLowerCase()
.includes("nft collections");
},
handler: async (runtime: IAgentRuntime, message: Memory) => {
handler: async (
runtime: IAgentRuntime,
message: Memory,
state: State,
options: any,
callback: HandlerCallback
) => {
try {
const response = await nftCollectionProvider.get(
runtime,
message
);
callback({
text: response,
});
await runtime.messageManager.createMemory({
id: message.id,
content: { text: response },
Expand Down

0 comments on commit 96b5d09

Please sign in to comment.