Ticket Transcript
Description
Generate and host ticket transcripts automatically when a ticket is closed. The transcript is saved at a unique URL and DMed to the user who opened the ticket. (and yes it doesn't need any bot tokens so it's 100% BDFD.) Full docs: https://bdtools.xyz/docs/ticket-transcript
Trigger
$onInteraction
BDScript Code
$nomention
$c[Replace this or add this variable in the app with the author/person who makes the ticket.]
$var[aid;$getUserVar[ticketAuthorId]]
$var[key;YOUR_API_KEY_HERE]
$c[DO NOT CHANGE ANYTHING FROM THIS POINT ONWARDS]
$defer
$var[i;0]
$jsonParse[[\]]
$var[code;.try .var(lastMsgID,.optOff(.lastMessageID)) .jsonArrayAppend(,.getMessage(.channelID,.var(lastMsgID),authorID) | .getMessage(.channelID,.var(lastMsgID),content)) .deleteMessage(.channelID,.var(lastMsgID)) .endtry]
$var[code;$replaceText[$replaceText[$replaceText[$replaceText[$var[code];.;$];,;\;];(;[]););\]]]
$eval[$repeatMessage[2;$repeatMessage[10;$repeatMessage[10;$var[code]]]]]
$httpAddHeader[Authorization;Bearer $var[key]]
$httpPost[https://api.bdtools.xyz/ticket-transcript;{
"channelId": "$channelID",
"channelName": "$channelName[$channelID]",
"guildName": "$serverName[$guildID]",
"authorId": "$getUserVar[$var[aid]]",
"botId": "$botID",
"messages": $jsonStringify
}]
$c[You can edit these messages below:]
$c[The DM channel ID of the person who made the ticket]
$var[id;$dmChannelID[$getUserVar[$var[aid]]]]
$c[Message to send]
$var[msg;Here is your ticket transcript, thank you for contacting support ❤️]
$c[The output URL]
$var[url;$httpResult[url]]
$c[The message that is sent to the person who made the ticket via DM]
$channelSendMessage[$var[id];$var[msg]
$var[url]]
$c[Add more stuff here maybe send the transcript url to a staff channel or anything else.]
Copied to clipboard!