InactivePlayerCleanup

by Mad
for 7 Days to Die
Automatically removes players who haven't connected in a specified number of days. Processes players in batches and logs all activities to Discord.
communityTakaro v0.4.9
(2 versions available)

Components Overview

1
config
0
commands
0
hooks
2
Cron Jobs
1
functions
0
permissions

New Module: InactivePlayerCleanup

NEW
December 15, 2025
Updated to version latest. Added 2 scheduled tasks: Monthly Inactive Player Cleanup, Cleanup Watchdog. Added 1 function: watchdog. New configuration options: discordChannelId, inactivityDays, batchSize, enabled.

Configuration

Configure this module using the schemas below. The JSON schema defines the data structure, while the UI schema customizes how the configuration form is displayed.

Configuration Schema

Configuration Properties (4)

discordChannelId*string
Discord Channel ID

The Discord channel ID where cleanup logs will be sent

inactivityDaysnumber
Inactivity Days

Number of days of inactivity before a player is considered for deletion

Default: 90
Constraints: min: 1
batchSizenumber
Batch Size

Number of players to process per cronjob execution

Default: 10
Constraints: min: 1, max: 100
enabledboolean
Enable Cleanup

Master switch to enable/disable the cleanup process

Default: false

UI Schema

No configuration properties defined. This module uses default settings.

About Configuration Schemas

The Configuration Schema defines the structure and validation rules for module settings. The UI Schema customizes how the configuration form is displayed in the Takaro interface, including field ordering, labels, and input types.

Scheduled Jobs (2)

These jobs run automatically on a schedule defined by cron expressions. Each job executes JavaScript code at specific times or intervals.

Monthly Inactive Player Cleanup

0 0 1 * *Schedule

Description

Runs monthly to clean up inactive players. Processes in batches of 10 and self-triggers until all players are checked.

Schedule Details

Cron Expression
0 0 1 * *
Human-Readable Schedule

Monthly on the 1st at midnight

Function Implementation

Monthly Inactive Player Cleanup Function

JAVASCRIPT

Cron Expression Format

minute hour day-of-month month day-of-week

Each field can contain numbers, ranges (1-5), lists (1,3,5), or wildcards (*). Use */n for intervals (e.g., */5 for every 5 units).

Cleanup Watchdog

*/5 * * * *Schedule

Schedule Details

Cron Expression
*/5 * * * *
Human-Readable Schedule

Every 5 minutes

Function Implementation

Cleanup Watchdog Function

JAVASCRIPT

Cron Expression Format

minute hour day-of-month month day-of-week

Each field can contain numbers, ranges (1-5), lists (1,3,5), or wildcards (*). Use */n for intervals (e.g., */5 for every 5 units).

About Scheduled Jobs

Cron jobs allow your module to execute code automatically on a schedule. Each job has a cron expression that defines when it runs, and a JavaScript function that executes at those times. Jobs run server-side and can perform maintenance tasks, send notifications, or update game state automatically.

Functions (1)

Reusable JavaScript functions that can be imported and used by other module components like commands, hooks, and cron jobs. These promote code reuse and modularity.

watchdog

functionReusable Component

Function Implementation

watchdog Function

JAVASCRIPT

Import Usage

Import: import { watchdog } from './utils';

About Module Functions

Functions are reusable JavaScript components that can be imported and used by commands, hooks, and cron jobs within your module. They promote code reuse, improve maintainability, and allow you to organize complex logic into modular pieces. Functions must be exported with proper ES6/CommonJS syntax to be importable by other components.