A Discord bot that tracks gameplay activity via Rich Presence events for research studies. Built with discord.js.
Full documentation: glhf-lab.github.io/glhf/docs/integrations/discord
cp .env.example .env # then fill in the values yarn install yarn startSee the docs for environment variable reference and Docker deployment.
The bot records presenceUpdate events (Playing, Streaming, Competing) as NDJSON files, rotated hourly:
data/activities/{year}/{month}/{day}/{hour}/activities.json Each record contains the Discord Rich Presence fields plus bot-added metadata:
{ "name": "Hollow Knight", "type": 0, "applicationId": "000000000000000000", "timestamps": { "start": "1687431285189", "end": null }, "userId": "a1b2c3d4e5f6...", "updateType": "isPlaying", "saveTimeStamp": 1687433138804, "status": "online", "clientStatus": { "desktop": "online" } }The updateType field is derived by comparing consecutive presence updates: startedPlaying, isPlaying, or stoppedPlaying.
Server membership events (guildMemberAdd, guildMemberRemove) are stored in data/guildMemberAdd.json and data/guildMemberRemove.json.
See CONTRIBUTING.md.
- Game Log Harvesting Framework — the main application this bot integrates with
MIT