@@ -30,8 +30,7 @@ public class GithubIssueCommand implements ICommand {
3030
3131 private static final String apiRoot = "https://api.github.com/" ;
3232 private static final Map <String , String > aliasMap = new HashMap <>();
33- private static final Map <String , String > categoryAliasMap = new HashMap <>();
34-
33+ private static final Map <String , String > channelAliasMap = new HashMap <>();
3534
3635 public GithubIssueCommand () {
3736 aliasMap .clear ();
@@ -46,7 +45,7 @@ public GithubIssueCommand() {
4645 }
4746 aliasMap .put (alias .toLowerCase (), repo );
4847 }
49- categoryAliasMap .clear ();
48+ channelAliasMap .clear ();
5049 for (String str : FloppaTomlConfig .channelAliases .split (";" )) {
5150 List <String > split = new ArrayList <>(List .of (str .split (":" )));
5251 String alias = split .remove (0 );
@@ -56,13 +55,13 @@ public GithubIssueCommand() {
5655 } else {
5756 repo = split .get (0 );
5857 }
59- categoryAliasMap .put (alias , repo .toLowerCase ());
58+ channelAliasMap .put (alias , repo .toLowerCase ());
6059 }
6160 }
6261
6362 @ Override
6463 public @ NotNull String getName () {
65- return "gh " ;
64+ return "ghissue " ;
6665 }
6766
6867 @ Nullable
@@ -78,12 +77,12 @@ public String execute(Message message) {
7877 .forEach (matchResult -> {
7978 if (matchResult .group (1 ) == null ) {
8079 MessageChannel channel = message .getChannel ().block ();
81- if (channel != null && categoryAliasMap .containsKey (channel .getId ().asString ())) {
82- issueList .add (new IssueListItem (aliasMap .get (categoryAliasMap .get (channel .getId ().asString ())), matchResult .group (2 )));
80+ if (channel != null && channelAliasMap .containsKey (channel .getId ().asString ())) {
81+ issueList .add (new IssueListItem (aliasMap .get (channelAliasMap .get (channel .getId ().asString ())), matchResult .group (2 )));
8382 } else if (channel instanceof ThreadChannel thread ) {
8483 Optional <Snowflake > parentId = thread .getParentId ();
85- if (parentId .isPresent () && categoryAliasMap .containsKey (parentId .get ().asString ())) {
86- issueList .add (new IssueListItem (aliasMap .get (categoryAliasMap .get (parentId .get ().asString ())), matchResult .group (2 )));
84+ if (parentId .isPresent () && channelAliasMap .containsKey (parentId .get ().asString ())) {
85+ issueList .add (new IssueListItem (aliasMap .get (channelAliasMap .get (parentId .get ().asString ())), matchResult .group (2 )));
8786 }
8887 }
8988 } else if (aliasMap .containsKey (matchResult .group (1 ).toLowerCase ())){
@@ -173,7 +172,14 @@ public String execute(Message message) {
173172 public String helpInfo () {
174173 return "Provides links to issues for github repos" ;
175174 }
176- private record IssueListItem (String repo , String id ) {
177175
176+ public static Map <String , String > getAliasMap () {
177+ return Collections .unmodifiableMap (aliasMap );
178+ }
179+
180+ public static Map <String , String > getChannelAliasMap () {
181+ return Collections .unmodifiableMap (channelAliasMap );
178182 }
183+
184+ private record IssueListItem (String repo , String id ) { }
179185}
0 commit comments