Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented GUILD_ROLE_UPDATE along with all related events.
- Loading branch information
1 parent
0566b94
commit 03dda44
Showing
12 changed files
with
421 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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 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
29 changes: 29 additions & 0 deletions
29
src/main/java/net/dv8tion/jda/core/events/role/update/GenericRoleUpdateEvent.java
This file contains 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,29 @@ | ||
/* | ||
* Copyright 2015-2016 Austin Keener & Michael Ritter | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.dv8tion.jda.core.events.role.update; | ||
|
||
import net.dv8tion.jda.core.JDA; | ||
import net.dv8tion.jda.core.entities.Role; | ||
import net.dv8tion.jda.core.events.role.GenericRoleEvent; | ||
|
||
public abstract class GenericRoleUpdateEvent extends GenericRoleEvent | ||
{ | ||
public GenericRoleUpdateEvent(JDA api, long responseNumber, Role role) | ||
{ | ||
super(api, responseNumber, role); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/net/dv8tion/jda/core/events/role/update/RoleUpdateColorEvent.java
This file contains 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,38 @@ | ||
/* | ||
* Copyright 2015-2016 Austin Keener & Michael Ritter | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.dv8tion.jda.core.events.role.update; | ||
|
||
import net.dv8tion.jda.core.JDA; | ||
import net.dv8tion.jda.core.entities.Role; | ||
|
||
import java.awt.*; | ||
|
||
public class RoleUpdateColorEvent extends GenericRoleUpdateEvent | ||
{ | ||
private final Color oldColor; | ||
|
||
public RoleUpdateColorEvent(JDA api, long responseNumber, Role role, Color oldColor) | ||
{ | ||
super(api, responseNumber, role); | ||
this.oldColor = oldColor; | ||
} | ||
|
||
public Color getOldColor() | ||
{ | ||
return oldColor; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/net/dv8tion/jda/core/events/role/update/RoleUpdateHoistedEvent.java
This file contains 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,36 @@ | ||
/* | ||
* Copyright 2015-2016 Austin Keener & Michael Ritter | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.dv8tion.jda.core.events.role.update; | ||
|
||
import net.dv8tion.jda.core.JDA; | ||
import net.dv8tion.jda.core.entities.Role; | ||
|
||
public class RoleUpdateHoistedEvent extends GenericRoleUpdateEvent | ||
{ | ||
private final boolean wasHoisted; | ||
|
||
public RoleUpdateHoistedEvent(JDA api, long responseNumber, Role role, boolean wasHoisted) | ||
{ | ||
super(api, responseNumber, role); | ||
this.wasHoisted = wasHoisted; | ||
} | ||
|
||
public boolean wasHoisted() | ||
{ | ||
return wasHoisted; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/net/dv8tion/jda/core/events/role/update/RoleUpdateMentionableEvent.java
This file contains 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,36 @@ | ||
/* | ||
* Copyright 2015-2016 Austin Keener & Michael Ritter | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.dv8tion.jda.core.events.role.update; | ||
|
||
import net.dv8tion.jda.core.JDA; | ||
import net.dv8tion.jda.core.entities.Role; | ||
|
||
public class RoleUpdateMentionableEvent extends GenericRoleUpdateEvent | ||
{ | ||
private final boolean wasMentionable; | ||
|
||
public RoleUpdateMentionableEvent(JDA api, long responseNumber, Role role, boolean wasMentionable) | ||
{ | ||
super(api, responseNumber, role); | ||
this.wasMentionable = wasMentionable; | ||
} | ||
|
||
public boolean wasMentionable() | ||
{ | ||
return wasMentionable; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/net/dv8tion/jda/core/events/role/update/RoleUpdateNameEvent.java
This file contains 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,36 @@ | ||
/* | ||
* Copyright 2015-2016 Austin Keener & Michael Ritter | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.dv8tion.jda.core.events.role.update; | ||
|
||
import net.dv8tion.jda.core.JDA; | ||
import net.dv8tion.jda.core.entities.Role; | ||
|
||
public class RoleUpdateNameEvent extends GenericRoleUpdateEvent | ||
{ | ||
private final String oldName; | ||
|
||
public RoleUpdateNameEvent(JDA api, long responseNumber, Role role, String oldName) | ||
{ | ||
super(api, responseNumber, role); | ||
this.oldName = oldName; | ||
} | ||
|
||
public String getOldName() | ||
{ | ||
return oldName; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/net/dv8tion/jda/core/events/role/update/RoleUpdatePermissionsEvent.java
This file contains 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,46 @@ | ||
/* | ||
* Copyright 2015-2016 Austin Keener & Michael Ritter | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.dv8tion.jda.core.events.role.update; | ||
|
||
import net.dv8tion.jda.core.JDA; | ||
import net.dv8tion.jda.core.Permission; | ||
import net.dv8tion.jda.core.entities.Role; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class RoleUpdatePermissionsEvent extends GenericRoleUpdateEvent | ||
{ | ||
private final int oldPermissionsRaw; | ||
|
||
public RoleUpdatePermissionsEvent(JDA api, long responseNumber, Role role, int oldPermissionsRaw) | ||
{ | ||
super(api, responseNumber, role); | ||
this.oldPermissionsRaw = oldPermissionsRaw; | ||
} | ||
|
||
public List<Permission> getOldPermissions() | ||
{ | ||
return Collections.unmodifiableList( | ||
Permission.getPermissions(oldPermissionsRaw)); | ||
} | ||
|
||
public int getOldPermissionsRaw() | ||
{ | ||
return oldPermissionsRaw; | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/net/dv8tion/jda/core/events/role/update/RoleUpdatePositionEvent.java
This file contains 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,43 @@ | ||
/* | ||
* Copyright 2015-2016 Austin Keener & Michael Ritter | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.dv8tion.jda.core.events.role.update; | ||
|
||
import net.dv8tion.jda.core.JDA; | ||
import net.dv8tion.jda.core.entities.Role; | ||
|
||
public class RoleUpdatePositionEvent extends GenericRoleUpdateEvent | ||
{ | ||
private final int oldPosition; | ||
private final int oldPositionRaw; | ||
|
||
public RoleUpdatePositionEvent(JDA api, long responseNumber, Role role, int oldPosition, int oldPositionRaw) | ||
{ | ||
super(api, responseNumber, role); | ||
this.oldPosition = oldPosition; | ||
this.oldPositionRaw = oldPositionRaw; | ||
} | ||
|
||
public int getOldPosition() | ||
{ | ||
return oldPosition; | ||
} | ||
|
||
public int getOldPositionRaw() | ||
{ | ||
return oldPositionRaw; | ||
} | ||
} |
Oops, something went wrong.