|
1 | | -import { EmbedBuilder } from "discord.js"; |
2 | | - |
3 | 1 | import { COLORS } from "../config/constants"; |
| 2 | +import { |
| 3 | + ButtonBuilder, |
| 4 | + ButtonStyle, |
| 5 | + ContainerBuilder, |
| 6 | + SectionBuilder, |
| 7 | + SeparatorBuilder, |
| 8 | + SeparatorSpacingSize, |
| 9 | + TextDisplayBuilder, |
| 10 | +} from "discord.js"; |
| 11 | + |
| 12 | +type Team = { |
| 13 | + name: string; |
| 14 | + // username to message on RA |
| 15 | + username: string; |
| 16 | + reasons: string[]; |
| 17 | +}; |
| 18 | + |
| 19 | +const buildContactButton = (account: string): ButtonBuilder => { |
| 20 | + return new ButtonBuilder() |
| 21 | + .setStyle(ButtonStyle.Link) |
| 22 | + .setLabel("Message " + account) |
| 23 | + .setURL("https://retroachievements.org/messages/create?to=" + account); |
| 24 | +}; |
| 25 | + |
| 26 | +const buildTeamSection = (team: Team): SectionBuilder => { |
| 27 | + const reasons = team.reasons.map((reason: string) => "- " + reason).join("\n"); |
| 28 | + |
| 29 | + return new SectionBuilder() |
| 30 | + .setButtonAccessory(buildContactButton(team.username)) |
| 31 | + .addTextDisplayComponents( |
| 32 | + new TextDisplayBuilder().setContent("## :e_mail: " + team.name + "\n" + reasons), |
| 33 | + ); |
| 34 | +}; |
| 35 | + |
| 36 | +const separator = new SeparatorBuilder().setSpacing(SeparatorSpacingSize.Small).setDivider(true); |
4 | 37 |
|
5 | | -export const buildContactEmbed = (): EmbedBuilder => { |
6 | | - return new EmbedBuilder() |
7 | | - .setColor(COLORS.PRIMARY) |
8 | | - .setTitle("Contact Us") |
9 | | - .setDescription( |
10 | | - "If you would like to contact us, please send a site message to the appropriate team below.", |
| 38 | +export const buildContactEmbed = (): ContainerBuilder => { |
| 39 | + return new ContainerBuilder() |
| 40 | + .setAccentColor(COLORS.PRIMARY) |
| 41 | + .addTextDisplayComponents( |
| 42 | + new TextDisplayBuilder().setContent( |
| 43 | + "# Contact Us\n" + |
| 44 | + "If you would like to contact us, please send a site message to the appropriate team below.", |
| 45 | + ), |
| 46 | + ) |
| 47 | + .addSeparatorComponents(separator) |
| 48 | + .addSectionComponents( |
| 49 | + buildTeamSection({ |
| 50 | + name: "Admins and Moderators", |
| 51 | + username: "RAdmin", |
| 52 | + reasons: [ |
| 53 | + "Reporting offensive behavior.", |
| 54 | + "Reporting copyrighted material.", |
| 55 | + "Requesting to be untracked.", |
| 56 | + ], |
| 57 | + }), |
| 58 | + ) |
| 59 | + .addSeparatorComponents(separator) |
| 60 | + .addSectionComponents( |
| 61 | + buildTeamSection({ |
| 62 | + name: "Developer Compliance", |
| 63 | + username: "DevCompliance", |
| 64 | + reasons: [ |
| 65 | + "Requesting set approval or early set release.", |
| 66 | + "Reporting achievements or sets with unwelcome concepts.", |
| 67 | + "Reporting sets failing to cover basic progression.", |
| 68 | + ], |
| 69 | + }), |
| 70 | + ) |
| 71 | + .addSeparatorComponents(separator) |
| 72 | + .addSectionComponents( |
| 73 | + buildTeamSection({ |
| 74 | + name: "Quality Assurance", |
| 75 | + username: "QATeam", |
| 76 | + reasons: [ |
| 77 | + "Reporting a broken set, leaderboard, or rich presence.", |
| 78 | + "Reporting achievements with grammatical mistakes.", |
| 79 | + "Requesting a set be playtested.", |
| 80 | + "Hash compatibility questions.", |
| 81 | + "Hub organizational questions.", |
| 82 | + "Getting involved in a QA sub-team.", |
| 83 | + ], |
| 84 | + }), |
| 85 | + ) |
| 86 | + .addSeparatorComponents(separator) |
| 87 | + .addSectionComponents( |
| 88 | + buildTeamSection({ |
| 89 | + name: "Art Team", |
| 90 | + username: "RAArtTeam", |
| 91 | + reasons: [ |
| 92 | + "Icon Gauntlets and how to start one.", |
| 93 | + "Proposing art updates.", |
| 94 | + "Questions about art-related rule changes.", |
| 95 | + "Requests for help with creating a new badge or badge set.", |
| 96 | + ], |
| 97 | + }), |
| 98 | + ) |
| 99 | + .addSeparatorComponents(separator) |
| 100 | + .addSectionComponents( |
| 101 | + buildTeamSection({ |
| 102 | + name: "Writing Team", |
| 103 | + username: "WritingTeam", |
| 104 | + reasons: [ |
| 105 | + "Reporting achievements with grammatical mistakes.", |
| 106 | + "Reporting achievements with unclear or confusing descriptions.", |
| 107 | + "Requesting help from the team with proofreading achievement sets.", |
| 108 | + "Requesting help for coming up with original titles for achievements.", |
| 109 | + ], |
| 110 | + }), |
| 111 | + ) |
| 112 | + .addSeparatorComponents(separator) |
| 113 | + .addSectionComponents( |
| 114 | + buildTeamSection({ |
| 115 | + name: "RANews", |
| 116 | + username: "RANews", |
| 117 | + reasons: [ |
| 118 | + "Submitting a Play This Set, Wish This Set, or RAdvantage entry.", |
| 119 | + "Submitting a retrogaming article.", |
| 120 | + "Proposing a new article idea.", |
| 121 | + "Getting involved with RANews.", |
| 122 | + ], |
| 123 | + }), |
| 124 | + ) |
| 125 | + .addSeparatorComponents(separator) |
| 126 | + .addSectionComponents( |
| 127 | + buildTeamSection({ |
| 128 | + name: "RAEvents", |
| 129 | + username: "RAEvents", |
| 130 | + reasons: ["Submissions, questions, ideas, or reporting issues related to events."], |
| 131 | + }), |
| 132 | + ) |
| 133 | + .addSeparatorComponents(separator) |
| 134 | + .addSectionComponents( |
| 135 | + buildTeamSection({ |
| 136 | + name: "DevQuest", |
| 137 | + username: "DevQuest", |
| 138 | + reasons: ["Submissions, questions, ideas, or reporting issues related to DevQuest."], |
| 139 | + }), |
11 | 140 | ) |
12 | | - .addFields([ |
13 | | - { |
14 | | - name: ":e_mail: Admins and Moderators", |
15 | | - value: `[Send a message to RAdmin](https://retroachievements.org/createmessage.php?t=RAdmin) |
16 | | - - Reporting offensive behavior. |
17 | | - - Reporting copyrighted material. |
18 | | - - Requesting to be untracked.`, |
19 | | - }, |
20 | | - { |
21 | | - name: ":e_mail: Developer Compliance", |
22 | | - value: `[Send a message to Developer Compliance](https://retroachievements.org/createmessage.php?t=DevCompliance) |
23 | | - - Requesting set approval or early set release. |
24 | | - - Reporting achievements or sets with unwelcome concepts. |
25 | | - - Reporting sets failing to cover basic progression.`, |
26 | | - }, |
27 | | - { |
28 | | - name: ":e_mail: Quality Assurance", |
29 | | - value: `[Send a message to Quality Assurance](https://retroachievements.org/createmessage.php?t=QATeam) |
30 | | - - Reporting a broken set, leaderboard, or rich presence. |
31 | | - - Reporting achievements with grammatical mistakes. |
32 | | - - Requesting a set be playtested. |
33 | | - - Hash compatibility questions. |
34 | | - - Hub organizational questions. |
35 | | - - Getting involved in a QA sub-team.`, |
36 | | - }, |
37 | | - { |
38 | | - name: ":e_mail: RAArtTeam", |
39 | | - value: `[Send a message to RAArtTeam](https://retroachievements.org/messages/create?to=RAArtTeam) |
40 | | - - Icon Gauntlets and how to start one. |
41 | | - - Proposing art updates. |
42 | | - - Questions about art-related rule changes. |
43 | | - - Requests for help with creating a new badge or badge set.`, |
44 | | - }, |
45 | | - { |
46 | | - name: ":e_mail: WritingTeam", |
47 | | - value: `[Send a message to WritingTeam](https://retroachievements.org/messages/create?to=WritingTeam) |
48 | | - - Reporting achievements with grammatical mistakes. |
49 | | - - Reporting achievements with unclear or confusing descriptions. |
50 | | - - Requesting help from the team with proofreading achievement sets. |
51 | | - - Requesting help for coming up with original titles for achievements.`, |
52 | | - }, |
53 | | - { |
54 | | - name: ":e_mail: RANews", |
55 | | - value: `[Send a message to RANews](https://retroachievements.org/createmessage.php?t=RANews) |
56 | | - - Submitting a Play This Set, Wish This Set, or RAdvantage entry. |
57 | | - - Submitting a retrogaming article. |
58 | | - - Proposing a new article idea. |
59 | | - - Getting involved with RANews.`, |
60 | | - }, |
61 | | - { |
62 | | - name: ":e_mail: RAEvents", |
63 | | - value: `[Send a message to RAEvents](https://retroachievements.org/createmessage.php?t=RAEvents) |
64 | | - - Submissions, questions, ideas, or reporting issues related to events.`, |
65 | | - }, |
66 | | - { |
67 | | - name: ":e_mail: DevQuest", |
68 | | - value: `[Send a message to DevQuest](https://retroachievements.org/createmessage.php?t=DevQuest) |
69 | | - - Submissions, questions, ideas, or reporting issues related to DevQuest.`, |
70 | | - }, |
71 | | - { |
72 | | - name: ":e_mail: RACheats", |
73 | | - value: `[Send a message to RACheats](https://retroachievements.org/createmessage.php?t=RACheats) |
74 | | - - If you believe someone is in violation of our [Global Leaderboard and Achievement Hunting Rules](https://docs.retroachievements.org/guidelines/users/global-leaderboard-and-achievement-hunting-rules.html#not-allowed).`, |
75 | | - }, |
76 | | - ]); |
| 141 | + .addSeparatorComponents(separator) |
| 142 | + .addSectionComponents( |
| 143 | + buildTeamSection({ |
| 144 | + name: "RACheats", |
| 145 | + username: "RACheats", |
| 146 | + reasons: [ |
| 147 | + "If you believe someone is in violation of our [Global Leaderboard and Achievement Hunting Rules](https://docs.retroachievements.org/guidelines/users/global-leaderboard-and-achievement-hunting-rules.html#not-allowed).", |
| 148 | + ], |
| 149 | + }), |
| 150 | + ); |
77 | 151 | }; |
0 commit comments