-
Notifications
You must be signed in to change notification settings - Fork 5
Convert /contact to components v2 #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,77 +1,151 @@ | ||
| import { EmbedBuilder } from "discord.js"; | ||
|
|
||
| import { COLORS } from "../config/constants"; | ||
| import { | ||
| ButtonBuilder, | ||
| ButtonStyle, | ||
| ContainerBuilder, | ||
| SectionBuilder, | ||
| SeparatorBuilder, | ||
| SeparatorSpacingSize, | ||
| TextDisplayBuilder, | ||
| } from "discord.js"; | ||
|
|
||
| type Team = { | ||
| name: string; | ||
| // username to message on RA | ||
| username: string; | ||
| reasons: string[]; | ||
| }; | ||
|
|
||
| const buildContactButton = (account: string): ButtonBuilder => { | ||
| return new ButtonBuilder() | ||
| .setStyle(ButtonStyle.Link) | ||
| .setLabel("Message " + account) | ||
| .setURL("https://retroachievements.org/messages/create?to=" + account); | ||
| }; | ||
|
|
||
| const buildTeamSection = (team: Team): SectionBuilder => { | ||
| const reasons = team.reasons.map((reason: string) => "- " + reason).join("\n"); | ||
|
|
||
| return new SectionBuilder() | ||
| .setButtonAccessory(buildContactButton(team.username)) | ||
| .addTextDisplayComponents( | ||
| new TextDisplayBuilder().setContent("## :e_mail: " + team.name + "\n" + reasons), | ||
| ); | ||
| }; | ||
|
|
||
| const separator = new SeparatorBuilder().setSpacing(SeparatorSpacingSize.Small).setDivider(true); | ||
|
|
||
| export const buildContactEmbed = (): EmbedBuilder => { | ||
| return new EmbedBuilder() | ||
| .setColor(COLORS.PRIMARY) | ||
| .setTitle("Contact Us") | ||
| .setDescription( | ||
| "If you would like to contact us, please send a site message to the appropriate team below.", | ||
| export const buildContactEmbed = (): ContainerBuilder => { | ||
| return new ContainerBuilder() | ||
| .setAccentColor(COLORS.PRIMARY) | ||
| .addTextDisplayComponents( | ||
| new TextDisplayBuilder().setContent( | ||
| "# Contact Us\n" + | ||
| "If you would like to contact us, please send a site message to the appropriate team below.", | ||
| ), | ||
| ) | ||
| .addSeparatorComponents(separator) | ||
| .addSectionComponents( | ||
| buildTeamSection({ | ||
| name: "Admins and Moderators", | ||
| username: "RAdmin", | ||
| reasons: [ | ||
| "Reporting offensive behavior.", | ||
| "Reporting copyrighted material.", | ||
| "Requesting to be untracked.", | ||
| ], | ||
| }), | ||
| ) | ||
| .addSeparatorComponents(separator) | ||
| .addSectionComponents( | ||
| buildTeamSection({ | ||
| name: "Developer Compliance", | ||
| username: "DevCompliance", | ||
| reasons: [ | ||
| "Requesting set approval or early set release.", | ||
| "Reporting achievements or sets with unwelcome concepts.", | ||
| "Reporting sets failing to cover basic progression.", | ||
| ], | ||
| }), | ||
| ) | ||
| .addSeparatorComponents(separator) | ||
| .addSectionComponents( | ||
| buildTeamSection({ | ||
| name: "Quality Assurance", | ||
| username: "QATeam", | ||
| reasons: [ | ||
| "Reporting a broken set, leaderboard, or rich presence.", | ||
| "Reporting achievements with grammatical mistakes.", | ||
| "Requesting a set be playtested.", | ||
| "Hash compatibility questions.", | ||
| "Hub organizational questions.", | ||
| "Getting involved in a QA sub-team.", | ||
| ], | ||
| }), | ||
| ) | ||
| .addSeparatorComponents(separator) | ||
| .addSectionComponents( | ||
| buildTeamSection({ | ||
| name: "Art Team", | ||
| username: "RAArtTeam", | ||
| reasons: [ | ||
| "Icon Gauntlets and how to start one.", | ||
| "Proposing art updates.", | ||
| "Questions about art-related rule changes.", | ||
| "Requests for help with creating a new badge or badge set.", | ||
| ], | ||
| }), | ||
| ) | ||
| .addSeparatorComponents(separator) | ||
| .addSectionComponents( | ||
| buildTeamSection({ | ||
| name: "Writing Team", | ||
| username: "WritingTeam", | ||
| reasons: [ | ||
| "Reporting achievements with grammatical mistakes.", | ||
| "Reporting achievements with unclear or confusing descriptions.", | ||
| "Requesting help from the team with proofreading achievement sets.", | ||
| "Requesting help for coming up with original titles for achievements.", | ||
| ], | ||
| }), | ||
| ) | ||
| .addSeparatorComponents(separator) | ||
| .addSectionComponents( | ||
| buildTeamSection({ | ||
| name: "RANews", | ||
| username: "RANews", | ||
| reasons: [ | ||
| "Submitting a Play This Set, Wish This Set, or RAdvantage entry.", | ||
| "Submitting a retrogaming article.", | ||
| "Proposing a new article idea.", | ||
| "Getting involved with RANews.", | ||
| ], | ||
| }), | ||
| ) | ||
| .addSeparatorComponents(separator) | ||
| .addSectionComponents( | ||
| buildTeamSection({ | ||
| name: "RAEvents", | ||
| username: "RAEvents", | ||
| reasons: ["Submissions, questions, ideas, or reporting issues related to events."], | ||
| }), | ||
| ) | ||
| .addSeparatorComponents(separator) | ||
| .addSectionComponents( | ||
| buildTeamSection({ | ||
| name: "DevQuest", | ||
| username: "DevQuest", | ||
| reasons: ["Submissions, questions, ideas, or reporting issues related to DevQuest."], | ||
| }), | ||
| ) | ||
| .addFields([ | ||
| { | ||
| name: ":e_mail: Admins and Moderators", | ||
| value: `[Send a message to RAdmin](https://retroachievements.org/createmessage.php?t=RAdmin) | ||
| - Reporting offensive behavior. | ||
| - Reporting copyrighted material. | ||
| - Requesting to be untracked.`, | ||
| }, | ||
| { | ||
| name: ":e_mail: Developer Compliance", | ||
| value: `[Send a message to Developer Compliance](https://retroachievements.org/createmessage.php?t=DevCompliance) | ||
| - Requesting set approval or early set release. | ||
| - Reporting achievements or sets with unwelcome concepts. | ||
| - Reporting sets failing to cover basic progression.`, | ||
| }, | ||
| { | ||
| name: ":e_mail: Quality Assurance", | ||
| value: `[Send a message to Quality Assurance](https://retroachievements.org/createmessage.php?t=QATeam) | ||
| - Reporting a broken set, leaderboard, or rich presence. | ||
| - Reporting achievements with grammatical mistakes. | ||
| - Requesting a set be playtested. | ||
| - Hash compatibility questions. | ||
| - Hub organizational questions. | ||
| - Getting involved in a QA sub-team.`, | ||
| }, | ||
| { | ||
| name: ":e_mail: RAArtTeam", | ||
| value: `[Send a message to RAArtTeam](https://retroachievements.org/messages/create?to=RAArtTeam) | ||
| - Icon Gauntlets and how to start one. | ||
| - Proposing art updates. | ||
| - Questions about art-related rule changes. | ||
| - Requests for help with creating a new badge or badge set.`, | ||
| }, | ||
| { | ||
| name: ":e_mail: WritingTeam", | ||
| value: `[Send a message to WritingTeam](https://retroachievements.org/messages/create?to=WritingTeam) | ||
| - Reporting achievements with grammatical mistakes. | ||
| - Reporting achievements with unclear or confusing descriptions. | ||
| - Requesting help from the team with proofreading achievement sets. | ||
| - Requesting help for coming up with original titles for achievements.`, | ||
| }, | ||
| { | ||
| name: ":e_mail: RANews", | ||
| value: `[Send a message to RANews](https://retroachievements.org/createmessage.php?t=RANews) | ||
| - Submitting a Play This Set, Wish This Set, or RAdvantage entry. | ||
| - Submitting a retrogaming article. | ||
| - Proposing a new article idea. | ||
| - Getting involved with RANews.`, | ||
| }, | ||
| { | ||
| name: ":e_mail: RAEvents", | ||
| value: `[Send a message to RAEvents](https://retroachievements.org/createmessage.php?t=RAEvents) | ||
| - Submissions, questions, ideas, or reporting issues related to events.`, | ||
| }, | ||
| { | ||
| name: ":e_mail: DevQuest", | ||
| value: `[Send a message to DevQuest](https://retroachievements.org/createmessage.php?t=DevQuest) | ||
| - Submissions, questions, ideas, or reporting issues related to DevQuest.`, | ||
| }, | ||
| { | ||
| name: ":e_mail: RACheats", | ||
| value: `[Send a message to RACheats](https://retroachievements.org/createmessage.php?t=RACheats) | ||
| - 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).`, | ||
| }, | ||
| ]); | ||
| .addSeparatorComponents(separator) | ||
| .addSectionComponents( | ||
| buildTeamSection({ | ||
| name: "RACheats", | ||
| username: "RACheats", | ||
| reasons: [ | ||
| "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).", | ||
| ], | ||
| }), | ||
| ); | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.