-
-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement guild scheduled events (#1134)
* Start work for guild scheduled events * Continued work on implementing scheduled events * Add events requests to guild service, need to finish up rest stuff * Finish rest implementation * Update methods where object models changed due to api changes * [WIP] Adding stores actions for scheduled events * feat(scheduled events): implement core and store methods for scheduled events * fix(timestamp serializing): add jackson jsr310 implementation and configure instant serialization * doc(guild event): add example bot for guild scheduled events * fix(serialization): use Set<Long> instead of Set<Id> for guild event users storing in LegacyStoreLayout * refactor(data accessor): use default methods for new members to ease migraiton * doc(license): add missing license header in some files * fix(type inference): fix type inference oddities in LegacyStoreLayout This refactoring uses an explicit cast to avoid a build error regarding type inference on the Long class in involved method. * doc(invalid tag): fix invalid tag usage in ScheduledEvent * Use discord-json snapshots * Remove all-args Guild#createScheduledEvent method * Update generators to include enum type as parameter * Rename interested to subscribed * Add guild scheduled event payload event names for deserialization * Add remaining core events for scheduled events * Fix javadoc --------- Co-authored-by: NovaFox161 <novamaday@gmail.com> Co-authored-by: quanticc <abarcab.ivan@gmail.com>
- Loading branch information
1 parent
d703d8d
commit 4106965
Showing
51 changed files
with
2,708 additions
and
27 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
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
35 changes: 35 additions & 0 deletions
35
.../src/main/java/discord4j/common/store/action/gateway/GuildScheduledEventCreateAction.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,35 @@ | ||
/* | ||
* This file is part of Discord4J. | ||
* | ||
* Discord4J is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Discord4J is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with Discord4J. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package discord4j.common.store.action.gateway; | ||
|
||
import discord4j.discordjson.json.gateway.GuildScheduledEventCreate; | ||
|
||
public class GuildScheduledEventCreateAction extends ShardAwareAction<Void> { | ||
|
||
private final GuildScheduledEventCreate guildScheduledEventCreate; | ||
|
||
GuildScheduledEventCreateAction(int shardIndex, GuildScheduledEventCreate guildScheduledEventCreate) { | ||
super(shardIndex); | ||
this.guildScheduledEventCreate = guildScheduledEventCreate; | ||
} | ||
|
||
public GuildScheduledEventCreate getGuildScheduledEventCreate() { | ||
return guildScheduledEventCreate; | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
.../src/main/java/discord4j/common/store/action/gateway/GuildScheduledEventDeleteAction.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 @@ | ||
/* | ||
* This file is part of Discord4J. | ||
* | ||
* Discord4J is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Discord4J is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with Discord4J. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package discord4j.common.store.action.gateway; | ||
|
||
import discord4j.discordjson.json.GuildScheduledEventData; | ||
import discord4j.discordjson.json.gateway.GuildScheduledEventDelete; | ||
|
||
public class GuildScheduledEventDeleteAction extends ShardAwareAction<GuildScheduledEventData> { | ||
|
||
private final GuildScheduledEventDelete guildScheduledEventDelete; | ||
|
||
GuildScheduledEventDeleteAction(int shardIndex, GuildScheduledEventDelete guildScheduledEventDelete) { | ||
super(shardIndex); | ||
this.guildScheduledEventDelete = guildScheduledEventDelete; | ||
} | ||
|
||
public GuildScheduledEventDelete getGuildScheduledEventDelete() { | ||
return guildScheduledEventDelete; | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
.../src/main/java/discord4j/common/store/action/gateway/GuildScheduledEventUpdateAction.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 @@ | ||
/* | ||
* This file is part of Discord4J. | ||
* | ||
* Discord4J is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Discord4J is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with Discord4J. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package discord4j.common.store.action.gateway; | ||
|
||
import discord4j.discordjson.json.GuildScheduledEventData; | ||
import discord4j.discordjson.json.gateway.GuildScheduledEventUpdate; | ||
|
||
public class GuildScheduledEventUpdateAction extends ShardAwareAction<GuildScheduledEventData> { | ||
|
||
private final GuildScheduledEventUpdate guildScheduledEventUpdate; | ||
|
||
GuildScheduledEventUpdateAction(int shardIndex, GuildScheduledEventUpdate guildScheduledEventUpdate) { | ||
super(shardIndex); | ||
this.guildScheduledEventUpdate = guildScheduledEventUpdate; | ||
} | ||
|
||
public GuildScheduledEventUpdate getGuildScheduledEventUpdate() { | ||
return guildScheduledEventUpdate; | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
...src/main/java/discord4j/common/store/action/gateway/GuildScheduledEventUserAddAction.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,34 @@ | ||
/* | ||
* This file is part of Discord4J. | ||
* | ||
* Discord4J is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Discord4J is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with Discord4J. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package discord4j.common.store.action.gateway; | ||
|
||
import discord4j.discordjson.json.gateway.GuildScheduledEventUserAdd; | ||
|
||
public class GuildScheduledEventUserAddAction extends ShardAwareAction<Void> { | ||
|
||
private final GuildScheduledEventUserAdd userAdd; | ||
|
||
public GuildScheduledEventUserAddAction(int shardIndex, GuildScheduledEventUserAdd userAdd) { | ||
super(shardIndex); | ||
this.userAdd = userAdd; | ||
} | ||
|
||
public GuildScheduledEventUserAdd getUserAdd() { | ||
return userAdd; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
.../main/java/discord4j/common/store/action/gateway/GuildScheduledEventUserRemoveAction.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,34 @@ | ||
/* | ||
* This file is part of Discord4J. | ||
* | ||
* Discord4J is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Discord4J is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with Discord4J. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package discord4j.common.store.action.gateway; | ||
|
||
import discord4j.discordjson.json.gateway.GuildScheduledEventUserRemove; | ||
|
||
public class GuildScheduledEventUserRemoveAction extends ShardAwareAction<Void>{ | ||
|
||
private final GuildScheduledEventUserRemove userRemove; | ||
|
||
public GuildScheduledEventUserRemoveAction(int shardIndex, GuildScheduledEventUserRemove userRemove) { | ||
super(shardIndex); | ||
this.userRemove = userRemove; | ||
} | ||
|
||
public GuildScheduledEventUserRemove getUserRemove() { | ||
return userRemove; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...on/src/main/java/discord4j/common/store/action/read/GetGuildScheduledEventByIdAction.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,41 @@ | ||
/* | ||
* This file is part of Discord4J. | ||
* | ||
* Discord4J is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Discord4J is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with Discord4J. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package discord4j.common.store.action.read; | ||
|
||
import discord4j.common.store.api.StoreAction; | ||
import discord4j.discordjson.json.GuildScheduledEventData; | ||
|
||
public class GetGuildScheduledEventByIdAction implements StoreAction<GuildScheduledEventData> { | ||
|
||
private final long guildId; | ||
|
||
private final long eventId; | ||
|
||
GetGuildScheduledEventByIdAction(long guildId, long eventId) { | ||
this.guildId = guildId; | ||
this.eventId = eventId; | ||
} | ||
|
||
public long getGuildId() { | ||
return guildId; | ||
} | ||
|
||
public long getEventId() { | ||
return eventId; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...n/src/main/java/discord4j/common/store/action/read/GetGuildScheduledEventUsersAction.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,27 @@ | ||
/* | ||
* This file is part of Discord4J. | ||
* | ||
* Discord4J is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Discord4J is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with Discord4J. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package discord4j.common.store.action.read; | ||
|
||
import discord4j.common.store.api.StoreAction; | ||
import discord4j.discordjson.json.GuildScheduledEventUserData; | ||
|
||
public class GetGuildScheduledEventUsersAction implements StoreAction<GuildScheduledEventUserData> { | ||
|
||
GetGuildScheduledEventUsersAction() { | ||
} | ||
} |
Oops, something went wrong.