This repository was archived by the owner on Dec 21, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
src/main/java/com/github/codedoctorde/linwood Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ public class GameEntity {
2424 @ OneToOne (mappedBy = "gameEntity" )
2525 private GuildEntity guild ;
2626
27+ public Long getId () {
28+ return id ;
29+ }
2730
2831 public GuildEntity getGuild () {
2932 return guild ;
Original file line number Diff line number Diff line change @@ -16,16 +16,12 @@ public class NotificationEntity {
1616 @ Column (name = "id" )
1717 private Long id ;
1818 @ Column
19- @ Nullable
2019 private Long teamRoleId = null ;
2120 @ Column
22- @ Nullable
2321 private Long supportChatId = null ;
2422 @ Column
25- @ Nullable
2623 private Long statusChatId = null ;
2724 @ Column
28- @ Nullable
2925 private Long logChatId = null ;
3026 @ OneToOne (mappedBy = "notificationEntity" )
3127 private GuildEntity guild ;
@@ -60,6 +56,7 @@ public void setTeamRoleId(Long teamRoleId) {
6056 this .teamRoleId = teamRoleId ;
6157 }
6258
59+ @ Nullable
6360 public Long getSupportChatId () {
6461 return supportChatId ;
6562 }
Original file line number Diff line number Diff line change 1414import java .awt .*;
1515import java .text .MessageFormat ;
1616import java .time .LocalDateTime ;
17+ import java .util .Objects ;
1718import java .util .ResourceBundle ;
1819
1920public class NotificationListener {
@@ -24,8 +25,8 @@ public void onMessageReceived(MessageReceivedEvent event){
2425 var session = Linwood .getInstance ().getDatabase ().getSessionFactory ().openSession ();
2526 var entity = Linwood .getInstance ().getDatabase ().getGuildById (session , event .getGuild ().getIdLong ());
2627 var notification = entity .getNotificationEntity ();
27- if (event .getChannel ().getIdLong () ==
28- notification .getSupportChatId ()){
28+ if (Objects . equals ( event .getChannel ().getIdLong (),
29+ notification .getSupportChatId ())) {
2930 var role = event .getGuild ().getRoleById (notification .getTeamRoleId ());
3031 var bundle = getBundle (entity );
3132 event .getGuild ().findMembers (member -> member .getRoles ().contains (role ) && member .getOnlineStatus () == OnlineStatus .ONLINE ).onSuccess (members -> {
You can’t perform that action at this time.
0 commit comments