Skip to content

Commit

Permalink
chore(reports): adapt discord report link (#1199)
Browse files Browse the repository at this point in the history
* chore(reports): adapt discord report link

* link to helpdesk article instead of support form (no longer used for reports)

resolves #1191

* chore: remove unused discord locales constant
  • Loading branch information
almostSouji committed Oct 22, 2023
1 parent 1fd8230 commit 583e34d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
7 changes: 1 addition & 6 deletions apps/yuudachi/src/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,4 @@ export const AUTOCOMPLETE_REASON_FOCUSED_FIELD_NAME = "reason";
export const AUTOCOMPLETE_CASE_FOCUSED_FIELD_NAMES = ["case_reference", "reference_case", "case", "last_case"];
export const AUTOCOMPLETE_REPORT_FOCUSED_FIELD_NAMES = ["report_reference", "reference_report", "report"];

export const TRUST_AND_SAFETY_URL_BASE = "https://support.discord.com/hc/en-us/requests/new";

export const DiscordLocales: { [key: string]: string } = {
"es-ES": "es",
"zh-CN": "zh-tw",
};
export const DISCORD_HOWTOREPORT = "https://discord.com/safety/360044103651-reporting-abusive-behavior-to-discord";
6 changes: 3 additions & 3 deletions apps/yuudachi/src/commands/moderation/sub/report/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import i18next from "i18next";
import type { Redis } from "ioredis";
import { nanoid } from "nanoid";
import {
DISCORD_HOWTOREPORT,
REPORT_DUPLICATE_EXPIRE_SECONDS,
REPORT_DUPLICATE_PRE_EXPIRE_SECONDS,
REPORT_MESSAGE_CONTEXT_LIMIT,
Expand All @@ -17,7 +18,6 @@ import { type Report, createReport, ReportType } from "../../../../functions/rep
import { getPendingReportByTarget } from "../../../../functions/reports/getReport.js";
import type { ReportCommand } from "../../../../interactions/index.js";
import { createMessageLinkButton } from "../../../../util/createMessageLinkButton.js";
import { localeTrustAndSafety } from "../../../../util/localizeTrustAndSafety.js";

type MessageReportArgs = Omit<ArgsParam<typeof ReportCommand>["message"], "message_link"> & {
message: Message;
Expand Down Expand Up @@ -50,7 +50,7 @@ export async function message(
});
const trustAndSafetyButton = createButton({
label: i18next.t("command.mod.report.common.buttons.discord_report", { lng: locale }),
url: localeTrustAndSafety(locale),
url: DISCORD_HOWTOREPORT,
style: ButtonStyle.Link,
});

Expand All @@ -64,7 +64,7 @@ export async function message(
i18next.t("command.mod.report.common.warnings", {
trust_and_safety: hyperlink(
i18next.t("command.mod.report.common.trust_and_safety_sub", { lng: locale }),
localeTrustAndSafety(locale),
DISCORD_HOWTOREPORT,
),
lng: locale,
}),
Expand Down
6 changes: 3 additions & 3 deletions apps/yuudachi/src/commands/moderation/sub/report/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import {
REPORT_REASON_MAX_LENGTH,
REPORT_DUPLICATE_EXPIRE_SECONDS,
REPORT_DUPLICATE_PRE_EXPIRE_SECONDS,
DISCORD_HOWTOREPORT,
} from "../../../../Constants.js";
import { forwardReport } from "../../../../functions/logging/forwardReport.js";
import { upsertReportLog } from "../../../../functions/logging/upsertReportLog.js";
import { type Report, createReport, ReportType } from "../../../../functions/reports/createReport.js";
import { updateReport } from "../../../../functions/reports/updateReport.js";
import type { ReportCommand } from "../../../../interactions/index.js";
import { resolveGuildCommand, chatInputApplicationCommandMention } from "../../../../util/commandUtils.js";
import { localeTrustAndSafety } from "../../../../util/localizeTrustAndSafety.js";

type MemberAssuredReportArgs = ArgsParam<typeof ReportCommand>["user"] & { user: { member: GuildMember } };

Expand Down Expand Up @@ -68,7 +68,7 @@ export async function user(
});
const trustAndSafetyButton = createButton({
label: i18next.t("command.mod.report.common.buttons.discord_report", { lng: locale }),
url: localeTrustAndSafety(locale),
url: DISCORD_HOWTOREPORT,
style: ButtonStyle.Link,
});

Expand Down Expand Up @@ -102,7 +102,7 @@ export async function user(
i18next.t("command.mod.report.common.warnings", {
trust_and_safety: hyperlink(
i18next.t("command.mod.report.common.trust_and_safety_sub", { lng: locale }),
localeTrustAndSafety(locale),
DISCORD_HOWTOREPORT,
),
lng: locale,
}),
Expand Down
5 changes: 0 additions & 5 deletions apps/yuudachi/src/util/localizeTrustAndSafety.ts

This file was deleted.

0 comments on commit 583e34d

Please sign in to comment.