Translated code strings using language manager

This commit is contained in:
DJj123dj
2025-11-09 12:50:57 +01:00
parent f7fa0998b6
commit f835850b3f
16 changed files with 293 additions and 179 deletions
+7 -6
View File
@@ -5,6 +5,7 @@ import {opendiscord, api, utilities} from "../index"
import * as discord from "discord.js" import * as discord from "discord.js"
const generalConfig = opendiscord.configs.get("opendiscord:general") const generalConfig = opendiscord.configs.get("opendiscord:general")
const lang = opendiscord.languages
export const registerActions = async () => { export const registerActions = async () => {
opendiscord.actions.add(new api.ODAction("opendiscord:close-ticket")) opendiscord.actions.add(new api.ODAction("opendiscord:close-ticket"))
@@ -214,7 +215,7 @@ export const registerVerifyBars = async () => {
} }
//return when already closed //return when already closed
if (ticket.get("opendiscord:closed").value){ if (ticket.get("opendiscord:closed").value){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,error:opendiscord.languages.getTranslation("errors.actionInvalid.close"),layout:"simple"})) instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,error:lang.getTranslation("errors.actionInvalid.close"),layout:"simple"}))
return cancel() return cancel()
} }
//return when busy //return when busy
@@ -226,11 +227,11 @@ export const registerVerifyBars = async () => {
if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){ if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){
const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel) const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel)
if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a user.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a ticket admin or support member.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeAdminMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
} }
@@ -313,7 +314,7 @@ export const registerVerifyBars = async () => {
} }
//return when already closed //return when already closed
if (ticket.get("opendiscord:closed").value){ if (ticket.get("opendiscord:closed").value){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,error:opendiscord.languages.getTranslation("errors.actionInvalid.close"),layout:"simple"})) instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,error:lang.getTranslation("errors.actionInvalid.close"),layout:"simple"}))
return cancel() return cancel()
} }
//return when busy //return when busy
@@ -325,11 +326,11 @@ export const registerVerifyBars = async () => {
if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){ if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){
const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel) const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel)
if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a user.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a ticket admin or support member.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeAdminMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
} }
+7 -6
View File
@@ -5,6 +5,7 @@ import {opendiscord, api, utilities} from "../index"
import * as discord from "discord.js" import * as discord from "discord.js"
const generalConfig = opendiscord.configs.get("opendiscord:general") const generalConfig = opendiscord.configs.get("opendiscord:general")
const lang = opendiscord.languages
export const registerActions = async () => { export const registerActions = async () => {
opendiscord.actions.add(new api.ODAction("opendiscord:create-ticket")) opendiscord.actions.add(new api.ODAction("opendiscord:create-ticket"))
@@ -120,12 +121,12 @@ export const registerActions = async () => {
if (generalConfig.data.system.channelTopic.showOptionName) channelTopics.push(option.get("opendiscord:name").value) if (generalConfig.data.system.channelTopic.showOptionName) channelTopics.push(option.get("opendiscord:name").value)
if (generalConfig.data.system.channelTopic.showOptionDescription) channelTopics.push(option.get("opendiscord:description").value) if (generalConfig.data.system.channelTopic.showOptionDescription) channelTopics.push(option.get("opendiscord:description").value)
if (generalConfig.data.system.channelTopic.showOptionTopic) channelTopics.push(channelTopicText) if (generalConfig.data.system.channelTopic.showOptionTopic) channelTopics.push(channelTopicText)
if (generalConfig.data.system.channelTopic.showPriority) channelTopics.push("**Priority:** "+opendiscord.priorities.get("opendiscord:none").renderDisplayName()) //TODO TRANSLATION!!! if (generalConfig.data.system.channelTopic.showPriority) channelTopics.push("**"+lang.getTranslation("params.uppercase.priority")+":** "+opendiscord.priorities.get("opendiscord:none").renderDisplayName())
if (generalConfig.data.system.channelTopic.showClosed) channelTopics.push("**Status:** Opened") //TODO TRANSLATION!!! if (generalConfig.data.system.channelTopic.showClosed) channelTopics.push("**"+lang.getTranslation("params.uppercase.status")+":** "+lang.getTranslation("params.uppercase.open"))
if (generalConfig.data.system.channelTopic.showClaimed) channelTopics.push("**Claimed By:** No-one") //TODO TRANSLATION!!! if (generalConfig.data.system.channelTopic.showClaimed) channelTopics.push("**"+lang.getTranslation("stats.properties.claimedBy")+":** "+lang.getTranslation("params.uppercase.noone"))
if (generalConfig.data.system.channelTopic.showPinned) channelTopics.push("**Pinned:** No") //TODO TRANSLATION!!! if (generalConfig.data.system.channelTopic.showPinned) channelTopics.push("**"+lang.getTranslation("params.uppercase.pinned")+":** "+lang.getTranslation("params.uppercase.no"))
if (generalConfig.data.system.channelTopic.showCreator) channelTopics.push("**Creator:** "+discord.userMention(user.id)) //TODO TRANSLATION!!! if (generalConfig.data.system.channelTopic.showCreator) channelTopics.push("**"+lang.getTranslation("params.uppercase.creator")+":** "+discord.userMention(user.id))
if (generalConfig.data.system.channelTopic.showParticipants) channelTopics.push("**Participants:** "+participants.map((p) => (p.type == "user") ? discord.userMention(p.id) : discord.roleMention(p.id)).join(", ")) //TODO TRANSLATION!!! if (generalConfig.data.system.channelTopic.showParticipants) channelTopics.push("**"+lang.getTranslation("params.uppercase.participants")+":** "+participants.map((p) => (p.type == "user") ? discord.userMention(p.id) : discord.roleMention(p.id)).join(", "))
//create channel //create channel
const channel = await guild.channels.create({ const channel = await guild.channels.create({
+9 -8
View File
@@ -5,6 +5,7 @@ import {opendiscord, api, utilities} from "../index"
import * as discord from "discord.js" import * as discord from "discord.js"
const generalConfig = opendiscord.configs.get("opendiscord:general") const generalConfig = opendiscord.configs.get("opendiscord:general")
const lang = opendiscord.languages
export const registerActions = async () => { export const registerActions = async () => {
opendiscord.actions.add(new api.ODAction("opendiscord:delete-ticket")) opendiscord.actions.add(new api.ODAction("opendiscord:delete-ticket"))
@@ -179,11 +180,11 @@ export const registerVerifyBars = async () => {
if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){ if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){
const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel) const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel)
if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a user.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a ticket admin or support member.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeAdminMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
} }
@@ -284,11 +285,11 @@ export const registerVerifyBars = async () => {
if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){ if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){
const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel) const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel)
if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a user.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a ticket admin or support member.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeAdminMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
} }
@@ -393,11 +394,11 @@ export const registerVerifyBars = async () => {
if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){ if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){
const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel) const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel)
if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a user.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a ticket admin or support member.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeAdminMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
} }
@@ -502,11 +503,11 @@ export const registerVerifyBars = async () => {
if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){ if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){
const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel) const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel)
if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a user.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a ticket admin or support member.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeAdminMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
} }
+7 -6
View File
@@ -5,6 +5,7 @@ import {opendiscord, api, utilities} from "../index"
import * as discord from "discord.js" import * as discord from "discord.js"
const generalConfig = opendiscord.configs.get("opendiscord:general") const generalConfig = opendiscord.configs.get("opendiscord:general")
const lang = opendiscord.languages
export const registerActions = async () => { export const registerActions = async () => {
opendiscord.actions.add(new api.ODAction("opendiscord:update-ticket-topic")) opendiscord.actions.add(new api.ODAction("opendiscord:update-ticket-topic"))
@@ -31,12 +32,12 @@ export const registerActions = async () => {
if (generalConfig.data.system.channelTopic.showOptionName) channelTopics.push(ticket.option.get("opendiscord:name").value) if (generalConfig.data.system.channelTopic.showOptionName) channelTopics.push(ticket.option.get("opendiscord:name").value)
if (generalConfig.data.system.channelTopic.showOptionDescription) channelTopics.push(ticket.option.get("opendiscord:description").value) if (generalConfig.data.system.channelTopic.showOptionDescription) channelTopics.push(ticket.option.get("opendiscord:description").value)
if (generalConfig.data.system.channelTopic.showOptionTopic) channelTopics.push(ticket.get("opendiscord:topic").value) if (generalConfig.data.system.channelTopic.showOptionTopic) channelTopics.push(ticket.get("opendiscord:topic").value)
if (generalConfig.data.system.channelTopic.showPriority) channelTopics.push("**Priority:** "+opendiscord.priorities.getFromPriorityLevel(ticket.get("opendiscord:priority").value).renderDisplayName()) //TODO TRANSLATION!!! if (generalConfig.data.system.channelTopic.showPriority) channelTopics.push("**"+lang.getTranslation("params.uppercase.priority")+":** "+opendiscord.priorities.getFromPriorityLevel(ticket.get("opendiscord:priority").value).renderDisplayName())
if (generalConfig.data.system.channelTopic.showClosed) channelTopics.push("**Status:** "+(closed ? "Closed" : "Opened")) //TODO TRANSLATION!!! if (generalConfig.data.system.channelTopic.showClosed) channelTopics.push("**"+lang.getTranslation("params.uppercase.status")+":** "+(closed ? lang.getTranslation("params.uppercase.closed") : lang.getTranslation("params.uppercase.open")))
if (generalConfig.data.system.channelTopic.showClaimed) channelTopics.push("**Claimed By:** "+(claimedBy ? discord.userMention(claimedBy) : "No-one")) //TODO TRANSLATION!!! if (generalConfig.data.system.channelTopic.showClaimed) channelTopics.push("**"+lang.getTranslation("stats.properties.claimedBy")+":** "+(claimedBy ? discord.userMention(claimedBy) : lang.getTranslation("params.uppercase.noone")))
if (generalConfig.data.system.channelTopic.showPinned) channelTopics.push("**Pinned:** "+(pinned ? "Yes" : "No")) //TODO TRANSLATION!!! if (generalConfig.data.system.channelTopic.showPinned) channelTopics.push("**"+lang.getTranslation("params.uppercase.pinned")+":** "+(pinned ? lang.getTranslation("params.uppercase.yes") : lang.getTranslation("params.uppercase.no")))
if (generalConfig.data.system.channelTopic.showCreator) channelTopics.push("**Creator:** "+discord.userMention(creator)) //TODO TRANSLATION!!! if (generalConfig.data.system.channelTopic.showCreator) channelTopics.push("**"+lang.getTranslation("params.uppercase.creator")+":** "+discord.userMention(creator))
if (generalConfig.data.system.channelTopic.showParticipants) channelTopics.push("**Participants:** "+ticket.get("opendiscord:participants").value.map((p) => (p.type == "user") ? discord.userMention(p.id) : discord.roleMention(p.id)).join(", ")) //TODO TRANSLATION!!! if (generalConfig.data.system.channelTopic.showParticipants) channelTopics.push("**"+lang.getTranslation("params.uppercase.participants")+":** "+ticket.get("opendiscord:participants").value.map((p) => (p.type == "user") ? discord.userMention(p.id) : discord.roleMention(p.id)).join(", "))
//update channel //update channel
channel.setTopic(channelTopics.join(" • "),"Topic Changed") channel.setTopic(channelTopics.join(" • "),"Topic Changed")
+15 -18
View File
@@ -617,7 +617,7 @@ const ticketEmbeds = () => {
if (ticket.get("opendiscord:claimed").value){ if (ticket.get("opendiscord:claimed").value){
const claimUser = await opendiscord.tickets.getTicketUser(ticket,"claimer") const claimUser = await opendiscord.tickets.getTicketUser(ticket,"claimer")
if (!claimUser) return if (!claimUser) return
instance.setAuthor(lang.getTranslationWithParams("params.uppercase.claimedBy",[claimUser.displayName]),claimUser.displayAvatarURL()) instance.setAuthor(lang.getTranslation("stats.properties.claimedBy")+" "+claimUser.displayName,claimUser.displayAvatarURL())
} }
}) })
) )
@@ -838,8 +838,7 @@ const ticketEmbeds = () => {
instance.setTimestamp(new Date()) instance.setTimestamp(new Date())
instance.addFields( instance.addFields(
{name:lang.getTranslation("params.uppercase.ticket")+":",value:"```#"+(channel ? channel.name : "<unknown>")+"```",inline:false}, {name:lang.getTranslation("params.uppercase.ticket")+":",value:"```#"+(channel ? channel.name : "<unknown>")+"```",inline:false},
//TODO TRANSLATION!!! {name:lang.getTranslation("params.uppercase.option")+":",value:"```"+(ticket.option.get("opendiscord:name").value)+"```",inline:false},
{name:"Option"+":",value:"```"+(ticket.option.get("opendiscord:name").value)+"```",inline:false},
) )
if (reason || generalConfig.data.system.alwaysShowReason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+(reason ?? "/")+"```",inline:false}) if (reason || generalConfig.data.system.alwaysShowReason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+(reason ?? "/")+"```",inline:false})
@@ -1081,7 +1080,7 @@ const transcriptEmbeds = () => {
const {guild,channel,user,ticket,compiler,reason} = params const {guild,channel,user,ticket,compiler,reason} = params
instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor) instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
instance.setTitle(utilities.emojiTitle("❌","Transcript Error")) //TODO TRANSLATION!!! instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("transcripts.errors.title")))
instance.setTimestamp(new Date()) instance.setTimestamp(new Date())
instance.setDescription(lang.getTranslation("transcripts.errors.error")) instance.setDescription(lang.getTranslation("transcripts.errors.error"))
instance.setFooter(lang.getTranslation("errors.descriptions.askForInfo")) instance.setFooter(lang.getTranslation("errors.descriptions.askForInfo"))
@@ -1134,8 +1133,7 @@ const roleEmbeds = () => {
return (r.action == "added") ? "🟢 "+lang.getTranslation("params.uppercase.added")+" @"+r.role.name : "🔴 "+lang.getTranslation("params.uppercase.removed")+" @"+r.role.name return (r.action == "added") ? "🟢 "+lang.getTranslation("params.uppercase.added")+" @"+r.role.name : "🔴 "+lang.getTranslation("params.uppercase.removed")+" @"+r.role.name
}) })
//TODO TRANSLATION!!! const baseDescription = lang.getTranslation("actions.logs.roleUpdateDm")
const baseDescription = ("Your roles in our server have been updated!")
if (newResult.length > 0) instance.setDescription(baseDescription+"\n\n"+newResult.join("\n")) if (newResult.length > 0) instance.setDescription(baseDescription+"\n\n"+newResult.join("\n"))
else instance.setDescription(baseDescription+"\n"+lang.getTranslation("actions.descriptions.rolesEmpty")) else instance.setDescription(baseDescription+"\n"+lang.getTranslation("actions.descriptions.rolesEmpty"))
@@ -1161,8 +1159,7 @@ const roleEmbeds = () => {
return (r.action == "added") ? "🟢 "+lang.getTranslation("params.uppercase.added")+" "+discord.roleMention(r.role.id) : "🔴 "+lang.getTranslation("params.uppercase.removed")+" "+discord.roleMention(r.role.id) return (r.action == "added") ? "🟢 "+lang.getTranslation("params.uppercase.added")+" "+discord.roleMention(r.role.id) : "🔴 "+lang.getTranslation("params.uppercase.removed")+" "+discord.roleMention(r.role.id)
}) })
//TODO TRANSLATION!!! const baseDescription = lang.getTranslationWithParams("actions.logs.roleUpdateLog",[discord.userMention(user.id)])
const baseDescription = ("{0} has updated their roles!").replace("{0}",discord.userMention(user.id))
if (newResult.length > 0) instance.setDescription(baseDescription+"\n\n"+newResult.join("\n")) if (newResult.length > 0) instance.setDescription(baseDescription+"\n\n"+newResult.join("\n"))
else instance.setDescription(baseDescription+"\n"+lang.getTranslation("actions.descriptions.rolesEmpty")) else instance.setDescription(baseDescription+"\n"+lang.getTranslation("actions.descriptions.rolesEmpty"))
@@ -1178,7 +1175,7 @@ const clearEmbeds = () => {
const {guild,channel,user,filter,list} = params const {guild,channel,user,filter,list} = params
instance.setColor(generalConfig.data.mainColor) instance.setColor(generalConfig.data.mainColor)
instance.setTitle(utilities.emojiTitle("⚠️","Clear Tickets")) //TODO TRANSLATION!!! instance.setTitle(utilities.emojiTitle("⚠️",lang.getTranslation("actions.titles.clearTickets")))
instance.setAuthor(user.displayName,user.displayAvatarURL()) instance.setAuthor(user.displayName,user.displayAvatarURL())
instance.setTimestamp(new Date()) instance.setTimestamp(new Date())
instance.setDescription(lang.getTranslation("actions.descriptions.clearVerify")) instance.setDescription(lang.getTranslation("actions.descriptions.clearVerify"))
@@ -1324,9 +1321,9 @@ const extraEmbeds = () => {
instance.setAuthor(user.displayName,user.displayAvatarURL()) instance.setAuthor(user.displayName,user.displayAvatarURL())
instance.setColor(generalConfig.data.mainColor) instance.setColor(generalConfig.data.mainColor)
instance.setTitle(utilities.emojiTitle("ℹ️","Topic Changed")) //TODO TRANSLATION!!! instance.setTitle(utilities.emojiTitle("ℹ️",lang.getTranslation("actions.titles.topicSet")))
instance.setDescription("The channel topic has been changed by "+discord.userMention(user.id)+" successfully!") //TODO TRANSLATION!!! instance.setDescription(lang.getTranslationWithParams("actions.descriptions.topicSet",[discord.userMention(user.id)]))
if (topic) instance.addFields({name:"Topic"+":",value:"```"+topic+"```"}) //TODO TRANSLATION!!! if (topic) instance.addFields({name:lang.getTranslation("params.uppercase.topic")+":",value:"```"+topic+"```"})
}) })
) )
@@ -1338,8 +1335,8 @@ const extraEmbeds = () => {
instance.setAuthor(user.displayName,user.displayAvatarURL()) instance.setAuthor(user.displayName,user.displayAvatarURL())
instance.setColor(generalConfig.data.mainColor) instance.setColor(generalConfig.data.mainColor)
instance.setTitle(utilities.emojiTitle("🚨","Priority Changed")) //TODO TRANSLATION!!! instance.setTitle(utilities.emojiTitle("🚨",lang.getTranslation("actions.titles.prioritySet")))
instance.setDescription("The ticket priority has been changed to **"+priority.renderDisplayName()+"** by "+discord.userMention(user.id)+" successfully!") //TODO TRANSLATION!!! instance.setDescription(lang.getTranslationWithParams("actions.descriptions.prioritySet",["**"+priority.renderDisplayName()+"**",discord.userMention(user.id)]))
if (reason || generalConfig.data.system.alwaysShowReason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+(reason ?? "/")+"```"}) if (reason || generalConfig.data.system.alwaysShowReason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+(reason ?? "/")+"```"})
}) })
) )
@@ -1352,8 +1349,8 @@ const extraEmbeds = () => {
instance.setAuthor(user.displayName,user.displayAvatarURL()) instance.setAuthor(user.displayName,user.displayAvatarURL())
instance.setColor(generalConfig.data.mainColor) instance.setColor(generalConfig.data.mainColor)
instance.setTitle(utilities.emojiTitle("🚨","Ticket Priority")) //TODO TRANSLATION!!! instance.setTitle(utilities.emojiTitle("🚨",lang.getTranslation("actions.titles.priorityGet")))
instance.setDescription("The current priority of this ticket is **"+priority.renderDisplayName()+"**!") //TODO TRANSLATION!!! instance.setDescription(lang.getTranslationWithParams("actions.descriptions.priorityGet",["**"+priority.renderDisplayName()+"**"]))
}) })
) )
@@ -1365,8 +1362,8 @@ const extraEmbeds = () => {
instance.setAuthor(user.displayName,user.displayAvatarURL()) instance.setAuthor(user.displayName,user.displayAvatarURL())
instance.setColor(generalConfig.data.mainColor) instance.setColor(generalConfig.data.mainColor)
instance.setTitle(utilities.emojiTitle("🔀","Ticket Transferred")) //TODO TRANSLATION!!! instance.setTitle(utilities.emojiTitle("🔀",lang.getTranslation("actions.titles.transfer")))
instance.setDescription("The ticket ownership has been transferred from "+discord.userMention(oldCreator.id)+" to "+discord.userMention(newCreator.id)+" by "+discord.userMention(user.id)+" successfully!") //TODO TRANSLATION!!! instance.setDescription(lang.getTranslationWithParams("actions.descriptions.transfer",[discord.userMention(oldCreator.id),discord.userMention(newCreator.id),discord.userMention(user.id)]))
if (reason || generalConfig.data.system.alwaysShowReason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+(reason ?? "/")+"```"}) if (reason || generalConfig.data.system.alwaysShowReason) instance.addFields({name:lang.getTranslation("params.uppercase.reason")+":",value:"```"+(reason ?? "/")+"```"})
}) })
) )
+3 -2
View File
@@ -5,6 +5,7 @@ import {opendiscord, api, utilities} from "../index"
import * as discord from "discord.js" import * as discord from "discord.js"
const generalConfig = opendiscord.configs.get("opendiscord:general") const generalConfig = opendiscord.configs.get("opendiscord:general")
const lang = opendiscord.languages
export const registerCommandResponders = async () => { export const registerCommandResponders = async () => {
//CLOSE COMMAND RESPONDER //CLOSE COMMAND RESPONDER
@@ -68,11 +69,11 @@ export const registerCommandResponders = async () => {
if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){ if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){
const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel) const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel)
if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a user.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a ticket admin or support member.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeAdminMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
} }
+3 -2
View File
@@ -5,6 +5,7 @@ import {opendiscord, api, utilities} from "../index"
import * as discord from "discord.js" import * as discord from "discord.js"
const generalConfig = opendiscord.configs.get("opendiscord:general") const generalConfig = opendiscord.configs.get("opendiscord:general")
const lang = opendiscord.languages
export const registerCommandResponders = async () => { export const registerCommandResponders = async () => {
//DELETE COMMAND RESPONDER //DELETE COMMAND RESPONDER
@@ -63,11 +64,11 @@ export const registerCommandResponders = async () => {
if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){ if (!generalConfig.data.system.allowCloseBeforeMessage || !generalConfig.data.system.allowCloseBeforeAdminMessage){
const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel) const analysis = await opendiscord.transcripts.collector.ticketUserMessagesAnalysis(ticket,guild,channel)
if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeMessage && analysis.totalMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a user.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){ if (analysis && !generalConfig.data.system.allowCloseBeforeAdminMessage && analysis.adminMessages < 1){
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:"This ticket cannot be closed/deleted before a message has been sent by a ticket admin or support member.",customTitle:opendiscord.languages.getTranslation("errors.titles.noPermissions")})) //TODO TRANSLATION!!! instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,layout:"simple",error:lang.getTranslation("errors.descriptions.closeBeforeAdminMessage"),customTitle:lang.getTranslation("errors.titles.noPermissions")}))
return cancel() return cancel()
} }
} }
+4 -3
View File
@@ -5,6 +5,7 @@ import {opendiscord, api, utilities} from "../index"
import * as discord from "discord.js" import * as discord from "discord.js"
const generalConfig = opendiscord.configs.get("opendiscord:general") const generalConfig = opendiscord.configs.get("opendiscord:general")
const lang = opendiscord.languages
export const registerCommandResponders = async () => { export const registerCommandResponders = async () => {
//TICKET COMMAND RESPONDER //TICKET COMMAND RESPONDER
@@ -70,7 +71,7 @@ export const registerCommandResponders = async () => {
else if (res.reason == "global-user-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"global-user"})) else if (res.reason == "global-user-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"global-user"}))
else if (res.reason == "option-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option"})) else if (res.reason == "option-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option"}))
else if (res.reason == "option-user-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option-user"})) else if (res.reason == "option-user-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option-user"}))
else if (res.reason == "custom") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,layout:"simple",error:res.customReason ?? "You are unable to create a ticket. `Unknown invalid_permission_reason => no reason specified by plugin`",customTitle:"Permission Error"})) //TODO TRANSLATION!!! else if (res.reason == "custom") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,layout:"simple",error:res.customReason ?? lang.getTranslation("errors.descriptions.unableToCreateTicket")+" `Unknown invalid_permission_reason => no reason specified by plugin`",customTitle:lang.getTranslation("errors.titles.permissionError")}))
else instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Unknown invalid_permission reason => calculation failed #1",layout:"advanced"})) else instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Unknown invalid_permission reason => calculation failed #1",layout:"advanced"}))
return cancel() return cancel()
} }
@@ -133,7 +134,7 @@ export const registerButtonResponders = async () => {
else if (res.reason == "global-user-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"global-user"})) else if (res.reason == "global-user-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"global-user"}))
else if (res.reason == "option-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option"})) else if (res.reason == "option-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option"}))
else if (res.reason == "option-user-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option-user"})) else if (res.reason == "option-user-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option-user"}))
else if (res.reason == "custom") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,layout:"simple",error:res.customReason ?? "You are unable to create a ticket. `Unknown invalid_permission_reason => no reason specified by plugin`",customTitle:"Permission Error"})) //TODO TRANSLATION!!! else if (res.reason == "custom") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,layout:"simple",error:res.customReason ?? lang.getTranslation("errors.descriptions.unableToCreateTicket")+" `Unknown invalid_permission_reason => no reason specified by plugin`",customTitle:lang.getTranslation("errors.titles.permissionError")}))
else instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Unknown invalid_permission reason => calculation failed #1",layout:"advanced"})) else instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Unknown invalid_permission reason => calculation failed #1",layout:"advanced"}))
return cancel() return cancel()
} }
@@ -189,7 +190,7 @@ export const registerDropdownResponders = async () => {
else if (res.reason == "global-user-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"global-user"})) else if (res.reason == "global-user-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"global-user"}))
else if (res.reason == "option-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option"})) else if (res.reason == "option-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option"}))
else if (res.reason == "option-user-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option-user"})) else if (res.reason == "option-user-limit") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions-limits").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,limit:"option-user"}))
else if (res.reason == "custom") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,layout:"simple",error:res.customReason ?? "You are unable to create a ticket. `Unknown invalid_permission_reason => no reason specified by plugin`",customTitle:"Permission Error"})) //TODO TRANSLATION!!! else if (res.reason == "custom") instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,layout:"simple",error:res.customReason ?? lang.getTranslation("errors.descriptions.unableToCreateTicket")+" `Unknown invalid_permission_reason => no reason specified by plugin`",customTitle:lang.getTranslation("errors.titles.permissionError")}))
else instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Unknown invalid_permission reason => calculation failed #1",layout:"advanced"})) else instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build(source,{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Unknown invalid_permission reason => calculation failed #1",layout:"advanced"}))
return cancel() return cancel()
} }
+131 -2
View File
@@ -76,6 +76,7 @@ export type ODLanguageManagerTranslations_Default = (
"checker.system.dataPath"| "checker.system.dataPath"|
"checker.system.dataDocs"| "checker.system.dataDocs"|
"checker.system.dataMessages"| "checker.system.dataMessages"|
"checker.messages.invalidType"| "checker.messages.invalidType"|
"checker.messages.propertyMissing"| "checker.messages.propertyMissing"|
"checker.messages.propertyOptional"| "checker.messages.propertyOptional"|
@@ -83,6 +84,7 @@ export type ODLanguageManagerTranslations_Default = (
"checker.messages.nullInvalid"| "checker.messages.nullInvalid"|
"checker.messages.switchInvalidType"| "checker.messages.switchInvalidType"|
"checker.messages.objectSwitchInvalid"| "checker.messages.objectSwitchInvalid"|
"checker.messages.stringTooShort"| "checker.messages.stringTooShort"|
"checker.messages.stringTooLong"| "checker.messages.stringTooLong"|
"checker.messages.stringLengthInvalid"| "checker.messages.stringLengthInvalid"|
@@ -91,6 +93,15 @@ export type ODLanguageManagerTranslations_Default = (
"checker.messages.stringContains"| "checker.messages.stringContains"|
"checker.messages.stringChoices"| "checker.messages.stringChoices"|
"checker.messages.stringRegex"| "checker.messages.stringRegex"|
"checker.messages.stringInvertedContains"|
"checker.messages.stringLowercase"|
"checker.messages.stringUppercase"|
"checker.messages.stringSpecialCharacters"|
"checker.messages.stringNoSpaces"|
"checker.messages.stringCapitalWord"|
"checker.messages.stringCapitalSentence"|
"checker.messages.stringPunctuation"|
"checker.messages.numberTooShort"| "checker.messages.numberTooShort"|
"checker.messages.numberTooLong"| "checker.messages.numberTooLong"|
"checker.messages.numberLengthInvalid"| "checker.messages.numberLengthInvalid"|
@@ -107,8 +118,12 @@ export type ODLanguageManagerTranslations_Default = (
"checker.messages.numberNegative"| "checker.messages.numberNegative"|
"checker.messages.numberPositive"| "checker.messages.numberPositive"|
"checker.messages.numberZero"| "checker.messages.numberZero"|
"checker.messages.numberNan"|
"checker.messages.numberInvertedContains"|
"checker.messages.booleanTrue"| "checker.messages.booleanTrue"|
"checker.messages.booleanFalse"| "checker.messages.booleanFalse"|
"checker.messages.arrayEmptyDisabled"| "checker.messages.arrayEmptyDisabled"|
"checker.messages.arrayEmptyRequired"| "checker.messages.arrayEmptyRequired"|
"checker.messages.arrayTooShort"| "checker.messages.arrayTooShort"|
@@ -116,6 +131,7 @@ export type ODLanguageManagerTranslations_Default = (
"checker.messages.arrayLengthInvalid"| "checker.messages.arrayLengthInvalid"|
"checker.messages.arrayInvalidTypes"| "checker.messages.arrayInvalidTypes"|
"checker.messages.arrayDouble"| "checker.messages.arrayDouble"|
"checker.messages.discordInvalidId"| "checker.messages.discordInvalidId"|
"checker.messages.discordInvalidIdOptions"| "checker.messages.discordInvalidIdOptions"|
"checker.messages.discordInvalidToken"| "checker.messages.discordInvalidToken"|
@@ -137,6 +153,8 @@ export type ODLanguageManagerTranslations_Default = (
"checker.messages.unusedOption"| "checker.messages.unusedOption"|
"checker.messages.unusedQuestion"| "checker.messages.unusedQuestion"|
"checker.messages.dropdownOption"| "checker.messages.dropdownOption"|
"checker.messages.customInvalidVersion"|
"actions.buttons.create"| "actions.buttons.create"|
"actions.buttons.close"| "actions.buttons.close"|
"actions.buttons.delete"| "actions.buttons.delete"|
@@ -174,6 +192,7 @@ export type ODLanguageManagerTranslations_Default = (
"actions.titles.blacklistAddDm"| "actions.titles.blacklistAddDm"|
"actions.titles.blacklistRemoveDm"| "actions.titles.blacklistRemoveDm"|
"actions.titles.clear"| "actions.titles.clear"|
"actions.titles.clearTickets"|
"actions.titles.roles"| "actions.titles.roles"|
"actions.titles.autoclose"| "actions.titles.autoclose"|
@@ -183,6 +202,11 @@ export type ODLanguageManagerTranslations_Default = (
"actions.titles.autodeleteEnabled"| "actions.titles.autodeleteEnabled"|
"actions.titles.autodeleteDisabled"| "actions.titles.autodeleteDisabled"|
"actions.titles.topicSet"|
"actions.titles.prioritySet"|
"actions.titles.priorityGet"|
"actions.titles.transfer"|
"actions.descriptions.create"| "actions.descriptions.create"|
"actions.descriptions.close"| "actions.descriptions.close"|
"actions.descriptions.delete"| "actions.descriptions.delete"|
@@ -223,6 +247,11 @@ export type ODLanguageManagerTranslations_Default = (
"actions.descriptions.ticketMessageAutodelete"| "actions.descriptions.ticketMessageAutodelete"|
"actions.descriptions.panelReady"| "actions.descriptions.panelReady"|
"actions.descriptions.topicSet"|
"actions.descriptions.prioritySet"|
"actions.descriptions.priorityGet"|
"actions.descriptions.transfer"|
"actions.modal.closePlaceholder"| "actions.modal.closePlaceholder"|
"actions.modal.deletePlaceholder"| "actions.modal.deletePlaceholder"|
"actions.modal.reopenPlaceholder"| "actions.modal.reopenPlaceholder"|
@@ -261,6 +290,13 @@ export type ODLanguageManagerTranslations_Default = (
"actions.logs.blacklistRemoveDm"| "actions.logs.blacklistRemoveDm"|
"actions.logs.clearLog"| "actions.logs.clearLog"|
"actions.logs.transferLog"|
"actions.logs.transferDm"|
"actions.logs.prioritySetLog"|
"actions.logs.prioritySetDm"|
"actions.logs.roleUpdateLog"|
"actions.logs.roleUpdateDm"|
"transcripts.success.visit"| "transcripts.success.visit"|
"transcripts.success.ready"| "transcripts.success.ready"|
"transcripts.success.textFileDescription"| "transcripts.success.textFileDescription"|
@@ -277,6 +313,17 @@ export type ODLanguageManagerTranslations_Default = (
"transcripts.errors.continue"| "transcripts.errors.continue"|
"transcripts.errors.backup"| "transcripts.errors.backup"|
"transcripts.errors.error"| "transcripts.errors.error"|
"transcripts.errors.title"|
"transcripts.text.messagesTitle"|
"transcripts.text.embedTitle"|
"transcripts.text.fileTitle"|
"transcripts.text.fieldsTitle"|
"transcripts.text.reactionsTitle"|
"transcripts.text.statsTitle"|
"transcripts.text.emptyContent"|
"transcripts.text.noTitle"|
"transcripts.text.noDesc"|
"errors.titles.internalError"| "errors.titles.internalError"|
"errors.titles.optionMissing"| "errors.titles.optionMissing"|
@@ -290,6 +337,7 @@ export type ODLanguageManagerTranslations_Default = (
"errors.titles.notInGuild"| "errors.titles.notInGuild"|
"errors.titles.channelRename"| "errors.titles.channelRename"|
"errors.titles.busy"| "errors.titles.busy"|
"errors.titles.permissionError"|
"errors.descriptions.askForInfo"| "errors.descriptions.askForInfo"|
"errors.descriptions.askForInfoResolve"| "errors.descriptions.askForInfoResolve"|
@@ -312,6 +360,9 @@ export type ODLanguageManagerTranslations_Default = (
"errors.descriptions.channelRename"| "errors.descriptions.channelRename"|
"errors.descriptions.channelRenameSource"| "errors.descriptions.channelRenameSource"|
"errors.descriptions.busy"| "errors.descriptions.busy"|
"errors.descriptions.closeBeforeMessage"|
"errors.descriptions.closeBeforeAdminMessage"|
"errors.descriptions.unableToCreateTicket"|
"errors.optionInvalidReasons.stringRegex"| "errors.optionInvalidReasons.stringRegex"|
"errors.optionInvalidReasons.stringMinLength"| "errors.optionInvalidReasons.stringMinLength"|
@@ -356,7 +407,6 @@ export type ODLanguageManagerTranslations_Default = (
"params.uppercase.added"| "params.uppercase.added"|
"params.uppercase.removed"| "params.uppercase.removed"|
"params.uppercase.filter"| "params.uppercase.filter"|
"params.uppercase.claimedBy"|
"params.uppercase.method"| "params.uppercase.method"|
"params.uppercase.type"| "params.uppercase.type"|
"params.uppercase.blacklisted"| "params.uppercase.blacklisted"|
@@ -382,6 +432,27 @@ export type ODLanguageManagerTranslations_Default = (
"params.uppercase.pinned"| "params.uppercase.pinned"|
"params.uppercase.creationDate"| "params.uppercase.creationDate"|
"params.uppercase.noone"|
"params.uppercase.open"|
"params.uppercase.closed"|
"params.uppercase.priority"|
"params.uppercase.status"|
"params.uppercase.participants"|
"params.uppercase.yes"|
"params.uppercase.no"|
"params.uppercase.option"|
"params.uppercase.topic"|
"params.uppercase.uptime"|
"params.uppercase.messages"|
"params.uppercase.embeds"|
"params.uppercase.files"|
"params.uppercase.components"|
"params.uppercase.cooldown"|
"params.uppercase.maxTickets"|
"params.uppercase.admins"|
"params.uppercase.roles"|
"params.uppercase.size"|
"params.lowercase.text"| "params.lowercase.text"|
"params.lowercase.html"| "params.lowercase.html"|
"params.lowercase.command"| "params.lowercase.command"|
@@ -448,6 +519,18 @@ export type ODLanguageManagerTranslations_Default = (
"commands.autodeleteEnable"| "commands.autodeleteEnable"|
"commands.autodeleteEnableTime"| "commands.autodeleteEnableTime"|
"commands.topic"|
"commands.topicSet"|
"commands.topicValue"|
"commands.topicList"|
"commands.priority"|
"commands.prioritySet"|
"commands.priorityValue"|
"commands.priorityGet"|
"commands.priorityList"|
"commands.transfer"|
"commands.transferUser"|
"helpMenu.help"| "helpMenu.help"|
"helpMenu.ticket"| "helpMenu.ticket"|
"helpMenu.close"| "helpMenu.close"|
@@ -475,11 +558,20 @@ export type ODLanguageManagerTranslations_Default = (
"helpMenu.autodeleteDisable"| "helpMenu.autodeleteDisable"|
"helpMenu.autodeleteEnable"| "helpMenu.autodeleteEnable"|
"helpMenu.categories.general"|
"helpMenu.categories.basicTicket"|
"helpMenu.categories.advancedTicket"|
"helpMenu.categories.userTicket"|
"helpMenu.categories.admin"|
"helpMenu.categories.advanced"|
"helpMenu.categories.extra"|
"stats.scopes.global"| "stats.scopes.global"|
"stats.scopes.system"| "stats.scopes.system"|
"stats.scopes.user"| "stats.scopes.user"|
"stats.scopes.ticket"| "stats.scopes.ticket"|
"stats.scopes.participants"| "stats.scopes.participants"|
"stats.scopes.messages"|
"stats.properties.ticketsCreated"| "stats.properties.ticketsCreated"|
"stats.properties.ticketsClosed"| "stats.properties.ticketsClosed"|
@@ -490,7 +582,44 @@ export type ODLanguageManagerTranslations_Default = (
"stats.properties.ticketsPinned"| "stats.properties.ticketsPinned"|
"stats.properties.ticketsMoved"| "stats.properties.ticketsMoved"|
"stats.properties.usersBlacklisted"| "stats.properties.usersBlacklisted"|
"stats.properties.transcriptsCreated" "stats.properties.transcriptsCreated"|
"stats.properties.ticketsAutodeleted"|
"stats.properties.ticketsTransferred"|
"stats.properties.ticketVolume"|
"stats.properties.averageTickets"|
"stats.properties.currentTickets"|
"stats.properties.age"|
"stats.properties.responseTime"|
"stats.properties.resolutionTime"|
"stats.properties.createdOn"|
"stats.properties.createdBy"|
"stats.properties.closedOn"|
"stats.properties.closedBy"|
"stats.properties.claimedOn"|
"stats.properties.claimedBy"|
"stats.properties.pinnedOn"|
"stats.properties.pinnedBy"|
"stats.properties.deletedOn"|
"stats.properties.deletedBy"|
"stats.roles.developer"|
"stats.roles.serverOwner"|
"stats.roles.serverAdmin"|
"stats.roles.moderator"|
"stats.roles.support"|
"stats.roles.member"|
"panel.selectTicket"|
"panel.selectRole"|
"panel.selectOption"|
"priorities.urgent"|
"priorities.veryHigh"|
"priorities.high"|
"priorities.normal"|
"priorities.low"|
"priorities.veryLow"|
"priorities.none"
) )
/**## ODLanguageManager_Default `default_class` /**## ODLanguageManager_Default `default_class`
+11 -13
View File
@@ -78,18 +78,18 @@ export const registerDefaultCheckerMessageTranslations = (tm:api.ODCheckerTransl
tm.quickTranslate(lm,"checker.messages.stringStartsWith","message","opendiscord:string-starts-with") // This string needs to start with {0}! tm.quickTranslate(lm,"checker.messages.stringStartsWith","message","opendiscord:string-starts-with") // This string needs to start with {0}!
tm.quickTranslate(lm,"checker.messages.stringEndsWith","message","opendiscord:string-ends-with") // This string needs to end with {0}! tm.quickTranslate(lm,"checker.messages.stringEndsWith","message","opendiscord:string-ends-with") // This string needs to end with {0}!
tm.quickTranslate(lm,"checker.messages.stringContains","message","opendiscord:string-contains") // This string needs to contain {0}! tm.quickTranslate(lm,"checker.messages.stringContains","message","opendiscord:string-contains") // This string needs to contain {0}!
tm.quickTranslate(lm,"//TODO TRANSLATION!!!","message","opendiscord:string-inverted-contains") // This string is not allowed to contain {0}! tm.quickTranslate(lm,"checker.messages.stringInvertedContains","message","opendiscord:string-inverted-contains") // This string is not allowed to contain {0}!
tm.quickTranslate(lm,"checker.messages.stringChoices","message","opendiscord:string-choices") // This string can only be one of the following values: {0}! tm.quickTranslate(lm,"checker.messages.stringChoices","message","opendiscord:string-choices") // This string can only be one of the following values: {0}!
tm.quickTranslate(lm,"//TODO TRANSLATION!!!","message","opendiscord:string-lowercase") // This string must be written in lowercase only! tm.quickTranslate(lm,"checker.messages.stringLowercase","message","opendiscord:string-lowercase") // This string must be written in lowercase only!
tm.quickTranslate(lm,"//TODO TRANSLATION!!!","message","opendiscord:string-uppercase") // This string must be written in uppercase only! tm.quickTranslate(lm,"checker.messages.stringUppercase","message","opendiscord:string-uppercase") // This string must be written in uppercase only!
tm.quickTranslate(lm,"//TODO TRANSLATION!!!","message","opendiscord:string-special-characters") // This string is not allowed to contain any special characters! (a-z, 0-9 & space only) tm.quickTranslate(lm,"checker.messages.stringSpecialCharacters","message","opendiscord:string-special-characters") // This string is not allowed to contain any special characters! (a-z, 0-9 & space only)
tm.quickTranslate(lm,"//TODO TRANSLATION!!!","message","opendiscord:string-no-spaces") // This string is not allowed to contain spaces! tm.quickTranslate(lm,"checker.messages.stringNoSpaces","message","opendiscord:string-no-spaces") // This string is not allowed to contain spaces!
tm.quickTranslate(lm,"checker.messages.stringRegex","message","opendiscord:string-regex") // This string is invalid! tm.quickTranslate(lm,"checker.messages.stringRegex","message","opendiscord:string-regex") // This string is invalid!
tm.quickTranslate(lm,"//TODO TRANSLATION!!!","message","opendiscord:string-capital-word") // It's recommended that each word in this string starts with a capital letter! tm.quickTranslate(lm,"checker.messages.stringCapitalWord","message","opendiscord:string-capital-word") // It's recommended that each word in this string starts with a capital letter!
tm.quickTranslate(lm,"//TODO TRANSLATION!!!","message","opendiscord:string-capital-sentence") // It looks like some sentences in this string don't start with a capital letter! tm.quickTranslate(lm,"checker.messages.stringCapitalSentence","message","opendiscord:string-capital-sentence") // It looks like some sentences in this string don't start with a capital letter!
tm.quickTranslate(lm,"//TODO TRANSLATION!!!","message","opendiscord:string-punctuation") // It looks like the sentence in this string doesn't end with a punctuation mark! tm.quickTranslate(lm,"checker.messages.stringPunctuation","message","opendiscord:string-punctuation") // It looks like the sentence in this string doesn't end with a punctuation mark!
tm.quickTranslate(lm,"//TODO TRANSLATION!!!","message","opendiscord:number-nan") // This number can't be NaN (Not A Number)! tm.quickTranslate(lm,"checker.messages.numberNan","message","opendiscord:number-nan") // This number can't be NaN (Not A Number)!
tm.quickTranslate(lm,"checker.messages.numberTooShort","message","opendiscord:number-too-short") // This number can't be shorter than {0} characters! tm.quickTranslate(lm,"checker.messages.numberTooShort","message","opendiscord:number-too-short") // This number can't be shorter than {0} characters!
tm.quickTranslate(lm,"checker.messages.numberTooLong","message","opendiscord:number-too-long") // This number can't be longer than {0} characters! tm.quickTranslate(lm,"checker.messages.numberTooLong","message","opendiscord:number-too-long") // This number can't be longer than {0} characters!
tm.quickTranslate(lm,"checker.messages.numberLengthInvalid","message","opendiscord:number-length-invalid") // This number needs to be {0} characters long! tm.quickTranslate(lm,"checker.messages.numberLengthInvalid","message","opendiscord:number-length-invalid") // This number needs to be {0} characters long!
@@ -101,7 +101,7 @@ export const registerDefaultCheckerMessageTranslations = (tm:api.ODCheckerTransl
tm.quickTranslate(lm,"checker.messages.numberStartsWith","message","opendiscord:number-starts-with") // This number needs to start with {0}! tm.quickTranslate(lm,"checker.messages.numberStartsWith","message","opendiscord:number-starts-with") // This number needs to start with {0}!
tm.quickTranslate(lm,"checker.messages.numberEndsWith","message","opendiscord:number-ends-with") // This number needs to end with {0}! tm.quickTranslate(lm,"checker.messages.numberEndsWith","message","opendiscord:number-ends-with") // This number needs to end with {0}!
tm.quickTranslate(lm,"checker.messages.numberContains","message","opendiscord:number-contains") // This number needs to contain {0}! tm.quickTranslate(lm,"checker.messages.numberContains","message","opendiscord:number-contains") // This number needs to contain {0}!
tm.quickTranslate(lm,"//TODO TRANSLATION!!!","message","opendiscord:number-inverted-contains") // This number is not allowed to contain {0}! tm.quickTranslate(lm,"checker.messages.numberInvertedContains","message","opendiscord:number-inverted-contains") // This number is not allowed to contain {0}!
tm.quickTranslate(lm,"checker.messages.numberChoices","message","opendiscord:number-choices") // This number can only be one of the following values: {0}! tm.quickTranslate(lm,"checker.messages.numberChoices","message","opendiscord:number-choices") // This number can only be one of the following values: {0}!
tm.quickTranslate(lm,"checker.messages.numberFloat","message","opendiscord:number-float") // This number can't be a decimal! tm.quickTranslate(lm,"checker.messages.numberFloat","message","opendiscord:number-float") // This number can't be a decimal!
tm.quickTranslate(lm,"checker.messages.numberNegative","message","opendiscord:number-negative") // This number can't be negative! tm.quickTranslate(lm,"checker.messages.numberNegative","message","opendiscord:number-negative") // This number can't be negative!
@@ -144,9 +144,7 @@ export const registerDefaultCheckerCustomTranslations = (tm:api.ODCheckerTransla
tm.quickTranslate(lm,"checker.messages.unusedOption","message","opendiscord:unused-option") // The option {0} isn't used anywhere! tm.quickTranslate(lm,"checker.messages.unusedOption","message","opendiscord:unused-option") // The option {0} isn't used anywhere!
tm.quickTranslate(lm,"checker.messages.unusedQuestion","message","opendiscord:unused-question") // The question {0} isn't used anywhere! tm.quickTranslate(lm,"checker.messages.unusedQuestion","message","opendiscord:unused-question") // The question {0} isn't used anywhere!
tm.quickTranslate(lm,"checker.messages.dropdownOption","message","opendiscord:dropdown-option") // A panel with dropdown enabled can only contain options of the 'ticket' type! tm.quickTranslate(lm,"checker.messages.dropdownOption","message","opendiscord:dropdown-option") // A panel with dropdown enabled can only contain options of the 'ticket' type!
tm.quickTranslate(lm,"checker.messages.customInvalidVersion","message","opendiscord:invalid-version") // The version specified in your config does not match! Make sure you have updated the config to the latest version!
//TODO TRANSLATION!!!
//tm.quickTranslate(lm,"checker.messages.TODO","message","opendiscord:invalid-version") // The version specified in your config does not match! Make sure you have updated the config to the latest version!
} }
//UTILITY FUNCTIONS //UTILITY FUNCTIONS
+9 -9
View File
@@ -560,18 +560,18 @@ export const loadAllSlashCommands = async () => {
if (allowedCommands.includes("topic")) commands.add(new api.ODSlashCommand("opendiscord:topic",{ if (allowedCommands.includes("topic")) commands.add(new api.ODSlashCommand("opendiscord:topic",{
type:act.ChatInput, type:act.ChatInput,
name:"topic", name:"topic",
description:"Manage the topic of the ticket channel.", //TODO TRANSLATION!!! description:lang.getTranslation("commands.topic"),
contexts:[discord.InteractionContextType.Guild], contexts:[discord.InteractionContextType.Guild],
integrationTypes:[discord.ApplicationIntegrationType.GuildInstall], integrationTypes:[discord.ApplicationIntegrationType.GuildInstall],
options:[ options:[
{ {
name:"set", name:"set",
description:"Set the topic of the ticket channel to a specific value.", //TODO TRANSLATION!!! description:lang.getTranslation("commands.topicSet"),
type:acot.Subcommand, type:acot.Subcommand,
options:[ options:[
{ {
name:"topic", name:"topic",
description:"The new topic of the channel.", description:lang.getTranslation("commands.topicValue"),
type:acot.String, type:acot.String,
required:true required:true
} }
@@ -585,18 +585,18 @@ export const loadAllSlashCommands = async () => {
if (allowedCommands.includes("priority")) commands.add(new api.ODSlashCommand("opendiscord:priority",{ if (allowedCommands.includes("priority")) commands.add(new api.ODSlashCommand("opendiscord:priority",{
type:act.ChatInput, type:act.ChatInput,
name:"priority", name:"priority",
description:"Manage the priority of the ticket.", //TODO TRANSLATION!!! description:lang.getTranslation("commands.priority"),
contexts:[discord.InteractionContextType.Guild], contexts:[discord.InteractionContextType.Guild],
integrationTypes:[discord.ApplicationIntegrationType.GuildInstall], integrationTypes:[discord.ApplicationIntegrationType.GuildInstall],
options:[ options:[
{ {
name:"set", name:"set",
description:"Set the priority of the ticket.", //TODO TRANSLATION!!! description:lang.getTranslation("commands.prioritySet"),
type:acot.Subcommand, type:acot.Subcommand,
options:[ options:[
{ {
name:"priority", name:"priority",
description:"The priority of the channel.", description:lang.getTranslation("commands.priorityValue"),
type:acot.String, type:acot.String,
required:true, required:true,
choices:opendiscord.priorities.getAll().sort((a,b) => b.priority-a.priority).map((prio) => ({value:prio.rawName,name:prio.renderDisplayName()})) choices:opendiscord.priorities.getAll().sort((a,b) => b.priority-a.priority).map((prio) => ({value:prio.rawName,name:prio.renderDisplayName()}))
@@ -611,7 +611,7 @@ export const loadAllSlashCommands = async () => {
}, },
{ {
name:"get", name:"get",
description:"Get the priority of the ticket.", //TODO TRANSLATION!!! description:lang.getTranslation("commands.priorityGet"),
type:acot.Subcommand type:acot.Subcommand
}, },
//TODO: list (v4.2) //TODO: list (v4.2)
@@ -622,13 +622,13 @@ export const loadAllSlashCommands = async () => {
if (allowedCommands.includes("transfer")) commands.add(new api.ODSlashCommand("opendiscord:transfer",{ if (allowedCommands.includes("transfer")) commands.add(new api.ODSlashCommand("opendiscord:transfer",{
type:act.ChatInput, type:act.ChatInput,
name:"transfer", name:"transfer",
description:"Transfer the ticket ownership from one user to another.", //TODO TRANSLATION!!! description:lang.getTranslation("commands.transfer"),
contexts:[discord.InteractionContextType.Guild], contexts:[discord.InteractionContextType.Guild],
integrationTypes:[discord.ApplicationIntegrationType.GuildInstall], integrationTypes:[discord.ApplicationIntegrationType.GuildInstall],
options:[ options:[
{ {
name:"user", name:"user",
description:"The user to transfer to.", //TODO TRANSLATION!!! description:lang.getTranslation("commands.transferUser"),
type:acot.User, type:acot.User,
required:true required:true
}, },
+13 -13
View File
@@ -15,13 +15,13 @@ const lang = opendiscord.languages
export const loadAllHelpMenuCategories = async () => { export const loadAllHelpMenuCategories = async () => {
const helpmenu = opendiscord.helpmenu const helpmenu = opendiscord.helpmenu
helpmenu.add(new api.ODHelpMenuCategory("opendiscord:general",5,utilities.emojiTitle("📎","General Commands"))) //TODO TRANSLATION!!! helpmenu.add(new api.ODHelpMenuCategory("opendiscord:general",5,utilities.emojiTitle("📎",lang.getTranslation("helpMenu.categories.general"))))
helpmenu.add(new api.ODHelpMenuCategory("opendiscord:ticket-basic",4,utilities.emojiTitle("🎫","Basic Ticket Commands"))) //TODO TRANSLATION!!! helpmenu.add(new api.ODHelpMenuCategory("opendiscord:ticket-basic",4,utilities.emojiTitle("🎫",lang.getTranslation("helpMenu.categories.basicTicket"))))
helpmenu.add(new api.ODHelpMenuCategory("opendiscord:ticket-advanced",4,utilities.emojiTitle("💡","Advanced Ticket Commands"))) //TODO TRANSLATION!!! helpmenu.add(new api.ODHelpMenuCategory("opendiscord:ticket-advanced",4,utilities.emojiTitle("💡",lang.getTranslation("helpMenu.categories.advancedTicket"))))
helpmenu.add(new api.ODHelpMenuCategory("opendiscord:ticket-user",3,utilities.emojiTitle("👤","User Ticket Commands"))) //TODO TRANSLATION!!! helpmenu.add(new api.ODHelpMenuCategory("opendiscord:ticket-user",3,utilities.emojiTitle("👤",lang.getTranslation("helpMenu.categories.userTicket"))))
helpmenu.add(new api.ODHelpMenuCategory("opendiscord:admin",2,utilities.emojiTitle("🚨","Admin Commands"))) //TODO TRANSLATION!!! helpmenu.add(new api.ODHelpMenuCategory("opendiscord:admin",2,utilities.emojiTitle("🚨",lang.getTranslation("helpMenu.categories.admin"))))
helpmenu.add(new api.ODHelpMenuCategory("opendiscord:advanced",1,utilities.emojiTitle("🚧","Advanced Commands"))) //TODO TRANSLATION!!! helpmenu.add(new api.ODHelpMenuCategory("opendiscord:advanced",1,utilities.emojiTitle("🚧",lang.getTranslation("helpMenu.categories.advanced"))))
helpmenu.add(new api.ODHelpMenuCategory("opendiscord:extra",0,utilities.emojiTitle("✨","Extra Commands"))) //TODO TRANSLATION!!! helpmenu.add(new api.ODHelpMenuCategory("opendiscord:extra",0,utilities.emojiTitle("✨",lang.getTranslation("helpMenu.categories.extra"))))
} }
export const loadAllHelpMenuComponents = async () => { export const loadAllHelpMenuComponents = async () => {
@@ -163,9 +163,9 @@ export const loadAllHelpMenuComponents = async () => {
})) }))
if (allowedCommands.includes("transfer")) ticketUser.add(new api.ODHelpMenuCommandComponent("opendiscord:transfer",-1,{ if (allowedCommands.includes("transfer")) ticketUser.add(new api.ODHelpMenuCommandComponent("opendiscord:transfer",-1,{
textName:prefix+"transfer", textName:prefix+"transfer",
textDescription:"Transfer the ticket ownership from one user to another.", //TODO TRANSLATION!!! textDescription:lang.getTranslation("commands.transfer"),
slashName:"/transfer", slashName:"/transfer",
slashDescription:"Transfer the ticket ownership from one user to another.", //TODO TRANSLATION!!! slashDescription:lang.getTranslation("commands.transfer"),
textOptions:[{name:"user",optional:false},{name:"reason",optional:true}], textOptions:[{name:"user",optional:false},{name:"reason",optional:true}],
slashOptions:[{name:"user",optional:false},{name:"reason",optional:true}] slashOptions:[{name:"user",optional:false},{name:"reason",optional:true}]
})) }))
@@ -279,17 +279,17 @@ export const loadAllHelpMenuComponents = async () => {
})) }))
if (allowedCommands.includes("topic")) advanced.add(new api.ODHelpMenuCommandComponent("opendiscord:topic-set",1,{ if (allowedCommands.includes("topic")) advanced.add(new api.ODHelpMenuCommandComponent("opendiscord:topic-set",1,{
textName:prefix+"topic set", textName:prefix+"topic set",
textDescription:"Set the topic of the ticket channel.", //TODO TRANSLATION!!! textDescription:lang.getTranslation("commands.topicSet"),
slashName:"/topic set", slashName:"/topic set",
slashDescription:"Manage the topic of the ticket channel.", //TODO TRANSLATION!!! slashDescription:lang.getTranslation("commands.topicSet"),
textOptions:[{name:"topic",optional:false}], textOptions:[{name:"topic",optional:false}],
slashOptions:[{name:"topic",optional:false}] slashOptions:[{name:"topic",optional:false}]
})) }))
if (allowedCommands.includes("priority")) advanced.add(new api.ODHelpMenuCommandComponent("opendiscord:priority-set",0,{ if (allowedCommands.includes("priority")) advanced.add(new api.ODHelpMenuCommandComponent("opendiscord:priority-set",0,{
textName:prefix+"priority set", textName:prefix+"priority set",
textDescription:"Set the priority of the ticket.", //TODO TRANSLATION!!! textDescription:lang.getTranslation("commands.prioritySet"),
slashName:"/priority set", slashName:"/priority set",
slashDescription:"Manage the priority of the ticket.", //TODO TRANSLATION!!! slashDescription:lang.getTranslation("commands.prioritySet"),
textOptions:[{name:"priority",optional:false},{name:"reason",optional:true}], textOptions:[{name:"priority",optional:false},{name:"reason",optional:true}],
slashOptions:[{name:"priority",optional:false},{name:"reason",optional:true}] slashOptions:[{name:"priority",optional:false},{name:"reason",optional:true}]
})) }))
+25 -24
View File
@@ -10,7 +10,7 @@ export const loadAllStatScopes = async () => {
stats.add(new api.ODStatScope("opendiscord:user",utilities.emojiTitle("📊",lang.getTranslation("stats.scopes.user")))) stats.add(new api.ODStatScope("opendiscord:user",utilities.emojiTitle("📊",lang.getTranslation("stats.scopes.user"))))
stats.add(new api.ODStatScope("opendiscord:ticket",utilities.emojiTitle("📊",lang.getTranslation("stats.scopes.ticket")))) stats.add(new api.ODStatScope("opendiscord:ticket",utilities.emojiTitle("📊",lang.getTranslation("stats.scopes.ticket"))))
stats.add(new api.ODStatScope("opendiscord:participants",utilities.emojiTitle("👥",lang.getTranslation("stats.scopes.participants")))) stats.add(new api.ODStatScope("opendiscord:participants",utilities.emojiTitle("👥",lang.getTranslation("stats.scopes.participants"))))
stats.add(new api.ODStatScope("opendiscord:messages",utilities.emojiTitle("💬","Messages"))) //TODO TRANSLATION!!! stats.add(new api.ODStatScope("opendiscord:messages",utilities.emojiTitle("💬",lang.getTranslation("stats.scopes.messages"))))
} }
export const loadAllStats = async () => { export const loadAllStats = async () => {
@@ -24,21 +24,21 @@ export const loadAllStats = async () => {
global.add(new api.ODBasicStat("opendiscord:tickets-deleted",11,lang.getTranslation("stats.properties.ticketsDeleted"),0)) global.add(new api.ODBasicStat("opendiscord:tickets-deleted",11,lang.getTranslation("stats.properties.ticketsDeleted"),0))
global.add(new api.ODBasicStat("opendiscord:tickets-reopened",10,lang.getTranslation("stats.properties.ticketsReopened"),0)) global.add(new api.ODBasicStat("opendiscord:tickets-reopened",10,lang.getTranslation("stats.properties.ticketsReopened"),0))
global.add(new api.ODBasicStat("opendiscord:tickets-autoclosed",9,lang.getTranslation("stats.properties.ticketsAutoclosed"),0)) global.add(new api.ODBasicStat("opendiscord:tickets-autoclosed",9,lang.getTranslation("stats.properties.ticketsAutoclosed"),0))
global.add(new api.ODBasicStat("opendiscord:tickets-autodeleted",8,"Tickets Autodeleted",0)) //TODO TRANSLATION!!! global.add(new api.ODBasicStat("opendiscord:tickets-autodeleted",8,lang.getTranslation("stats.properties.ticketsAutodeleted"),0))
global.add(new api.ODBasicStat("opendiscord:tickets-claimed",7,lang.getTranslation("stats.properties.ticketsClaimed"),0)) global.add(new api.ODBasicStat("opendiscord:tickets-claimed",7,lang.getTranslation("stats.properties.ticketsClaimed"),0))
global.add(new api.ODBasicStat("opendiscord:tickets-pinned",6,lang.getTranslation("stats.properties.ticketsPinned"),0)) global.add(new api.ODBasicStat("opendiscord:tickets-pinned",6,lang.getTranslation("stats.properties.ticketsPinned"),0))
global.add(new api.ODBasicStat("opendiscord:tickets-moved",5,lang.getTranslation("stats.properties.ticketsMoved"),0)) global.add(new api.ODBasicStat("opendiscord:tickets-moved",5,lang.getTranslation("stats.properties.ticketsMoved"),0))
global.add(new api.ODBasicStat("opendiscord:tickets-transferred",4,"Tickets Transferred",0)) //TODO TRANSLATION!!! global.add(new api.ODBasicStat("opendiscord:tickets-transferred",4,lang.getTranslation("stats.properties.ticketsTransferred"),0))
global.add(new api.ODBasicStat("opendiscord:users-blacklisted",3,lang.getTranslation("stats.properties.usersBlacklisted"),0)) global.add(new api.ODBasicStat("opendiscord:users-blacklisted",3,lang.getTranslation("stats.properties.usersBlacklisted"),0))
global.add(new api.ODBasicStat("opendiscord:transcripts-created",2,lang.getTranslation("stats.properties.transcriptsCreated"),0)) global.add(new api.ODBasicStat("opendiscord:transcripts-created",2,lang.getTranslation("stats.properties.transcriptsCreated"),0))
global.add(new api.ODDynamicStat("opendiscord:ticket-volume",1,() => { global.add(new api.ODDynamicStat("opendiscord:ticket-volume",1,() => {
return "Ticket Volume: `"+opendiscord.tickets.getLength()+"`" //TODO TRANSLATION!!! return lang.getTranslation("stats.properties.ticketVolume")+": `"+opendiscord.tickets.getLength()+"`"
})) }))
global.add(new api.ODDynamicStat("opendiscord:average-tickets",0,async () => { global.add(new api.ODDynamicStat("opendiscord:average-tickets",0,async () => {
const userTicketsCreated = await opendiscord.stats.get("opendiscord:user").getAllStats("opendiscord:tickets-created") const userTicketsCreated = await opendiscord.stats.get("opendiscord:user").getAllStats("opendiscord:tickets-created")
const average = userTicketsCreated.map((s) => s.value as number).filter((t) => t > 0).reduce((prev,curr) => prev+curr,0)/userTicketsCreated.length const average = userTicketsCreated.map((s) => s.value as number).filter((t) => t > 0).reduce((prev,curr) => prev+curr,0)/userTicketsCreated.length
const roundedAverage = Math.round(average*1000)/1000 const roundedAverage = Math.round(average*1000)/1000
return "Average Tickets/User: `"+roundedAverage+"`" //TODO TRANSLATION!!! return lang.getTranslation("stats.properties.averageTickets")+": `"+roundedAverage+"`"
})) }))
} }
@@ -48,7 +48,7 @@ export const loadAllStats = async () => {
return lang.getTranslation("params.uppercase.startupDate")+": "+discord.time(opendiscord.processStartupDate,"f") return lang.getTranslation("params.uppercase.startupDate")+": "+discord.time(opendiscord.processStartupDate,"f")
})) }))
system.add(new api.ODDynamicStat("opendiscord:system-uptime",1,() => { system.add(new api.ODDynamicStat("opendiscord:system-uptime",1,() => {
return "System Uptime: "+discord.time(opendiscord.processStartupDate,"R") //TODO TRANSLATION!!! return lang.getTranslation("params.uppercase.uptime")+": "+discord.time(opendiscord.processStartupDate,"R")
})) }))
system.add(new api.ODDynamicStat("opendiscord:version",0,() => { system.add(new api.ODDynamicStat("opendiscord:version",0,() => {
return lang.getTranslation("params.uppercase.version")+": `"+opendiscord.versions.get("opendiscord:version").toString()+"`" return lang.getTranslation("params.uppercase.version")+": `"+opendiscord.versions.get("opendiscord:version").toString()+"`"
@@ -65,12 +65,12 @@ export const loadAllStats = async () => {
if (!scopeMember) return "" if (!scopeMember) return ""
const permissions = await opendiscord.permissions.getPermissions(scopeMember.user,channel,guild) const permissions = await opendiscord.permissions.getPermissions(scopeMember.user,channel,guild)
if (permissions.type == "developer") return lang.getTranslation("params.uppercase.role")+": 💻 `Developer`" //TODO TRANSLATION!!! if (permissions.type == "developer") return lang.getTranslation("params.uppercase.role")+": 💻 `"+lang.getTranslation("stats.roles.developer")+"`"
if (permissions.type == "owner") return lang.getTranslation("params.uppercase.role")+": 👑 `Server Owner`" //TODO TRANSLATION!!! if (permissions.type == "owner") return lang.getTranslation("params.uppercase.role")+": 👑 `"+lang.getTranslation("stats.roles.serverOwner")+"`"
if (permissions.type == "admin") return lang.getTranslation("params.uppercase.role")+": 💼 `Server Admin`" //TODO TRANSLATION!!! if (permissions.type == "admin") return lang.getTranslation("params.uppercase.role")+": 💼 `"+lang.getTranslation("stats.roles.serverAdmin")+"`"
if (permissions.type == "moderator") return lang.getTranslation("params.uppercase.role")+": 🚔 `Moderator Team`" //TODO TRANSLATION!!! if (permissions.type == "moderator") return lang.getTranslation("params.uppercase.role")+": 🚔 `"+lang.getTranslation("stats.roles.moderator")+"`"
if (permissions.type == "support") return lang.getTranslation("params.uppercase.role")+": 💬 `Support Team`" //TODO TRANSLATION!!! if (permissions.type == "support") return lang.getTranslation("params.uppercase.role")+": 💬 `"+lang.getTranslation("stats.roles.support")+"`"
else return lang.getTranslation("params.uppercase.role")+": 👤 `Member`" //TODO TRANSLATION!!! else return lang.getTranslation("params.uppercase.role")+": 👤 `"+lang.getTranslation("stats.roles.member")+"`"
})) }))
user.add(new api.ODBasicStat("opendiscord:tickets-created",10,lang.getTranslation("stats.properties.ticketsCreated"),0)) user.add(new api.ODBasicStat("opendiscord:tickets-created",10,lang.getTranslation("stats.properties.ticketsCreated"),0))
user.add(new api.ODBasicStat("opendiscord:tickets-closed",9,lang.getTranslation("stats.properties.ticketsClosed"),0)) user.add(new api.ODBasicStat("opendiscord:tickets-closed",9,lang.getTranslation("stats.properties.ticketsClosed"),0))
@@ -79,11 +79,11 @@ export const loadAllStats = async () => {
user.add(new api.ODBasicStat("opendiscord:tickets-claimed",6,lang.getTranslation("stats.properties.ticketsClaimed"),0)) user.add(new api.ODBasicStat("opendiscord:tickets-claimed",6,lang.getTranslation("stats.properties.ticketsClaimed"),0))
user.add(new api.ODBasicStat("opendiscord:tickets-pinned",5,lang.getTranslation("stats.properties.ticketsPinned"),0)) user.add(new api.ODBasicStat("opendiscord:tickets-pinned",5,lang.getTranslation("stats.properties.ticketsPinned"),0))
user.add(new api.ODBasicStat("opendiscord:tickets-moved",4,lang.getTranslation("stats.properties.ticketsMoved"),0)) user.add(new api.ODBasicStat("opendiscord:tickets-moved",4,lang.getTranslation("stats.properties.ticketsMoved"),0))
user.add(new api.ODBasicStat("opendiscord:tickets-transferred",3,"Tickets Transferred",0)) //TODO TRANSLATION!!! user.add(new api.ODBasicStat("opendiscord:tickets-transferred",3,lang.getTranslation("stats.properties.ticketsTransferred"),0))
user.add(new api.ODBasicStat("opendiscord:users-blacklisted",2,lang.getTranslation("stats.properties.usersBlacklisted"),0)) user.add(new api.ODBasicStat("opendiscord:users-blacklisted",2,lang.getTranslation("stats.properties.usersBlacklisted"),0))
user.add(new api.ODBasicStat("opendiscord:transcripts-created",1,lang.getTranslation("stats.properties.transcriptsCreated"),0)) user.add(new api.ODBasicStat("opendiscord:transcripts-created",1,lang.getTranslation("stats.properties.transcriptsCreated"),0))
user.add(new api.ODDynamicStat("opendiscord:current-tickets",0,async (scopeId,guild,channel,user) => { user.add(new api.ODDynamicStat("opendiscord:current-tickets",0,async (scopeId,guild,channel,user) => {
return "Current Tickets: `"+opendiscord.tickets.getFiltered((t) => t.get("opendiscord:opened-by").value === scopeId).length+"`" //TODO TRANSLATION!!! return lang.getTranslation("stats.properties.currentTickets")+": `"+opendiscord.tickets.getFiltered((t) => t.get("opendiscord:opened-by").value === scopeId).length+"`"
})) }))
} }
@@ -98,21 +98,21 @@ export const loadAllStats = async () => {
const closed = ticket.exists("opendiscord:closed") ? ticket.get("opendiscord:closed").value : false const closed = ticket.exists("opendiscord:closed") ? ticket.get("opendiscord:closed").value : false
return closed ? lang.getTranslation("params.uppercase.status")+": 🔒 `Closed`" : lang.getTranslation("params.uppercase.status")+": 🔓 `Open`" //TODO TRANSLATION!!! return closed ? lang.getTranslation("params.uppercase.status")+": 🔒 `"+lang.getTranslation("params.uppercase.closed")+"`" : lang.getTranslation("params.uppercase.status")+": 🔓 `"+lang.getTranslation("params.uppercase.open")+"`"
})) }))
ticket.add(new api.ODDynamicStat("opendiscord:claimed",3,async (scopeId,guild,channel,user) => { ticket.add(new api.ODDynamicStat("opendiscord:claimed",3,async (scopeId,guild,channel,user) => {
const ticket = opendiscord.tickets.get(scopeId) const ticket = opendiscord.tickets.get(scopeId)
if (!ticket) return "" if (!ticket) return ""
const claimed = ticket.exists("opendiscord:claimed") ? ticket.get("opendiscord:claimed").value : false const claimed = ticket.exists("opendiscord:claimed") ? ticket.get("opendiscord:claimed").value : false
return claimed ? lang.getTranslation("params.uppercase.claimed")+": 🟢 `Yes`" : lang.getTranslation("params.uppercase.claimed")+": 🔴 `No`" //TODO TRANSLATION!!! return claimed ? lang.getTranslation("params.uppercase.claimed")+": 🟢 `"+lang.getTranslation("params.uppercase.yes")+"`" : lang.getTranslation("params.uppercase.claimed")+": 🔴 `"+lang.getTranslation("params.uppercase.no")+"`"
})) }))
ticket.add(new api.ODDynamicStat("opendiscord:pinned",2,async (scopeId,guild,channel,user) => { ticket.add(new api.ODDynamicStat("opendiscord:pinned",2,async (scopeId,guild,channel,user) => {
const ticket = opendiscord.tickets.get(scopeId) const ticket = opendiscord.tickets.get(scopeId)
if (!ticket) return "" if (!ticket) return ""
const pinned = ticket.exists("opendiscord:pinned") ? ticket.get("opendiscord:pinned").value : false const pinned = ticket.exists("opendiscord:pinned") ? ticket.get("opendiscord:pinned").value : false
return pinned ? lang.getTranslation("params.uppercase.pinned")+": 🟢 `Yes`" : lang.getTranslation("params.uppercase.pinned")+": 🔴 `No`" //TODO TRANSLATION!!! return pinned ? lang.getTranslation("params.uppercase.pinned")+": 🟢 `"+lang.getTranslation("params.uppercase.yes")+"`" : lang.getTranslation("params.uppercase.pinned")+": 🔴 `"+lang.getTranslation("params.uppercase.no")+"`"
})) }))
ticket.add(new api.ODDynamicStat("opendiscord:creation-date",1,async (scopeId,guild,channel,user) => { ticket.add(new api.ODDynamicStat("opendiscord:creation-date",1,async (scopeId,guild,channel,user) => {
const ticket = opendiscord.tickets.get(scopeId) const ticket = opendiscord.tickets.get(scopeId)
@@ -133,10 +133,11 @@ export const loadAllStats = async () => {
if (!ticket) return "" if (!ticket) return ""
const rawDate = ticket.get("opendiscord:opened-on").value ?? new Date().getTime() const rawDate = ticket.get("opendiscord:opened-on").value ?? new Date().getTime()
return "Ticket Age: "+discord.time(new Date(rawDate),"R") //TODO TRANSLATION!!! return lang.getTranslation("stats.properties.age")+": "+discord.time(new Date(rawDate),"R")
})) }))
//TODO: opendiscord:response-time //TODO TRANSLATION!!!
//TODO: opendiscord:resolution-time //TODO TRANSLATION!!! //TODO: opendiscord:response-time --> lang.getTranslation("stats.properties.responseTime")
//TODO: opendiscord:resolution-time --> lang.getTranslation("stats.properties.resolutionTime")
} }
const participants = stats.get("opendiscord:participants") const participants = stats.get("opendiscord:participants")
@@ -178,10 +179,10 @@ export const loadAllStats = async () => {
} }
return [ return [
"Messages: `"+messageCount+"`", //TODO TRANSLATION!!! lang.getTranslation("params.uppercase.messages")+": `"+messageCount+"`",
"Embeds: `"+embedCount+"`", //TODO TRANSLATION!!! lang.getTranslation("params.uppercase.embeds")+": `"+embedCount+"`",
"Files: `"+fileCount+"`", //TODO TRANSLATION!!! lang.getTranslation("params.uppercase.files")+": `"+fileCount+"`",
"Components: `"+componentCount+"`" //TODO TRANSLATION!!! lang.getTranslation("params.uppercase.components")+": `"+componentCount+"`"
].join("\n") ].join("\n")
})) }))
+11 -20
View File
@@ -1,6 +1,8 @@
import {opendiscord, api, utilities} from "../../index" import {opendiscord, api, utilities} from "../../index"
import * as discord from "discord.js" import * as discord from "discord.js"
const lang = opendiscord.languages
export const loadAllPanels = async () => { export const loadAllPanels = async () => {
const panelConfig = opendiscord.configs.get("opendiscord:panels") const panelConfig = opendiscord.configs.get("opendiscord:panels")
if (!panelConfig) return if (!panelConfig) return
@@ -75,8 +77,7 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): {
} }
}) })
//TODO TRANSLATION!!! const autotitle = (hasTicket && ticketOnly) ? lang.getTranslation("panel.selectTicket")+":" : ((hasRole && roleOnly) ? lang.getTranslation("panel.selectRole")+":" : lang.getTranslation("panel.selectOption")+":")
const autotitle = (hasTicket && ticketOnly) ? "Select your ticket:" : ((hasRole && roleOnly) ? "Select your role:" : "Select your option:")
const title = (panel.get("opendiscord:describe-options-custom-title").value.length < 1) ? "__"+autotitle+"__\n" : "__"+panel.get("opendiscord:describe-options-custom-title").value+"__\n" const title = (panel.get("opendiscord:describe-options-custom-title").value.length < 1) ? "__"+autotitle+"__\n" : "__"+panel.get("opendiscord:describe-options-custom-title").value+"__\n"
if (mode == "fields") return options.map((opt) => { if (mode == "fields") return options.map((opt) => {
@@ -87,10 +88,8 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): {
let description = opt.exists("opendiscord:description") ? opt.get("opendiscord:description").value : "`<no-description>`" let description = opt.exists("opendiscord:description") ? opt.get("opendiscord:description").value : "`<no-description>`"
if (layout == "normal" || layout == "detailed"){ if (layout == "normal" || layout == "detailed"){
//TODO TRANSLATION!!! if (opt.exists("opendiscord:cooldown-enabled") && opt.get("opendiscord:cooldown-enabled").value) description = description + "\n"+lang.getTranslation("params.uppercase.cooldown")+": `"+opt.get("opendiscord:cooldown-minutes").value+" min`"
if (opt.exists("opendiscord:cooldown-enabled") && opt.get("opendiscord:cooldown-enabled").value) description = description + "\nCooldown: `"+opt.get("opendiscord:cooldown-minutes").value+" min`" if (opt.exists("opendiscord:limits-enabled") && opt.get("opendiscord:limits-enabled").value) description = description + "\n"+lang.getTranslation("params.uppercase.maxTickets")+": `"+opt.get("opendiscord:limits-maximum-user").value+"`"
//TODO TRANSLATION!!!
if (opt.exists("opendiscord:limits-enabled") && opt.get("opendiscord:limits-enabled").value) description = description + "\nMax Tickets: `"+opt.get("opendiscord:limits-maximum-user").value+"`"
} }
if (layout == "detailed"){ if (layout == "detailed"){
const optionAdmins = [...opt.get("opendiscord:admins").value] const optionAdmins = [...opt.get("opendiscord:admins").value]
@@ -99,9 +98,7 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): {
if (!optionAdmins.includes(admin)) optionAdmins.push(admin) if (!optionAdmins.includes(admin)) optionAdmins.push(admin)
} }
} }
if (opt.exists("opendiscord:admins")) description = description + "\n"+lang.getTranslation("params.uppercase.admins")+": "+optionAdmins.map((admin) => discord.roleMention(admin)).join(", ")
//TODO TRANSLATION!!!
if (opt.exists("opendiscord:admins")) description = description + "\nAdmins: "+optionAdmins.map((admin) => discord.roleMention(admin)).join(", ")
} }
if (description == "") description = "`<no-description>`" if (description == "") description = "`<no-description>`"
@@ -123,8 +120,7 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): {
let description = opt.exists("opendiscord:description") ? opt.get("opendiscord:description").value : "`<no-description>`" let description = opt.exists("opendiscord:description") ? opt.get("opendiscord:description").value : "`<no-description>`"
if (layout == "normal" || layout == "detailed"){ if (layout == "normal" || layout == "detailed"){
//TODO TRANSLATION!!! if (opt.exists("opendiscord:roles")) description = description + "\n"+lang.getTranslation("params.uppercase.roles")+": "+opt.get("opendiscord:roles").value.map((admin) => discord.roleMention(admin)).join(", ")
if (opt.exists("opendiscord:roles")) description = description + "\nRoles: "+opt.get("opendiscord:roles").value.map((admin) => discord.roleMention(admin)).join(", ")
} }
if (description == "") description = "`<no-description>`" if (description == "") description = "`<no-description>`"
@@ -146,10 +142,8 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): {
let description = opt.exists("opendiscord:description") ? opt.get("opendiscord:description").value : "`<no-description>`" let description = opt.exists("opendiscord:description") ? opt.get("opendiscord:description").value : "`<no-description>`"
if (layout == "normal" || layout == "detailed"){ if (layout == "normal" || layout == "detailed"){
//TODO TRANSLATION!!! if (opt.exists("opendiscord:cooldown-enabled") && opt.get("opendiscord:cooldown-enabled").value) description = description + "\n"+lang.getTranslation("params.uppercase.cooldown")+": `"+opt.get("opendiscord:cooldown-minutes").value+" min`"
if (opt.exists("opendiscord:cooldown-enabled") && opt.get("opendiscord:cooldown-enabled").value) description = description + "\nCooldown: `"+opt.get("opendiscord:cooldown-minutes").value+" min`" if (opt.exists("opendiscord:limits-enabled") && opt.get("opendiscord:limits-enabled").value) description = description + "\n"+lang.getTranslation("params.uppercase.maxTickets")+": `"+opt.get("opendiscord:limits-maximum-user").value+"`"
//TODO TRANSLATION!!!
if (opt.exists("opendiscord:limits-enabled") && opt.get("opendiscord:limits-enabled").value) description = description + "\nMax Tickets: `"+opt.get("opendiscord:limits-maximum-user").value+"`"
} }
if (layout == "detailed"){ if (layout == "detailed"){
const optionAdmins = [...opt.get("opendiscord:admins").value] const optionAdmins = [...opt.get("opendiscord:admins").value]
@@ -158,9 +152,7 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): {
if (!optionAdmins.includes(admin)) optionAdmins.push(admin) if (!optionAdmins.includes(admin)) optionAdmins.push(admin)
} }
} }
if (opt.exists("opendiscord:admins")) description = description + "\n"+lang.getTranslation("params.uppercase.admins")+": "+optionAdmins.map((admin) => discord.roleMention(admin)).join(", ")
//TODO TRANSLATION!!!
if (opt.exists("opendiscord:admins")) description = description + "\nAdmins: "+optionAdmins.map((admin) => discord.roleMention(admin)).join(", ")
} }
if (layout == "simple") return "**"+utilities.emojiTitle(emoji,name)+":** "+description if (layout == "simple") return "**"+utilities.emojiTitle(emoji,name)+":** "+description
@@ -182,8 +174,7 @@ export function describePanelOptions(mode:"fields"|"text", panel:api.ODPanel): {
let description = opt.exists("opendiscord:description") ? opt.get("opendiscord:description").value : "`<no-description>`" let description = opt.exists("opendiscord:description") ? opt.get("opendiscord:description").value : "`<no-description>`"
if (layout == "normal" || layout == "detailed"){ if (layout == "normal" || layout == "detailed"){
//TODO TRANSLATION!!! if (opt.exists("opendiscord:roles")) description = description + "\n"+lang.getTranslation("params.uppercase.roles")+": "+opt.get("opendiscord:roles").value.map((admin) => discord.roleMention(admin)).join(", ")
if (opt.exists("opendiscord:roles")) description = description + "\nRoles: "+opt.get("opendiscord:roles").value.map((admin) => discord.roleMention(admin)).join(", ")
} }
if (layout == "simple") return "**"+utilities.emojiTitle(emoji,name)+":** "+description if (layout == "simple") return "**"+utilities.emojiTitle(emoji,name)+":** "+description
+9 -7
View File
@@ -1,11 +1,13 @@
import {opendiscord, api, utilities} from "../../index" import {opendiscord, api, utilities} from "../../index"
const lang = opendiscord.languages
export const loadAllPriorityLevels = async () => { export const loadAllPriorityLevels = async () => {
opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:urgent",5,"urgent","Urgent","🔴","🔴")) //TODO TRANSLATION!!! opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:urgent",5,"urgent",lang.getTranslation("priorities.urgent"),"🔴","🔴"))
opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:very-high",4,"very-high","Very High","🟠","🟠")) //TODO TRANSLATION!!! opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:very-high",4,"very-high",lang.getTranslation("priorities.veryHigh"),"🟠","🟠"))
opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:high",3,"high","High","🟡","🟡")) //TODO TRANSLATION!!! opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:high",3,"high",lang.getTranslation("priorities.high"),"🟡","🟡"))
opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:normal",2,"normal","Normal","🟢","🟢")) //TODO TRANSLATION!!! opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:normal",2,"normal",lang.getTranslation("priorities.normal"),"🟢","🟢"))
opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:low",1,"low","Low","🔵","🔵")) //TODO TRANSLATION!!! opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:low",1,"low",lang.getTranslation("priorities.low"),"🔵","🔵"))
opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:very-low",0,"very-low","Very Low","⚪","⚪")) //TODO TRANSLATION!!! opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:very-low",0,"very-low",lang.getTranslation("priorities.veryLow"),"⚪","⚪"))
opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:none",-1,"none","None",null,null)) //TODO TRANSLATION!!! opendiscord.priorities.add(new api.ODPriorityLevel("opendiscord:none",-1,"none",lang.getTranslation("priorities.none"),null,null))
} }
+29 -40
View File
@@ -7,6 +7,7 @@ const transcriptConfig = opendiscord.configs.get("opendiscord:transcripts")
const textConfig = transcriptConfig.data.textTranscriptStyle const textConfig = transcriptConfig.data.textTranscriptStyle
const htmlVersion = Buffer.from("eW91LXNob3VsZG50LWJlLWxvb2tpbmctYXQtdGhpcy0tLWZvci1tb3JlLWluZm8tY29tbWEtc2VuZC1hLW1lc3NhZ2UtdG8tZGpqMTIzZGo=","base64").toString("utf8") const htmlVersion = Buffer.from("eW91LXNob3VsZG50LWJlLWxvb2tpbmctYXQtdGhpcy0tLWZvci1tb3JlLWluZm8tY29tbWEtc2VuZC1hLW1lc3NhZ2UtdG8tZGpqMTIzZGo=","base64").toString("utf8")
const htmlDomain = atob("dC5kai1kai5iZQ==") const htmlDomain = atob("dC5kai1kai5iZQ==")
const lang = opendiscord.languages
export const replaceHtmlTranscriptMentions = async (text:string) => { export const replaceHtmlTranscriptMentions = async (text:string) => {
const mainServer = opendiscord.client.mainServer const mainServer = opendiscord.client.mainServer
@@ -65,8 +66,7 @@ export const loadAllTranscriptCompilers = async () => {
const messages = await collector.convertMessagesToTranscriptData(rawMessages) const messages = await collector.convertMessagesToTranscriptData(rawMessages)
const finalMessages: string[] = [] const finalMessages: string[] = []
//TODO TRANSLATION!!! finalMessages.push("=============== "+lang.getTranslation("transcripts.text.messagesTitle")+" ===============")
finalMessages.push("=============== MESSAGES ===============")
messages.filter((msg) => textConfig.includeBotMessages || !msg.author.tag).forEach((msg) => { messages.filter((msg) => textConfig.includeBotMessages || !msg.author.tag).forEach((msg) => {
const timestamp = utilities.dateString(new Date(msg.timestamp)) const timestamp = utilities.dateString(new Date(msg.timestamp))
@@ -77,23 +77,19 @@ export const loadAllTranscriptCompilers = async () => {
if (textConfig.layout == "simple"){ if (textConfig.layout == "simple"){
//SIMPLE LAYOUT //SIMPLE LAYOUT
const header = "["+timestamp+" | "+msg.author.displayname+authorId+"]"+edited+msgId const header = "["+timestamp+" | "+msg.author.displayname+authorId+"]"+edited+msgId
//TODO TRANSLATION!!! const embeds = (textConfig.includeEmbeds) ? "\n"+lang.getTranslation("params.uppercase.embeds")+": "+msg.embeds.length : ""
const embeds = (textConfig.includeEmbeds) ? "\nEmbeds: "+msg.embeds.length : "" const files = (textConfig.includeFiles) ? "\n"+lang.getTranslation("params.uppercase.files")+": "+msg.files.length : ""
const files = (textConfig.includeFiles) ? "\nFiles: "+msg.files.length : "" const content = (msg.content) ? msg.content : (lang.getTranslation("transcripts.text.emptyContent")+embeds+files)
//TODO TRANSLATION!!!
const content = (msg.content) ? msg.content : ("<content is empty>"+embeds+files)
finalMessages.push(header+"\n "+content.split("\n").join("\n ")) finalMessages.push(header+"\n "+content.split("\n").join("\n "))
}else if (textConfig.layout == "normal"){ }else if (textConfig.layout == "normal"){
//NORMAL LAYOUT //NORMAL LAYOUT
const header = "["+timestamp+" | "+msg.author.displayname+authorId+"]"+edited+msgId const header = "["+timestamp+" | "+msg.author.displayname+authorId+"]"+edited+msgId
const embeds = (textConfig.includeEmbeds && msg.embeds.length > 0) ? "\n"+msg.embeds.map((embed) => { const embeds = (textConfig.includeEmbeds && msg.embeds.length > 0) ? "\n"+msg.embeds.map((embed) => {
//TODO TRANSLATION!!! return "==== ("+lang.getTranslation("transcripts.text.embedTitle")+") "+(embed.title ?? lang.getTranslation("transcripts.text.noTitle"))+" ====\n"+(embed.description ?? lang.getTranslation("transcripts.text.noDesc"))
return "==== (EMBED) "+(embed.title ?? "<no-title>")+" ====\n"+(embed.description ?? "<no-description>")
}) : "" }) : ""
const files = (textConfig.includeFiles && msg.files.length > 0) ? "\n"+msg.files.map((file) => { const files = (textConfig.includeFiles && msg.files.length > 0) ? "\n"+msg.files.map((file) => {
//TODO TRANSLATION!!! return "==== ("+lang.getTranslation("transcripts.text.fileTitle")+") "+(file.name)+" ====\n"+lang.getTranslation("params.uppercase.size")+": "+(file.size+" "+file.unit)+"\nUrl: "+file.url
return "==== (FILE) "+(file.name)+" ====\nSize: "+(file.size+" "+file.unit)+"\nUrl: "+file.url
}) : "" }) : ""
const content = (msg.content) ? msg.content : "" const content = (msg.content) ? msg.content : ""
finalMessages.push(header+"\n "+(content+embeds+files).split("\n").join("\n ")) finalMessages.push(header+"\n "+(content+embeds+files).split("\n").join("\n "))
@@ -102,15 +98,12 @@ export const loadAllTranscriptCompilers = async () => {
//ADVANCED LAYOUT //ADVANCED LAYOUT
const header = "["+timestamp+" | "+msg.author.displayname+authorId+"]"+edited+msgId const header = "["+timestamp+" | "+msg.author.displayname+authorId+"]"+edited+msgId
const embeds = (textConfig.includeEmbeds && msg.embeds.length > 0) ? "\n"+msg.embeds.map((embed) => { const embeds = (textConfig.includeEmbeds && msg.embeds.length > 0) ? "\n"+msg.embeds.map((embed) => {
//TODO TRANSLATION!!! return "\n==== ("+lang.getTranslation("transcripts.text.embedTitle")+") "+(embed.title ?? lang.getTranslation("transcripts.text.noTitle"))+" ====\n"+(embed.description ?? lang.getTranslation("transcripts.text.noDesc"))+(embed.fields.length > 0 ? "\n\n== ("+lang.getTranslation("transcripts.text.fieldsTitle")+") ==\n"+embed.fields.map((field) => field.name+": "+field.value).join("\n") : "")
return "\n==== (EMBED) "+(embed.title ?? "<no-title>")+" ====\n"+(embed.description ?? "<no-description>")+(embed.fields.length > 0 ? "\n\n== (FIELDS) ==\n"+embed.fields.map((field) => field.name+": "+field.value).join("\n") : "")
}) : "" }) : ""
const files = (textConfig.includeFiles && msg.files.length > 0) ? "\n"+msg.files.map((file) => { const files = (textConfig.includeFiles && msg.files.length > 0) ? "\n"+msg.files.map((file) => {
//TODO TRANSLATION!!! return "\n==== ("+lang.getTranslation("transcripts.text.fileTitle")+") "+(file.name)+" ====\n"+lang.getTranslation("params.uppercase.size")+": "+(file.size+" "+file.unit)+"\nUrl: "+file.url+"\nAlt: "+(file.alt ?? "/")
return "\n==== (FILE) "+(file.name)+" ====\nSize: "+(file.size+" "+file.unit)+"\nUrl: "+file.url+"\nAlt: "+(file.alt ?? "/")
}) : "" }) : ""
//TODO TRANSLATION!!! const reactions = (msg.reactions.filter((r) => !r.custom).length > 0) ? "\n==== ("+lang.getTranslation("transcripts.text.reactionsTitle")+") ====\n"+msg.reactions.filter((r) => !r.custom).map((r) => r.amount+" "+r.emoji).join(" - ") : ""
const reactions = (msg.reactions.filter((r) => !r.custom).length > 0) ? "\n==== (REACTIONS) ====\n"+msg.reactions.filter((r) => !r.custom).map((r) => r.amount+" "+r.emoji).join(" - ") : ""
const content = (msg.content) ? msg.content : "" const content = (msg.content) ? msg.content : ""
finalMessages.push(header+"\n "+(content+embeds+files+reactions).split("\n").join("\n ")) finalMessages.push(header+"\n "+(content+embeds+files+reactions).split("\n").join("\n "))
} }
@@ -128,44 +121,40 @@ export const loadAllTranscriptCompilers = async () => {
const pinner = await opendiscord.tickets.getTicketUser(ticket,"pinner") const pinner = await opendiscord.tickets.getTicketUser(ticket,"pinner")
if (textConfig.includeStats){ if (textConfig.includeStats){
//TODO TRANSLATION!!! finalStats.push("=============== "+lang.getTranslation("transcripts.text.statsTitle")+" ===============")
finalStats.push("=============== STATS ===============")
if (textConfig.layout == "simple"){ if (textConfig.layout == "simple"){
//SIMPLE LAYOUT //SIMPLE LAYOUT
//TODO TRANSLATION!!! if (creationDate) finalStats.push(lang.getTranslation("stats.properties.createdOn")+": "+utilities.dateString(new Date(creationDate)))
if (creationDate) finalStats.push("Created On: "+utilities.dateString(new Date(creationDate))) if (creator) finalStats.push(lang.getTranslation("stats.properties.createdBy")+": "+creator.displayName)
if (creator) finalStats.push("Created By: "+creator.displayName)
finalStats.push("\n") finalStats.push("\n")
}else if (textConfig.layout == "normal"){ }else if (textConfig.layout == "normal"){
//NORMAL LAYOUT //NORMAL LAYOUT
//TODO TRANSLATION!!! if (creationDate) finalStats.push(lang.getTranslation("stats.properties.createdOn")+": "+utilities.dateString(new Date(creationDate)))
if (creationDate) finalStats.push("Created On: "+utilities.dateString(new Date(creationDate))) if (creator) finalStats.push(lang.getTranslation("stats.properties.createdBy")+": "+creator.displayName)
if (creator) finalStats.push("Created By: "+creator.displayName)
if (closer || claimer || pinner) finalStats.push("") if (closer || claimer || pinner) finalStats.push("")
if (closer) finalStats.push("Closed By: "+closer.displayName) if (closer) finalStats.push(lang.getTranslation("stats.properties.closedBy")+": "+closer.displayName)
if (claimer) finalStats.push("Claimed By: "+claimer.displayName) if (claimer) finalStats.push(lang.getTranslation("stats.properties.claimedBy")+": "+claimer.displayName)
if (pinner) finalStats.push("Pinned By: "+pinner.displayName) if (pinner) finalStats.push(lang.getTranslation("stats.properties.pinnedBy")+": "+pinner.displayName)
finalStats.push("Deleted By: "+user.displayName) finalStats.push(lang.getTranslation("stats.properties.deletedBy")+": "+user.displayName)
finalStats.push("\n") finalStats.push("\n")
}else if (textConfig.layout == "detailed"){ }else if (textConfig.layout == "detailed"){
//ADVANCED LAYOUT //ADVANCED LAYOUT
//TODO TRANSLATION!!! if (creationDate) finalStats.push(lang.getTranslation("stats.properties.createdOn")+": "+utilities.dateString(new Date(creationDate)))
if (creationDate) finalStats.push("Created On: "+utilities.dateString(new Date(creationDate))) if (creator) finalStats.push(lang.getTranslation("stats.properties.createdBy")+": "+creator.displayName)
if (creator) finalStats.push("Created By: "+creator.displayName)
if (closer || closeDate) finalStats.push("") if (closer || closeDate) finalStats.push("")
if (closeDate) finalStats.push("Closed On: "+utilities.dateString(new Date(closeDate))) if (closeDate) finalStats.push(lang.getTranslation("stats.properties.closedOn")+": "+utilities.dateString(new Date(closeDate)))
if (closer) finalStats.push("Closed By: "+closer.displayName) if (closer) finalStats.push(lang.getTranslation("stats.properties.closedBy")+": "+closer.displayName)
if (claimer || claimDate) finalStats.push("") if (claimer || claimDate) finalStats.push("")
if (claimDate) finalStats.push("Claimed On: "+utilities.dateString(new Date(claimDate))) if (claimDate) finalStats.push(lang.getTranslation("stats.properties.claimedOn")+": "+utilities.dateString(new Date(claimDate)))
if (claimer) finalStats.push("Claimed By: "+claimer.displayName) if (claimer) finalStats.push(lang.getTranslation("stats.properties.claimedBy")+": "+claimer.displayName)
if (pinner || pinDate) finalStats.push("") if (pinner || pinDate) finalStats.push("")
if (pinDate) finalStats.push("Pinned On: "+utilities.dateString(new Date(pinDate))) if (pinDate) finalStats.push(lang.getTranslation("stats.properties.pinnedOn")+": "+utilities.dateString(new Date(pinDate)))
if (pinner) finalStats.push("Pinned By: "+pinner.displayName) if (pinner) finalStats.push(lang.getTranslation("stats.properties.pinnedBy")+": "+pinner.displayName)
if (closer || claimer || pinner) finalStats.push("") if (closer || claimer || pinner) finalStats.push("")
finalStats.push("Deleted On: "+utilities.dateString(new Date())) finalStats.push(lang.getTranslation("stats.properties.deletedOn")+": "+utilities.dateString(new Date()))
finalStats.push("Deleted By: "+user.displayName) finalStats.push(lang.getTranslation("stats.properties.deletedBy")+": "+user.displayName)
finalStats.push("\n") finalStats.push("\n")
} }
} }