(v4.2.0) Added /transcripts history command
This commit is contained in:
@@ -1131,6 +1131,27 @@ const transcriptEmbeds = () => {
|
||||
if (reason || generalConfig.data.ticketSystem.alwaysShowReason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+(reason ?? "/")+"```"})
|
||||
})
|
||||
)
|
||||
|
||||
//TRANSCRIPT HISTORY
|
||||
embeds.add(new api.ODEmbed("opendiscord:transcript-history"))
|
||||
embeds.get("opendiscord:transcript-history").workers.add(
|
||||
new api.ODWorker("opendiscord:transcript-history",0,async (instance,params,origin) => {
|
||||
const {transcriptUser,transcriptList} = params
|
||||
|
||||
//transcript history only supports URL (html) transcripts at the moment
|
||||
const filteredList = transcriptList.filter((t) => t.transcriptType == "remoteUrl")
|
||||
const renderedList = filteredList.map((t) => "- ["+t.ticketName+"]("+t.transcriptUrl+") ("+discord.time(new Date(t.ticketDeletedDate ?? 0),"R")+")").join("\n")
|
||||
//TODO TRANSLATION!!!
|
||||
const contents = (transcriptList.length < 1) ? "This user does not yet have any transcripts." : ((filteredList.length > 0) ? renderedList : "*⚠️ Transcript history is currently only supported with HTML Transcripts.\nText transcript history will be available soon.*")
|
||||
|
||||
instance.setAuthor(transcriptUser.displayName,transcriptUser.displayAvatarURL())
|
||||
instance.setThumbnail(transcriptUser.displayAvatarURL())
|
||||
instance.setColor(generalConfig.data.mainColor)
|
||||
//TODO TRANSLATION!!!
|
||||
instance.setTitle(utilities.emojiTitle("📄","Transcript History"))
|
||||
instance.setDescription(contents)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
const roleEmbeds = () => {
|
||||
|
||||
@@ -677,6 +677,16 @@ const transcriptMessages = () => {
|
||||
instance.addComponent(await buttons.getSafe("opendiscord:transcript-error-continue").build(origin,{guild,channel,user,ticket,compiler,reason}))
|
||||
})
|
||||
)
|
||||
|
||||
//TRANSCRIPT HISTORY
|
||||
messages.add(new api.ODMessage("opendiscord:transcript-history"))
|
||||
messages.get("opendiscord:transcript-history").workers.add(
|
||||
new api.ODWorker("opendiscord:transcript-history",0,async (instance,params,origin) => {
|
||||
const {guild,channel,user,transcriptUser,transcriptList} = params
|
||||
instance.addEmbed(await embeds.getSafe("opendiscord:transcript-history").build(origin,{guild,channel,user,transcriptUser,transcriptList}))
|
||||
instance.setEphemeral(true)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
const roleMessages = () => {
|
||||
|
||||
Reference in New Issue
Block a user