Skip to content

glhf-lab/discord-bot

Repository files navigation

Game Log Harvesting Framework - Discord Bot

License: MIT Node Alpha

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

Setup

cp .env.example .env # then fill in the values yarn install yarn start

See the docs for environment variable reference and Docker deployment.

Data Format

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.

Contributing

See CONTRIBUTING.md.

Related

License

MIT

About

Discord bot for tracking gameplay activity via Rich Presence events for research studies

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors