How lewyi/endfield-auto-checkin works
This Discord bot lets users save an Arknights: Endfield account token, then performs manual or daily attendance check-ins and reports results. The main flow runs from a Discord command through cookie lookup, game authentication, role binding and attendance submission; a separate command explains how to obtain the token. The excerpts show these flows and SQLite access. The README confirms the 24/7 automation purpose; channel configuration and some startup details are incomplete, so those links are omitted.
Main entry points: checkin.py Manual check-in · bot.py Bot runtime · entercookie.py Token entry modal · getcookie.py Token guide
Components 17
Discord interface
- Bot runtime
bot.py - Cookie command
cogs/entercookie.py - Token entry modal
cogs/entercookie.py - Token guide
cogs/getcookie.py
Account storage
- Saved tokens
data/UserData.db
Attendance workflow
- Manual check-in
cogs/checkin.py - Daily scheduler
cogs/checkin.py - Daily check-in runner
cogs/checkin.py
Game service
- OAuth grant
cogs/checkin.py - Credential exchange
cogs/checkin.py - Sign token refresh
cogs/checkin.py - Role binding
cogs/checkin.py - Request signing
cogs/checkin.py - Attendance submission
cogs/checkin.py
Other components
- Discord user
- Discord service
- Endfield service
Connections 29
- Bot runtime → Discord service: starts bot
bot.py - Bot runtime → Cookie command: loads extensions
bot.py - Bot runtime → Token guide: loads extensions
bot.py - Bot runtime → Manual check-in: loads extensions
bot.py - Discord user → Cookie command: enters token
cogs/entercookie.py - Cookie command → Token entry modal: opens modal
cogs/entercookie.py - Token entry modal → Saved tokens: checks and saves
cogs/entercookie.py - Token entry modal → Discord service: sends result
cogs/entercookie.py - Discord user → Token guide: requests guide
cogs/getcookie.py - Token guide → Discord service: sends guide
cogs/getcookie.py - Discord user → Manual check-in: requests check-in
cogs/checkin.py - Manual check-in → Saved tokens: reads token
cogs/checkin.py - Manual check-in → OAuth grant: calls check-in
cogs/checkin.py - Daily scheduler → Daily check-in runner: runs daily
cogs/checkin.py - Daily check-in runner → Saved tokens: reads tokens
cogs/checkin.py - Daily check-in runner → OAuth grant: calls check-in
cogs/checkin.py - Manual check-in → Discord service: reports result
cogs/checkin.py - Daily check-in runner → Discord service: reports results
cogs/checkin.py - OAuth grant → Endfield service: requests grant
cogs/checkin.py - OAuth grant → Credential exchange: passes code
cogs/checkin.py - Credential exchange → Endfield service: requests credential
cogs/checkin.py - Credential exchange → Sign token refresh: passes credential
cogs/checkin.py - Sign token refresh → Endfield service: refreshes token
cogs/checkin.py - Sign token refresh → Role binding: passes credentials
cogs/checkin.py - Role binding → Request signing: signs request
cogs/checkin.py - Request signing → Endfield service: requests roles
cogs/checkin.py - Role binding → Attendance submission: passes role
cogs/checkin.py - Attendance submission → Request signing: signs request
cogs/checkin.py - Attendance submission → Endfield service: submits attendance
cogs/checkin.py