Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/config.example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default defineConfig("0.0.1", {
ticketClaim: true,
ticketUnclaim: true,
ticketClose: true,
ticketReopen: true,
ticketDelete: true,
userAdded: true,
userRemoved: true,
Expand Down
16 changes: 16 additions & 0 deletions i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ const en: BaseTranslation = {
close: {
description: "Close the current ticket"
},
reopen: {
description: "Reopen the current ticket"
},
cleardm: {
description: "Clear the bot's ticket history from your DMs",
starting: "Clearing your ticket DM history...",
Expand Down Expand Up @@ -118,6 +121,7 @@ const en: BaseTranslation = {
},
actions: {
close_ticket: "Close Ticket",
reopen_ticket: "Reopen Ticket",
claim_ticket: "Claim Ticket",
unclaim_ticket: "Unclaim Ticket",
delete_ticket: "Delete Ticket"
Expand Down Expand Up @@ -148,6 +152,12 @@ const en: BaseTranslation = {
only_closed_delete: "Only closed tickets can be deleted from this button.",
only_staff_delete: "Only staff can delete this ticket."
},
reopen: {
not_ticket: "This channel is not a ticket.",
only_closed: "Only closed tickets can be reopened.",
only_staff: "Only staff can reopen this ticket.",
success: "Ticket reopened. Participant access and ticket actions have been restored."
},
transcript: {
collecting_messages: "Collecting ticket messages...",
creating: "Creating transcript...",
Expand Down Expand Up @@ -267,6 +277,12 @@ const en: BaseTranslation = {
details:
"**Ticket**: #{ticketId:string} - {ticketTypeName:string}\n**Opened By**: {createdByMention:string}\n**Claim Status**: {claimStatus:string}\n**Open Age**: {ticketAge:string}\n**Reason**: {reason:string}\n**Transcript**: {transcriptStatus:string}"
},
ticket_reopened: {
title: "## Ticket Reopened",
action: "{actorMention:string} reopened {ticketChannelMention:string}.",
details:
"**Ticket**: #{ticketId:string} - {ticketTypeName:string}\n**Opened By**: {createdByMention:string}\n**Claim Status**: {claimStatus:string}\n**Ticket Age**: {ticketAge:string}"
},
ticket_deleted: {
title: "## Ticket Deleted",
action: "{actorMention:string} deleted {ticketChannelMention:string}.",
Expand Down
16 changes: 16 additions & 0 deletions i18n/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ const fr: Translation = {
close: {
description: "Fermer le ticket actuel"
},
reopen: {
description: "Rouvrir le ticket actuel"
},
cleardm: {
description: "Effacer l'historique des tickets du bot dans vos MP",
starting: "Suppression de votre historique de tickets en MP...",
Expand Down Expand Up @@ -118,6 +121,7 @@ const fr: Translation = {
},
actions: {
close_ticket: "Fermer le ticket",
reopen_ticket: "Rouvrir le ticket",
claim_ticket: "Prendre en charge",
unclaim_ticket: "Libérer le ticket",
delete_ticket: "Supprimer le ticket"
Expand Down Expand Up @@ -148,6 +152,12 @@ const fr: Translation = {
only_closed_delete: "Seuls les tickets fermés peuvent être supprimés depuis ce bouton.",
only_staff_delete: "Seul le staff peut supprimer ce ticket."
},
reopen: {
not_ticket: "Ce salon n'est pas un ticket.",
only_closed: "Seuls les tickets fermés peuvent être rouverts.",
only_staff: "Seul le staff peut rouvrir ce ticket.",
success: "Ticket rouvert. Les accès des participants et les actions du ticket ont été restaurés."
},
transcript: {
collecting_messages: "Collecte des messages du ticket...",
creating: "Création de la transcription...",
Expand Down Expand Up @@ -265,6 +275,12 @@ const fr: Translation = {
details:
"**Ticket** : #{ticketId} - {ticketTypeName}\n**Ouvert par** : {createdByMention}\n**Statut de prise en charge** : {claimStatus}\n**Ancienneté** : {ticketAge}\n**Raison** : {reason}\n**Transcription** : {transcriptStatus}"
},
ticket_reopened: {
title: "## Ticket rouvert",
action: "{actorMention} a rouvert {ticketChannelMention}.",
details:
"**Ticket** : #{ticketId} - {ticketTypeName}\n**Ouvert par** : {createdByMention}\n**Statut de prise en charge** : {claimStatus}\n**Ancienneté** : {ticketAge}"
},
ticket_deleted: {
title: "## Ticket supprimé",
action: "{actorMention} a supprimé {ticketChannelMention}.",
Expand Down
105 changes: 104 additions & 1 deletion i18n/i18n-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { BaseTranslation as BaseTranslationType, LocalizedString, RequiredP
export type BaseTranslation = BaseTranslationType;
export type BaseLocale = "en";

export type Locales = "en" | "fr";
export type Locales = "fr" | "en";

export type Translation = RootTranslation;

Expand Down Expand Up @@ -118,6 +118,12 @@ type RootTranslation = {
*/
description: string;
};
reopen: {
/**
* R​e​o​p​e​n​ ​t​h​e​ ​c​u​r​r​e​n​t​ ​t​i​c​k​e​t
*/
description: string;
};
cleardm: {
/**
* C​l​e​a​r​ ​t​h​e​ ​b​o​t​'​s​ ​t​i​c​k​e​t​ ​h​i​s​t​o​r​y​ ​f​r​o​m​ ​y​o​u​r​ ​D​M​s
Expand Down Expand Up @@ -340,6 +346,10 @@ type RootTranslation = {
* C​l​o​s​e​ ​T​i​c​k​e​t
*/
close_ticket: string;
/**
* R​e​o​p​e​n​ ​T​i​c​k​e​t
*/
reopen_ticket: string;
/**
* C​l​a​i​m​ ​T​i​c​k​e​t
*/
Expand Down Expand Up @@ -439,6 +449,24 @@ type RootTranslation = {
*/
only_staff_delete: string;
};
reopen: {
/**
* T​h​i​s​ ​c​h​a​n​n​e​l​ ​i​s​ ​n​o​t​ ​a​ ​t​i​c​k​e​t​.
*/
not_ticket: string;
/**
* O​n​l​y​ ​c​l​o​s​e​d​ ​t​i​c​k​e​t​s​ ​c​a​n​ ​b​e​ ​r​e​o​p​e​n​e​d​.
*/
only_closed: string;
/**
* O​n​l​y​ ​s​t​a​f​f​ ​c​a​n​ ​r​e​o​p​e​n​ ​t​h​i​s​ ​t​i​c​k​e​t​.
*/
only_staff: string;
/**
* T​i​c​k​e​t​ ​r​e​o​p​e​n​e​d​.​ ​P​a​r​t​i​c​i​p​a​n​t​ ​a​c​c​e​s​s​ ​a​n​d​ ​t​i​c​k​e​t​ ​a​c​t​i​o​n​s​ ​h​a​v​e​ ​b​e​e​n​ ​r​e​s​t​o​r​e​d​.
*/
success: string;
};
transcript: {
/**
* C​o​l​l​e​c​t​i​n​g​ ​t​i​c​k​e​t​ ​m​e​s​s​a​g​e​s​.​.​.
Expand Down Expand Up @@ -872,6 +900,30 @@ type RootTranslation = {
"claimStatus" | "createdByMention" | "reason" | "ticketAge" | "ticketId" | "ticketTypeName" | "transcriptStatus"
>;
};
ticket_reopened: {
/**
* #​#​ ​T​i​c​k​e​t​ ​R​e​o​p​e​n​e​d
*/
title: string;
/**
* {​a​c​t​o​r​M​e​n​t​i​o​n​}​ ​r​e​o​p​e​n​e​d​ ​{​t​i​c​k​e​t​C​h​a​n​n​e​l​M​e​n​t​i​o​n​}​.
* @param {string} actorMention
* @param {string} ticketChannelMention
*/
action: RequiredParams<"actorMention" | "ticketChannelMention">;
/**
* *​*​T​i​c​k​e​t​*​*​:​ ​#​{​t​i​c​k​e​t​I​d​}​ ​-​ ​{​t​i​c​k​e​t​T​y​p​e​N​a​m​e​}​
​*​*​O​p​e​n​e​d​ ​B​y​*​*​:​ ​{​c​r​e​a​t​e​d​B​y​M​e​n​t​i​o​n​}​
​*​*​C​l​a​i​m​ ​S​t​a​t​u​s​*​*​:​ ​{​c​l​a​i​m​S​t​a​t​u​s​}​
​*​*​T​i​c​k​e​t​ ​A​g​e​*​*​:​ ​{​t​i​c​k​e​t​A​g​e​}
* @param {string} claimStatus
* @param {string} createdByMention
* @param {string} ticketAge
* @param {string} ticketId
* @param {string} ticketTypeName
*/
details: RequiredParams<"claimStatus" | "createdByMention" | "ticketAge" | "ticketId" | "ticketTypeName">;
};
ticket_deleted: {
/**
* #​#​ ​T​i​c​k​e​t​ ​D​e​l​e​t​e​d
Expand Down Expand Up @@ -1074,6 +1126,12 @@ export type TranslationFunctions = {
*/
description: () => LocalizedString;
};
reopen: {
/**
* Reopen the current ticket
*/
description: () => LocalizedString;
};
cleardm: {
/**
* Clear the bot's ticket history from your DMs
Expand Down Expand Up @@ -1285,6 +1343,10 @@ export type TranslationFunctions = {
* Close Ticket
*/
close_ticket: () => LocalizedString;
/**
* Reopen Ticket
*/
reopen_ticket: () => LocalizedString;
/**
* Claim Ticket
*/
Expand Down Expand Up @@ -1384,6 +1446,24 @@ export type TranslationFunctions = {
*/
only_staff_delete: () => LocalizedString;
};
reopen: {
/**
* This channel is not a ticket.
*/
not_ticket: () => LocalizedString;
/**
* Only closed tickets can be reopened.
*/
only_closed: () => LocalizedString;
/**
* Only staff can reopen this ticket.
*/
only_staff: () => LocalizedString;
/**
* Ticket reopened. Participant access and ticket actions have been restored.
*/
success: () => LocalizedString;
};
transcript: {
/**
* Collecting ticket messages...
Expand Down Expand Up @@ -1763,6 +1843,29 @@ export type TranslationFunctions = {
transcriptStatus: string;
}) => LocalizedString;
};
ticket_reopened: {
/**
* ## Ticket Reopened
*/
title: () => LocalizedString;
/**
* {actorMention} reopened {ticketChannelMention}.
*/
action: (arg: { actorMention: string; ticketChannelMention: string }) => LocalizedString;
/**
* **Ticket**: #{ticketId} - {ticketTypeName}
**Opened By**: {createdByMention}
**Claim Status**: {claimStatus}
**Ticket Age**: {ticketAge}
*/
details: (arg: {
claimStatus: string;
createdByMention: string;
ticketAge: string;
ticketId: string;
ticketTypeName: string;
}) => LocalizedString;
};
ticket_deleted: {
/**
* ## Ticket Deleted
Expand Down
63 changes: 63 additions & 0 deletions messages/logs/ticket-reopened.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
Ticket-Bot is licensed under the GNU Affero General Public License,
version 3 only ("AGPL-3.0-only"). See LICENSE.md for the full license text.

Additional Term under GNU AGPL v3, Section 7(b):

You are required to preserve and display, in a location clearly visible
to end users interacting with the bot (such as bot embeds, the bot's
"Bio" Discord profile, status, or equivalent), a notice that the
software is powered by Ticket-Bot, including a link to the original
project repository or to its website.

This notice must not be removed, obscured, or replaced.
*/

import { ComponentType } from "@discordjs/core";
import type { LoadedMessageTemplate, MessageTemplateContext } from "@/features/tickets/types";

const ticketReopenedLogMessage = ({ LL }: MessageTemplateContext): LoadedMessageTemplate => ({
components: [
{
type: ComponentType.Container,
accent_color: 5763719,
components: [
{ type: ComponentType.TextDisplay, content: LL.logs.templates.ticket_reopened.title() },
{
type: ComponentType.TextDisplay,
content: LL.logs.templates.ticket_reopened.action({
actorMention: "{actorMention}",
ticketChannelMention: "{ticketChannelMention}"
})
},
{
type: ComponentType.TextDisplay,
content: LL.logs.templates.ticket_reopened.details({
ticketId: "{ticketId}",
ticketTypeName: "{ticketTypeName}",
createdByMention: "{createdByMention}",
claimStatus: "{claimStatus}",
ticketAge: "{ticketAge}"
})
}
]
}
]
});

export default ticketReopenedLogMessage;

/*
Ticket-Bot is licensed under the GNU Affero General Public License,
version 3 only ("AGPL-3.0-only"). See LICENSE.md for the full license text.

Additional Term under GNU AGPL v3, Section 7(b):

You are required to preserve and display, in a location clearly visible
to end users interacting with the bot (such as bot embeds, the bot's
"Bio" Discord profile, status, or equivalent), a notice that the
software is powered by Ticket-Bot, including a link to the original
project repository or to its website.

This notice must not be removed, obscured, or replaced.
*/
6 changes: 6 additions & 0 deletions messages/tickets/ticket-closed-billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ const ticketClosedBillingMessage = ({ LL }: MessageTemplateContext): LoadedMessa
{
type: ComponentType.ActionRow,
components: [
{
type: ComponentType.Button,
custom_id: "{reopenButtonCustomId}",
label: LL.tickets.actions.reopen_ticket(),
style: 3
},
{
type: ComponentType.Button,
custom_id: "{deleteButtonCustomId}",
Expand Down
6 changes: 6 additions & 0 deletions messages/tickets/ticket-closed-general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ const ticketClosedGeneralMessage = ({ LL }: MessageTemplateContext): LoadedMessa
{
type: ComponentType.ActionRow,
components: [
{
type: ComponentType.Button,
custom_id: "{reopenButtonCustomId}",
label: LL.tickets.actions.reopen_ticket(),
style: 3
},
{
type: ComponentType.Button,
custom_id: "{deleteButtonCustomId}",
Expand Down
6 changes: 6 additions & 0 deletions messages/tickets/ticket-closed-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ const ticketClosedReportMessage = ({ LL }: MessageTemplateContext): LoadedMessag
{
type: ComponentType.ActionRow,
components: [
{
type: ComponentType.Button,
custom_id: "{reopenButtonCustomId}",
label: LL.tickets.actions.reopen_ticket(),
style: 3
},
{
type: ComponentType.Button,
custom_id: "{deleteButtonCustomId}",
Expand Down
6 changes: 6 additions & 0 deletions messages/tickets/ticket-closed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ const ticketClosedMessage = ({ LL }: MessageTemplateContext): LoadedMessageTempl
{
type: ComponentType.ActionRow,
components: [
{
type: ComponentType.Button,
custom_id: "{reopenButtonCustomId}",
label: LL.tickets.actions.reopen_ticket(),
style: 3
},
{
type: ComponentType.Button,
custom_id: "{deleteButtonCustomId}",
Expand Down
1 change: 1 addition & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ interface ConfigV0_0_1 {
ticketClaim?: boolean;
ticketUnclaim?: boolean;
ticketClose?: boolean;
ticketReopen?: boolean;
ticketDelete?: boolean;
userAdded?: boolean;
userRemoved?: boolean;
Expand Down
Loading
Loading