Towns Protocol (@TownsProtocol) header
Towns Protocol (@TownsProtocol) profile picture

The Blockchain for Communication. Built on @base Powers apps like @townsapp @rodeo and @SendItTech $TOWNS 🦫

Joined December 2023
Photo by Towns Protocol (@TownsProtocol)Photo by Towns Protocol (@TownsProtocol)Photo by Towns Protocol (@TownsProtocol)Photo by Towns Protocol (@TownsProtocol)Photo by Towns Protocol (@TownsProtocol)Photo by Towns Protocol (@TownsProtocol)Photo by Towns Protocol (@TownsProtocol)Photo by Towns Protocol (@TownsProtocol)Photo by Towns Protocol (@TownsProtocol)Photo by Towns Protocol (@TownsProtocol)
Introducing Towns Academy 🏫 Discover a dynamic hub where anyone can dive into creating bots with Towns Protocol. Start with a intro course or use AI to vibe-code whatever you can imagine. Let's explore what’s new 👨🏻‍💻
17
15
5
106
44,111
Fuel the right address: If your bot can't pay for gas, its onchain actions stop. Build: Check your Towns bot's balance with bot.viem.getBalance, then send ETH to bot.appAddress, not bot.botId. $TOWNS
4
6
722
Skip the wallet hunt: Your miniapp opens inside Towns. So can the wallet it asks for. Build: Use wallet.getEthereumProvider in your Towns miniapp to get an Ethereum provider for the Towns Smart Wallet. $TOWNS
1
1
707
Know how old the list is: A quick roster is useful. Just don't treat it as live. Build: Use bot.snapshot.getSpaceMemberships in your Towns bot for a member list. Snapshot data is cached and may not reflect the latest state. $TOWNS
7
3
824
Silent bot? Check four things: Before you rewrite the logic, check the setup. Build: Confirm your Towns bot's credentials, webhook URL, Space install and forwarding mode, then curl /health. $TOWNS
4
1
722
Remember past the restart: If your bot forgets every setup, people have to start over. Build: Store your Towns bot's settings in a database. In-memory Map or Set storage only works on always-on servers. $TOWNS
3
1
770
Follow the deletion: If someone deletes their question, don't leave your bot's answer behind. Build: Use onRedaction in your Towns bot to get the deleted message's refEventId, then remove your reply with removeEvent. $TOWNS
3
832
Check before you act: Make sure the person asking can do what your bot is about to do. Build: Use checkPermission in your Towns bot to confirm a permission, like Permission.PinMessage, before running the command. $TOWNS
6
1
1,102
Let a reaction do the work: A quick ✅ can be the signal your bot acts on. Build: Use onReaction in your Towns bot to act on a reaction and the messageId it was added to. $TOWNS
4
2
938
Show how it works: Bring your walkthrough into the conversation. Build: Send an MP4 from your Towns bot as a chunked media attachment. $TOWNS
2
3
1,119
Keep the answer with the question: Make it clear what your bot is responding to. Build: Set replyId in bot.sendMessage options to reply to a specific message. $TOWNS
6
3
1,313
Plans change: Keep your bot's announcement useful when the details move. Build: Use bot.editMessage to update an existing message with new content. $TOWNS
5
1
1,448
Don't hide a failed send: Show people when their message action fails. Build: Use isError and error from useSendMessage to make failures visible in your Towns client. $TOWNS
4
4
1,499
Open the full story: Give people a way past the summary. Build: Use actions.openUrl in your Towns miniapp to open the full reference in a new window. $TOWNS
1
1
1,121
Let the feedback show: Put reactions beside the message that earned them. Build: Use useReactions to read reactions by message event ID in your Towns client. $TOWNS
3
2
1,195
Ask for a signature: Let people sign a message through your Towns bot, without executing a transaction. Build: Set the interaction type to 'signature'. $TOWNS
4
1
2
1,499
A way back in: Give people a place to find their existing DMs. Build: Use useUserDms to list the current user's DM streams in your Towns client. $TOWNS
3
1
1,174
Don't make people guess: Show when your Towns client is connecting and when it's connected. Build: Use the connection flags from useAgentConnection to make that state visible. (docs.towns.com/build/react-s…) $TOWNS
4
2
1,149
Give the task an ending: Make it clear when people are finished in your miniapp. Build: Use actions.close to give them a clear way out. (docs.towns.com/build/miniapp…) $TOWNS
1
3
1,126
A better first hello: Help new arrivals find their footing. Build: Use onChannelJoin to trigger a welcome message. Requires All Messages forwarding mode. (docs.towns.com/build/bots/ev…) $TOWNS
4
2
1,158
Thanks, with value attached: Make the helpful answer worth more than a reaction. Build: Use sendTip in your Towns bot to tip a user on a specific message. (docs.towns.com/build/bots/ev…) $TOWNS
4
7
1,462