-
-
Notifications
You must be signed in to change notification settings - Fork 105
Semi-Automatic Top Helper Assignment #1303
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 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6ed19de
config, command adjustments, routine and base setup
Zabuzard d14820d
select menu
Zabuzard c7ea0f9
role management and more flow
Zabuzard 90d5544
announcement, failure logic
Zabuzard f9c3dea
(fixed some comment that spotless wrapped ugly)
Zabuzard 121c02c
javadoc and some readability changes
Zabuzard 69bc71b
fixed some wrong javadoc
Zabuzard e2d0308
(minor description tweak)
Zabuzard e938b0d
CR: better default channel
Zabuzard 31e2624
CR message format improvement
Zabuzard fa617d1
CR added mapUserIdToMember utility to service
Zabuzard 21a1880
Added Guilds, a helper with role and channel find methods
Zabuzard 9fadf60
CR readability with split args
Zabuzard e29b124
Added channel find methods to Guilds helper (findTextChannel etc)
Zabuzard 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
58 changes: 58 additions & 0 deletions
58
application/src/main/java/org/togetherjava/tjbot/config/TopHelpersConfig.java
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 |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| package org.togetherjava.tjbot.config; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonCreator; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.fasterxml.jackson.annotation.JsonRootName; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| /** | ||
| * Configuration for the top helper system, see | ||
| * {@link org.togetherjava.tjbot.features.tophelper.TopHelpersCommand}. | ||
| */ | ||
| @JsonRootName("topHelpers") | ||
| public final class TopHelpersConfig { | ||
| private final String rolePattern; | ||
| private final String assignmentChannelPattern; | ||
| private final String announcementChannelPattern; | ||
|
|
||
| @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) | ||
| private TopHelpersConfig( | ||
| @JsonProperty(value = "rolePattern", required = true) String rolePattern, | ||
| @JsonProperty(value = "assignmentChannelPattern", | ||
| required = true) String assignmentChannelPattern, | ||
| @JsonProperty(value = "announcementChannelPattern", | ||
| required = true) String announcementChannelPattern) { | ||
| this.rolePattern = Objects.requireNonNull(rolePattern); | ||
| this.assignmentChannelPattern = Objects.requireNonNull(assignmentChannelPattern); | ||
| this.announcementChannelPattern = Objects.requireNonNull(announcementChannelPattern); | ||
| } | ||
|
|
||
| /** | ||
| * Gets the REGEX pattern matching the role used to represent Top Helpers. | ||
| * | ||
| * @return the role name pattern | ||
| */ | ||
| public String getRolePattern() { | ||
| return rolePattern; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the REGEX pattern used to identify the channel where Top Helper assignments are | ||
| * automatically executed. | ||
| * | ||
| * @return the channel name pattern | ||
| */ | ||
| public String getAssignmentChannelPattern() { | ||
| return assignmentChannelPattern; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the REGEX pattern used to identify the channel where Top Helper announcements are send. | ||
| * | ||
| * @return the channel name pattern | ||
| */ | ||
| public String getAnnouncementChannelPattern() { | ||
| return announcementChannelPattern; | ||
| } | ||
| } |
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
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.