Skip to main content

Managing Data in Statbot

caution

Statbot keeps channels in its database forever so that you can view them later even after you've deleted them in Discord. Because of this, servers that create many temporary channels will eventually experience increased load times. You can delete these channels from Statbot's systems through Aggregate Channels explained below.

Aggregate Channels

Aggregate Channels are available through the Dashboard. They are special channels that only exist in Statbot's system. They allow you to merge the stats from other channels into them. This is useful when you have many deleted channels that you want to access more easily in Statbot's features.

You may mark channels for deletion (from Statbot) while merging their stats. Deleting channels in this way frees up Statbot resources, and improving load times for your server.

A server is currently limited to a maximum of 50 Aggregate Channels.

info

Aggregate Channels have as their icon in selection menus.

Aggregate Channel section on the dashboard
Aggregate Channel section on the dashboard

Manage Aggregate Channels

Create and manage the server's Aggregate Channels. You can assign Discord Category to an Aggregate Channel, and set up Auto Merging from this menu.

info

Just as with regular channels (seen below), Aggregate Channels may not be deleted if they contain any stats. To do this, you must merge it into a different Aggregate Channel.

Auto Merging Categories

This feature complements the Merge Stats function. With it ON, stats from channels under the selected categories will be automatically assigned to the Aggregate Channel. You may choose to merge Messages, Voice, or both stat types.

Additionally, the metadata of new channels (name, etc.) under these categories will not be logged to the database. This is primarily to solve loading issues and huge channel lists for servers with many temporary channels.

info

This feature can be accessed through the Edit menu after creating an Aggregate Channel.

caution

If only selecting one of the Messages or Voice, voice channel metadata will still be logged to the database. If you do not want the new channels to appear in lists, etc. be sure to select both Messages and Voice.

Merge Stats

Merge the stats of multiple channels into an Aggregate Channel. Only one merge can be performed at a time. Please allow up to an hour for the merge to complete. The dashboard will show the progress of any ongoing merges.

The merge process will have you follow these steps:

  1. Select the destination Aggregate Channel
  2. Select the type of stats to merge (Messages and/or Voice)
  3. Search for channels to aggregate
  4. Select whether or not to delete the original channels after merge*
  5. Confirm selection
*Deleting Channels

A channel must meet the following criteria to be deleted

  • Deleted in Discord
  • Have no stats after the merge (both Message and Voice stats)

Message History Sync

Message History Sync is available to servers with the History premium upgrade. This feature will sync Statbot's message data with Discord, within the range of settings that you provide it. It is most commonly used to get message data from before you invited Statbot to the server.

The reason for it being called "Sync" is because it will replace the stats within the data ranges provide with those found in Discord. This can be useful for servers that have had large amounts of messages deleted from channels that they no longer want in their data, such as messages from raids.

Credits

In order to prevent abuse and limit Statbot's impact on Discord's systems, this feature requires credits to use. Here is what you should know about credits:

  • A server's first purchase of the History upgrade will grant it 1 credit.
  • A credit is required to sync message history.
  • Any amount of channels and time can be selected for the sync. This means that you can sync a server's entire history with 1 credit.
  • A credit is only expended after the process is approved.

Settings

The settings control which data Statbot syncs.

  • Channels — Choose which channels Statbot will sync. (This only includes channels that currently exist in Discord.)

  • Include Threads — Also fetch messages from the selected channels' threads. Just like how threads are currently handled, these messages will be attributed to the parent channel.

  • Time Range — The specific period of time from which to sync stats.

    Hint: If you only want to sync stats from before Statbot was invited, change the End Time to when you invited the bot. (The Start Time defaults to when your server was created.)

After configuring the sync, you'll see a confirmation screen where you can double-check your settings. The bot will also check to make sure it has all the necessary permissions. Fix any errors you see before continuing.

Running and Approval

Once a sync has started, it cannot be stop and other Data Management features cannot be ran. The dashboard will periodically update with the amount of messages that are waiting to be synced, in addition to how many channels are remaining in the sync.

After all data has been fetched, the button will change to Waiting for approval. At this point, the old data has not yet been swapped with the new and a credit has not been used. This gives you the opportunity to review the data to make sure it's what you expect.

Upon clicking Approve, a credit will be expended and the sync task will finish replacing the old data with the new data that you just confirmed. Though relatively fast, you may temporarily see a dip in stats while this process completes. Services such as Statroles are paused during this time in order to prevent impact on your server's operations.

Interruptions and Errors

Due to Discord rate limiting, syncs can take a long time for servers with a lot of messages in a given channel. We understand that servers are a dynamic place where settings change often so there are some safeguards in place to make sure that syncs can continue without having to start all over.

If a problem occurs during a sync, such as the bot losing permissions to a channel, it will stop and the status on the dashboard will change to Requires Review. Here, you'll see a list of problems that the sync encountered, including which permissions the bot may have lost to the configured channels. You can choose to fix the issues and continue, or abort the sync all together.

Channels that are deleted during a sync will not throw an error and will instead be ignored after that point. This means that all the data the sync was able to fetch up to the deletion will still be available to sync, but anything afterward won't since the bot can't get messages from deleted channels.