FlowBot

Flow-powered Discord bot: Create accounts, check balances, send tokens via slash commands

FlowBot

Created At

ETHGlobal New Delhi

Project Description

This Flow‑first Discord bot transforms community chatter into verifiable on‑chain actions by collapsing onboarding and first transactions into guided slash commands that run entirely inside Discord, solving the core problems of context‑switching, faucet friction, and low conversion from interest to activity. Built with discord.js v14, Node.js, and an Express API, it uses MongoDB/Mongoose for user–address mapping and custody metadata, while @onflow/fcl powers Cadence queries and transactions for account creation, faucet funding, FLOW transfers, balance checks, and demo NFT flows with sealed‑status reporting and compute‑limit guards. Security is treated as a feature: AES‑GCM encryption for private keys at rest, role‑gated commands, least‑privilege intents, helmet/cors/rate‑limit hardening, redacted logs, and ephemeral responses for privacy. The architecture is modular—command handlers, domain‑based API routes (account, wallet, balance, transaction), and a Flow service layer for argument encoding, submission, and status polling—backed by structured logging, a health endpoint, graceful shutdown, and an environment‑driven config for quick testnet/mainnet toggles. For ecosystem growth, it provides a repeatable playbook to activate, educate, and measure users with KPIs like time‑to‑first‑tx and sealed‑tx success, and a roadmap for multi‑asset templates, partner contract hooks, quest frameworks, analytics dashboards, and optional KMS‑backed key management.

How it's Made

Think of this bot like building a bridge between two worlds - Discord (where people chat) and Flow blockchain (where crypto magic happens). Here's how we made it work:

The Brain (Node.js + Discord.js) We started with Discord.js, which is like a translator that helps our code understand Discord. The main bot listens for slash commands (those / commands you type) and responds with beautiful message cards and buttons. When someone types /create-account, it's like knocking on the bot's door.

The Commands (Modular Design) Each command is its own mini-program. The /create-account command is like a helpful assistant - it checks if you already have an account, shows you a confirmation screen with clickable buttons, and guides you through each step with progress bars and status updates. It's designed to feel natural and friendly, not robotic.

The Flow Connection (FCL Library) We used Flow's FCL library to talk to the blockchain. This is where the real crypto work happens - generating wallet keys, checking balances, and sending transactions. It's like having a secure phone line directly to Flow's network. The bot can create new wallets, check how much FLOW someone has, and even send money between accounts.

The Memory (MongoDB Database) We needed somewhere safe to remember who's who. MongoDB stores the connection between Discord usernames and Flow wallet addresses. Think of it like a secure address book that never forgets. Private keys are encrypted (scrambled) so even if someone peeked, they couldn't steal anything.

The Security Layer Security was huge for us. Private keys get encrypted before storage, sensitive information gets sent as private messages that auto-delete, and we built rate limits so no one can spam the system. It's like having multiple locks on every door.

The User Experience When you use the bot, it feels conversational. Rich colored message cards show your progress, buttons let you confirm actions, and if something goes wrong, it explains what happened in plain English. We even send your private key as a private message so only you can see it.

background image mobile

Join the mailing list

Get the latest news and updates