Custom Command
FunctionsChannel Functions

$transcriptChannel

This function generates an HTML file containing a transcript of messages from a specified channel and can optionally send the generated file to another channel.

Usage

$transcriptChannel[Channel ID;Send to Channel ID;Message (optional);file name (optional);return message id (yes/no default=no);limit (optional)]

Parameters:

  • Channel ID: (Required) The ID of the channel from which to retrieve the messages.

  • Send to Channel ID: (Required) The ID of the channel where the generated HTML transcript file will be sent.

  • Message (optional): (Optional) A message to send along with the transcript file. If left blank, no message will be sent.

  • file name (optional): (Optional) The desired filename for the generated HTML transcript file, without the .html extension. If left blank, a default filename will be used.

  • return message id (yes/no default=no): (Optional) Determines whether the function should return the ID of the message containing the sent transcript file. Defaults to no. If set to yes, the function returns the message ID. If the message could not be sent, the function returns undefined. If set to no, nothing will be returned.

  • limit (optional): (Optional) The maximum number of messages to include in the transcript. If omitted, the maximum amount supported by the server's tier is used.

Tier Limits

The default maximum number of messages depends on the server's tier:

TierMaximum messages
0 (Free)100
3100
4500
51000

The specified limit cannot exceed the maximum allowed by the server's tier and must be more than 0.

Example

$transcriptChannel[123456789012345678;987654321098765432;Here is the channel transcript;my_transcript.html;yes;200]

This example will:

  1. Retrieve up to 200 messages from channel 123456789012345678.
  2. Generate an HTML transcript from those messages.
  3. Send the transcript file to channel 987654321098765432 with the message "Here is the channel transcript".
  4. Name the generated HTML file my_transcript.html.
  5. Return the ID of the message sent to channel 987654321098765432.

If limit is omitted:

$transcriptChannel[123456789012345678;987654321098765432]

the function automatically uses the maximum transcript size allowed by the server's tier.

Notes

  • The limit input controls the maximum number of messages retrieved for the transcript.
  • If limit is greater than the maximum allowed by the server's tier, the tier maximum is used.
  • Ensure the bot has the necessary permissions (View Channel, Read Message History, Send Messages, and Attach Files) in both the source channel (Channel ID) and the destination channel (Send to Channel ID).
  • Messages are retrieved from the channel's Discord message history, up to the configured limit.
  • The function returns undefined if the bot fails to send the message with the file, such as due to permission issues or file size limits.

Function Cooldown

This function has built-in cooldown. Why? Read more about cooldowns here.

  • Cooldown: 3 minutes
  • Tracked By: Channel ID
  • Type: file

Functions with the same type share cooldowns based on the same Tracked By value.

On this page