11import { COLORS } from "../config/constants" ;
22import {
3- TextDisplayBuilder ,
4- SeparatorBuilder ,
5- SeparatorSpacingSize ,
63 ButtonBuilder ,
74 ButtonStyle ,
8- SectionBuilder ,
95 ContainerBuilder ,
6+ SectionBuilder ,
7+ SeparatorBuilder ,
8+ SeparatorSpacingSize ,
9+ TextDisplayBuilder ,
1010} from "discord.js" ;
1111
12+ type Team = {
13+ name : string ;
14+ // username to message on RA
15+ username : string ;
16+ reasons : string [ ] ;
17+ } ;
18+
1219const buildContactButton = ( account : string ) : ButtonBuilder => {
1320 return new ButtonBuilder ( )
1421 . setStyle ( ButtonStyle . Link )
1522 . setLabel ( "Message " + account )
1623 . setURL ( "https://retroachievements.org/messages/create?to=" + account ) ;
1724} ;
1825
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 ) ;
37+
1938export const buildContactEmbed = ( ) : ContainerBuilder => {
2039 return new ContainerBuilder ( )
2140 . setAccentColor ( COLORS . PRIMARY )
@@ -25,139 +44,108 @@ export const buildContactEmbed = (): ContainerBuilder => {
2544 "If you would like to contact us, please send a site message to the appropriate team below." ,
2645 ) ,
2746 )
28- . addSeparatorComponents (
29- new SeparatorBuilder ( ) . setSpacing ( SeparatorSpacingSize . Small ) . setDivider ( true ) ,
30- )
47+ . addSeparatorComponents ( separator )
3148 . addSectionComponents (
32- new SectionBuilder ( )
33- . setButtonAccessory ( buildContactButton ( "RAdmin" ) )
34- . addTextDisplayComponents (
35- new TextDisplayBuilder ( ) . setContent (
36- "## :e_mail: Admins and Moderators\n" +
37- "- Reporting offensive behavior.\n" +
38- "- Reporting copyrighted material.\n" +
39- "- Requesting to be untracked." ,
40- ) ,
41- ) ,
42- )
43- . addSeparatorComponents (
44- new SeparatorBuilder ( ) . setSpacing ( SeparatorSpacingSize . Small ) . setDivider ( true ) ,
45- )
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 )
4660 . addSectionComponents (
47- new SectionBuilder ( )
48- . setButtonAccessory ( buildContactButton ( "DevCompliance" ) )
49- . addTextDisplayComponents (
50- new TextDisplayBuilder ( ) . setContent (
51- "## :e_mail: Developer Compliance\n" +
52- "- Requesting set approval or early set release.\n" +
53- "- Reporting achievements or sets with unwelcome concepts.\n" +
54- "- Reporting sets failing to cover basic progression." ,
55- ) ,
56- ) ,
57- )
58- . addSeparatorComponents (
59- new SeparatorBuilder ( ) . setSpacing ( SeparatorSpacingSize . Small ) . setDivider ( true ) ,
60- )
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 )
6172 . addSectionComponents (
62- new SectionBuilder ( )
63- . setButtonAccessory ( buildContactButton ( "QATeam" ) )
64- . addTextDisplayComponents (
65- new TextDisplayBuilder ( ) . setContent (
66- "## :e_mail: Quality Assurance\n" +
67- "- Reporting a broken set, leaderboard, or rich presence.\n" +
68- "- Reporting achievements with grammatical mistakes.\n" +
69- "- Requesting a set be playtested.\n" +
70- "- Hash compatibility questions.\n" +
71- "- Hub organizational questions.\n" +
72- "- Getting involved in a QA sub-team." ,
73- ) ,
74- ) ,
75- )
76- . addSeparatorComponents (
77- new SeparatorBuilder ( ) . setSpacing ( SeparatorSpacingSize . Small ) . setDivider ( true ) ,
78- )
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 )
7987 . addSectionComponents (
80- new SectionBuilder ( )
81- . setButtonAccessory ( buildContactButton ( "RAArtTeam" ) )
82- . addTextDisplayComponents (
83- new TextDisplayBuilder ( ) . setContent (
84- "## :e_mail: RAArtTeam\n" +
85- "- Icon Gauntlets and how to start one.\n" +
86- "- Proposing art updates.\n" +
87- "- Questions about art-related rule changes.\n" +
88- "- Requests for help with creating a new badge or badge set." ,
89- ) ,
90- ) ,
91- )
92- . addSeparatorComponents (
93- new SeparatorBuilder ( ) . setSpacing ( SeparatorSpacingSize . Small ) . setDivider ( true ) ,
94- )
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 )
95100 . addSectionComponents (
96- new SectionBuilder ( )
97- . setButtonAccessory ( buildContactButton ( "WritingTeam" ) )
98- . addTextDisplayComponents (
99- new TextDisplayBuilder ( ) . setContent (
100- "## :e_mail: WritingTeam\n" +
101- "- Reporting achievements with grammatical mistakes.\n" +
102- "- Reporting achievements with unclear or confusing descriptions.\n" +
103- "- Requesting help from the team with proofreading achievement sets.\n" +
104- "- Requesting help for coming up with original titles for achievements."
105- ) ,
106- ) ,
107- )
108- . addSeparatorComponents (
109- new SeparatorBuilder ( ) . setSpacing ( SeparatorSpacingSize . Small ) . setDivider ( true ) ,
110- )
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 )
111113 . addSectionComponents (
112- new SectionBuilder ( )
113- . setButtonAccessory ( buildContactButton ( "RANews" ) )
114- . addTextDisplayComponents (
115- new TextDisplayBuilder ( ) . setContent (
116- "## :e_mail: RANews\n" +
117- "- Submitting a Play This Set, Wish This Set, or RAdvantage entry.\n" +
118- "- Submitting a retrogaming article.\n" +
119- "- Proposing a new article idea.\n" +
120- "- Getting involved with RANews." ,
121- ) ,
122- ) ,
123- )
124- . addSeparatorComponents (
125- new SeparatorBuilder ( ) . setSpacing ( SeparatorSpacingSize . Small ) . setDivider ( true ) ,
126- )
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 )
127126 . addSectionComponents (
128- new SectionBuilder ( )
129- . setButtonAccessory ( buildContactButton ( "RAEvents" ) )
130- . addTextDisplayComponents (
131- new TextDisplayBuilder ( ) . setContent (
132- "## :e_mail: RAEvents\n" +
133- "- Submissions, questions, ideas, or reporting issues related to events." ,
134- ) ,
135- ) ,
136- )
137- . addSeparatorComponents (
138- new SeparatorBuilder ( ) . setSpacing ( SeparatorSpacingSize . Small ) . setDivider ( true ) ,
127+ buildTeamSection ( {
128+ name : "RAEvents" ,
129+ username : "RAEvents" ,
130+ reasons : [ "Submissions, questions, ideas, or reporting issues related to events." ] ,
131+ } ) ,
139132 )
133+ . addSeparatorComponents ( separator )
140134 . addSectionComponents (
141- new SectionBuilder ( )
142- . setButtonAccessory ( buildContactButton ( "DevQuest" ) )
143- . addTextDisplayComponents (
144- new TextDisplayBuilder ( ) . setContent (
145- "## :e_mail: DevQuest\n" +
146- "- Submissions, questions, ideas, or reporting issues related to DevQuest." ,
147- ) ,
148- ) ,
149- )
150- . addSeparatorComponents (
151- new SeparatorBuilder ( ) . setSpacing ( SeparatorSpacingSize . Small ) . setDivider ( true ) ,
135+ buildTeamSection ( {
136+ name : "DevQuest" ,
137+ username : "DevQuest" ,
138+ reasons : [ "Submissions, questions, ideas, or reporting issues related to DevQuest." ] ,
139+ } ) ,
152140 )
141+ . addSeparatorComponents ( separator )
153142 . addSectionComponents (
154- new SectionBuilder ( )
155- . setButtonAccessory ( buildContactButton ( "RACheats" ) )
156- . addTextDisplayComponents (
157- new TextDisplayBuilder ( ) . setContent (
158- "## :e_mail: RACheats\n" +
159- "- 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)." ,
160- ) ,
161- ) ,
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+ } ) ,
162150 ) ;
163151} ;
0 commit comments