How michadasis/uowm-auth-discord-bot works
This is a Discord verification bot for UoWM Informatics members. The main workflow starts with /auth, validates an institutional address, sends a one-time code, accepts it through a button or /code, then links the account and grants the appropriate role. The graph also shows documented administration, guest access, semester-role enforcement, statistics, and cleanup. Some of these modules were not sampled; their paths and capabilities come from the tree and README, so uncertain internal wiring is omitted.
Main entry points: emailVerification.js Code verification · repository.js Data repository · maintenance.js Startup maintenance · linker.js Account linker
Components 24
Email verification
- Auth command
bot/src/commands/utility/auth.js - Verification wiring
bot/src/lib/services.js - Code verification
bot/src/lib/emailVerification.js - Address policy
bot/src/lib/emailPolicy.js - Mailer
bot/src/lib/mailer.js - Code entry
bot/src/lib/codeEntry.js - Code interaction
bot/src/events/interactionCreate/codeEntry.js - Account linker
bot/src/lib/linker.js - Discord adapter
bot/src/lib/discordAdapter.js
Discord workflows
- Admin commands
bot/src/commands/admin - Guest roles
bot/src/events/interactionCreate/guestRoleManagement.js - Privacy instructions
bot/src/lib/privacyNotice.js - Bot runtime
bot/src/bot.js
Member operations
- Semester role guard
bot/src/lib/semesterRoles.js - Startup maintenance
bot/src/events/clientReady/maintenance.js - Departure cleanup
bot/src/events/guildMemberRemove/delete-user-data.js - Verification stats
bot/src/commands/public/stats.js
Persistence and policy
- Data repository
bot/src/lib/repository.js - Database pool
bot/src/lib/database.js - Database schema
db/setup.sql
Other components
- Server member
- Discord API
- Email transport
- MariaDB
Connections 30
- Server member → Auth command: requests code
- Auth command → Verification wiring: gets verifier
- Verification wiring → Code verification: constructs
- Code verification → Address policy: checks address
- Code verification → Mailer: sends code
- Mailer → Email transport: delivers email
- Code verification → Data repository: stores challenge
- Server member → Code interaction: submits code
- Code interaction → Code entry: handles entry
- Code entry → Code verification: verifies code
- Code verification → Account linker: links account
- Account linker → Data repository: checks and saves
- Account linker → Discord adapter: assigns role
- Discord adapter → Discord API: updates member
- Data repository → Database pool: queries
- Database pool → MariaDB: reads and writes
- Database schema → MariaDB: defines tables
- Admin commands → Verification wiring: manages verification
- Guest roles → Discord API: manages guest role
- Guest roles → MariaDB: records guest
- Startup maintenance → Data repository: purges challenges
- Startup maintenance → Semester role guard: checks role policy
- Startup maintenance → Discord API: sweeps members
- Departure cleanup → MariaDB: deletes member data
- Departure cleanup → Discord API: logs departure
- Verification stats → MariaDB: counts verified users
- Bot runtime → Discord API: connects bot
- Server member → Admin commands: runs admin command
- Server member → Guest roles: moderates guest access
- Privacy instructions → Discord API: posts notice