メインコンテンツにスキップ

auto-archive-group-data

Archives all guild/party (group) data for multiple groups to spreadsheets in Google Drive folders. The script can also be set up to archive chat messages automatically, whenever the group receives a new chat message.

AI Summary

Auto Archive Group Data

Archives Habitica party and guild data—metadata, members, challenges and chats—to Google Drive spreadsheets via Google Apps Script.

Target Users

Habitica community managers with beginner-to-intermediate GAS skills who need automated backups of multiple party or guild records.

Problems Solved

Manual backup of Habitica group information and chat history is labor-intensive and error-prone because the platform lacks bulk export features.

Tags

Main Features

1
Bulk export to Google Sheets

Captures guild or party metadata (name, ID, leader, member count, etc.) and writes them to dedicated sheets in Drive with a single execution.

2
Real-time chat archiving

When deployed as a web app, the script appends new Habitica messages to the spreadsheet whenever they arrive.

3
Configurable and multi-group support

Boolean flags and group list arrays let users choose which datasets to archive, skip skill-cast messages, and handle many guilds or parties at once.

Usage Examples

One-off archiving of Habitica group data

/**
 * Auto Archive Group Data – minimal setup sample.
 * Replace USER_ID and API_TOKEN with your own values and run archiveGroupData().
 */
const USER_ID = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';    // Habitica User ID
const API_TOKEN = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';  // Habitica API Token

// Choose what to archive
const ARCHIVE_GROUP_INFO       = true;
const ARCHIVE_GROUP_MEMBERS    = true;
const ARCHIVE_GROUP_CHALLENGES = true;
const ARCHIVE_GROUP_CHATS      = true;
const OMIT_SKILL_CASTS         = true; // Skip skill-cast messages

// Target groups (example: one guild)
const GROUPS = [
  {
    name: 'Example Guild',
    groupURL : 'https://habitica.com/groups/guild/1234abcd-0000-0000-0000-1234567890ab',
    folderURL: 'https://drive.google.com/drive/folders/1AbCdEfGhIjK'
  }
];

/**
 * Entry point for a single archive run.
 * Spreadsheets will be created in the folder you specified.
 */
function archiveGroupData() {
  // The real implementation already exists in the copied script.
}

Fill in your own credentials and folder URL, then run archiveGroupData() to create spreadsheets inside the chosen Drive folder.