Invite counting and automatic role assignment for a Discord community
A Discord bot that tracks how many members each user invites and automatically grants — or revokes — a Verified role at a configurable threshold.
Click any image to view it full size
A Discord community owner wanted to reward members for growing the server, without policing it by hand. The requirement was simple to state and fiddly to get right: count how many people each member has genuinely invited, and hand out a role automatically once they cross a threshold.
We built a Node.js Discord bot that tracks invites per member and auto-assigns the Verified role at three invites — and removes it again if a member's count drops back below the threshold. The counting logic filters out the things that make naive invite trackers useless: self-invites, vanity URL joins and quick-leavers who join and immediately depart.
Two administrative slash commands were included: /invites to read a member's current count, and /setinvites to correct one manually.
Everything the owner might want to change is an environment variable — DISCORD_TOKEN, INVITE_THRESHOLD and VERIFIED_ROLE_NAME — so the threshold and role name can be changed without touching code. The bot was handed over as a source package on GitHub with a README written specifically for deploying on the client's own Pterodactyl game-panel host, step by step.
The client deployed it on his own panel and confirmed it back: "it works perfectly, thanks alot for the bot and the help". The milestone was released on delivery.
Reward community growth automatically without a moderator counting invites by hand — and without the bot being trivially gamed by self-invites, vanity links or members who join and immediately leave.
We built a Node.js Discord bot that tracks invites per member, filters out invalid joins, and grants or revokes the Verified role as the count crosses the configured threshold. Admin slash commands allow manual inspection and correction, and all key settings are environment variables. Delivery was a GitHub source package with deployment instructions for the client's Pterodactyl panel.
The client deployed the bot on his own panel and confirmed it works perfectly, with role assignment and both admin commands functioning. The milestone was released.
Category
Automation
Industry
Online Communities
Year
2026
Components
1 repository
Automation
Python lead-discovery and AI outreach pipeline, handed over for the client to run himself
Automation
Macro-free compliance reporting workbook built to a 13-part specification
Automation
Packaged desktop app and CLI for individually addressed mail over M365 SMTP