bots
Use when building Towns Protocol bots - covers SDK initialization, slash commands, message handlers, reactions, interactive forms, blockchain operations, and deployment. Triggers: "towns bot", "makeTownsBot", "onSlashCommand", "onMessage", "sendInteractionRequest", "webhook", "bot deployment", "@towns-protocol/bot"
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/andreyz/towns-protocolWhat This Skill Does
The Towns Protocol bot skill provides a comprehensive toolkit for developers to build, deploy, and manage intelligent agents within the Towns decentralized messaging ecosystem. It streamlines the integration of blockchain operations, interactive user interfaces, and custom event handlers using the official @towns-protocol/bot SDK. Whether you are building an automated community moderator, a token-gated DAO assistant, or an interactive transaction helper, this skill manages the complexities of the two-wallet architecture, message threading, and secure interaction requests required for production-grade Towns applications.
Installation
To integrate this skill, use the ClawHub CLI: clawhub install openclaw/skills/skills/andreyz/towns-protocol. After installation, ensure you have initialized your project using bunx towns-bot init my-bot. You must configure your APP_PRIVATE_DATA and JWT_SECRET environment variables. Ensure the bot's gas wallet (associated with bot.viem.account.address) is adequately funded with Base ETH, as all on-chain transactions require network fees to be processed successfully.
Use Cases
- Automated Moderation: Deploy bots that monitor channel activity, verify user permissions via
hasAdminPermission, and execute ban/unban commands based on custom logic. - Token-Gated Community Tools: Build bots that verify asset ownership on-chain before granting access to exclusive channels or threads.
- Transaction Facilitation: Create interactive forms using
sendInteractionRequestto allow users to sign transactions or approve contract calls directly within the chat interface. - Community Management: Implement scheduled announcements, reward distribution, and automated onboarding flows for new DAO members.
Example Prompts
- "towns bot: create a new slash command named 'verify' that checks if the user holds at least 100 TNS tokens before replying."
- "makeTownsBot: set up a message handler that listens for @mentions, ensures the mention includes the correct <@{userId}> format, and replies in a thread."
- "towns bot: guide me through the deployment process for my bot on Render, specifically how to handle environment variable injection for my private credentials."
Tips & Limitations
- Safety First: Always verify that
receipt.status === 'success'when performing blockchain operations. Do not assume atxHashimplies success. - Wallet Architecture: Remember that the gas wallet and the treasury wallet (appAddress) serve distinct purposes. Only use the gas wallet for paying network fees.
- Interaction Handling: Slash commands and message handlers are strictly separate. Do not expect
onMessageto capture input from slash command triggers. - Mentions: You must always include the
mentionsarray in your options when using the<@{userId}>syntax, or the client will not render the mention correctly.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-andreyz-towns-protocol": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, external-api, code-execution