Gated Group
A bot that creates an onboard to a gated NFT group
Structure
gated-group/
├── src/
│   ├── plugins/
│       ├── alchemy.ts
│   ├── skills/
│       ├── gated.ts
│   ├── index.ts
├── package.json
├── tsconfig.json
└── .envAgent
The process that starts listening to messages and replying to them.
src/index.ts
import { agentReply, Context, createAgent } from "@xmtp/message-kit";
 
export const agent = createAgent({
  name: "GPT Bot",
  description: "Use GPT to generate text responses.",
  tag: "@bot",
  onMessage: async (context: Context) => {
    await agentReply(context);
  },
}).run();Plugins
- Alchemy: Interact with Alchemy
 
Skills
- Gated: Create an onboard to a gated NFT group
 
Variables
Set up these variables in your app
cmd
KEY= # the private key of the wallet
TEST_ENCRYPTION_KEY= # a different private key for encryption
OPENAI_API_KEY= # sk-proj-...