Skip to content

JustinBeckwith/fitbit-discord-bot

Repository files navigation

Discord Fitbit Verified Role Bot

A Discord bot that verifies users' Fitbit accounts and manages their roles based on their Fitbit profile data. The bot uses Discord's Role Connections feature to automatically update user roles based on their Fitbit profile information.

image

Features

  • Connect Discord accounts with Fitbit profiles
  • Automatic role updates based on Fitbit profile data:
    • Average daily steps
    • Fitbit Ambassador status
    • Membership duration
    • Coach status
  • Slash commands for user interaction
  • Secure OAuth2 authentication flow
  • Automatic token refresh and management
image

Prerequisites

  • Node.js 22 or higher
  • A Discord application with bot token
  • A Fitbit application with API credentials
  • Cloudflare Workers account (for deployment)

Setup

  1. Clone this repository:
git clone https://github.com/JustinBeckwith/fitbit-discord-bot.git
cd fitbit-discord-bot
  1. Install dependencies:
npm install
  1. Rename example.dev.vars to .dev.vars, and add all required fields.

  2. Register the bot's commands and metadata schema:

npm run register-commands
npm run register-metadata-schema

Development

To run the bot locally:

npm run dev

This will start the development server on port 3000.

Available Commands

The bot provides the following slash commands:

  • /connect - Start the process of connecting your Fitbit account
  • /disconnect - Disconnect your Fitbit account and remove associated roles
  • /get-profile - View your current Fitbit profile data

Deployment

The bot is designed to be deployed on Cloudflare Workers. To deploy:

wrangler deploy

License

MIT

About

It's a bot! For Fitbit and Discord.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors