Collab.Land Integration (Token-Gated Access)
Collab.Land is a Discord and Telegram bot that checks token/NFT ownership and automatically assigns roles. Integration takes hours but requires understanding token verification and supported condition types.
How Token-Gating Works via Collab.Land
Simple scheme: user enters Discord → clicks "Verify" → signs message via wallet (no transaction, free) → Collab.Land checks on-chain balance → assigns role.
Supported asset types:
- ERC-20: minimum token balance
- ERC-721: NFT ownership from collection, specific tokenId or trait-based
- ERC-1155: ownership of specific token ID
- Multichain: Ethereum, Polygon, Base, Arbitrum, Optimism, BSC and others
Setup via Collab.Land Command Center
Collab.Land has web interface at cc.collab.land for managing Token Access Rules (TAR):
Step 1: Invite bot to Discord server. Grant role management rights.
Step 2: In Command Center create new rule:
- Type: ERC-20 / ERC-721 / ERC-1155
- Chain: select network
- Contract address: token/NFT address
- Minimum balance: amount needed for role
- Discord role: which role to assign
Step 3: Users go to #collabland-join and click "Let's Go".
For ERC-721 with trait-based conditions (e.g., NFT with "Gold member" attribute) — use Collab.Land API or SYNTHETIC token rule.
Custom Integration via API
For non-standard conditions (balances across wallets, staked tokens, LP positions) use Collab.Land Miniapp or custom API.
// Webhook for custom verification
interface CollabLandWebhook {
action: "CHECK_ROLES";
payload: {
address: string; // user wallet
discordId: string;
guildId: string;
};
}
interface RolesResponse {
roles: string[]; // Discord role IDs to assign
}
// Express endpoint
app.post("/collab-land/check-roles", async (req, res) => {
const { payload } = req.body as CollabLandWebhook;
// Custom logic: check staked balance, LP positions, etc.
const stakedBalance = await getStakedBalance(payload.address);
const lpBalance = await getLPBalance(payload.address);
const roles: string[] = [];
if (stakedBalance >= 1000e18) roles.push(DISCORD_ROLE_STAKER);
if (lpBalance >= 100e18) roles.push(DISCORD_ROLE_LP_PROVIDER);
res.json({ roles });
});
Supporting Staked and Locked Tokens
Standard problem: user stakes tokens and loses role because ERC-20 balance becomes 0. Solutions:
Option 1 — Staking Receipt Token: minting gives receipt ERC-20 (stTOKEN). Collab.Land checks receipt balance — staker keeps role.
Option 2 — Custom Miniapp: Collab.Land Miniapp lets write TypeScript function checking any on-chain state — staking contract balance, Uniswap V3 NFT positions, etc.
// Collab.Land Miniapp — custom check
import { TokenBalanceRule } from "@collabland/discord";
export async function checkBalance(
address: string,
chainId: number
): Promise<bigint> {
// Sum of native + staked balance
const stakingContract = getContract(STAKING_ADDRESS, chainId);
const [walletBalance, stakedBalance] = await Promise.all([
token.balanceOf(address),
stakingContract.stakedBalanceOf(address)
]);
return walletBalance + stakedBalance;
}
Collab.Land is mature with support for most token-gating scenarios without building own infrastructure. Custom API makes sense only for special logic like multi-wallet aggregation or complex DeFi positions.







