Skip to content
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

Added Root of Nightmares raid encounters #94

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/main/java/com/deahtstroke/rivenbot/enums/Raid.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ public enum Raid {
List.of(
new SocialLink(SocialPlatform.DEVIANTART, "https://www.deviantart.com/a-phantom-moon"))),
GARDEN_OF_SALVATION("Garden of Salvation", "garden_of_salvation", null, null),
DEEP_STONE_CRYPT("Deep Stone Crypt", "deep_stone_crypt", null, null),
DEEP_STONE_CRYPT("Deep Stone Crypt", "deep_stone_crypt", "a-phantom-moon",
List.of(
new SocialLink(SocialPlatform.DEVIANTART, "https://www.deviantart.com/a-phantom-moon"))),
VAULT_OF_GLASS("Vault of Glass", "vault_of_glass", "SCA",
List.of(
new SocialLink(SocialPlatform.STEAM, "https://steamcommunity.com/id/scaro25"))),
VOW_OF_THE_DISCIPLE("Vow of the Disciple", "vow_of_the_disciple", null, null),
KINGS_FALL("King's Fall", "kings_fall", null, null),
ROOT_OF_NIGHTMARES("Root of Nightmares", "root_of_nightmares", null, null),
ROOT_OF_NIGHTMARES("Root of Nightmares", "root_of_nightmares", "Pyranie",
List.of(
new SocialLink(SocialPlatform.TWITTER, "https://twitter.com/pryanie"),
new SocialLink(SocialPlatform.REDDIT, "https://www.reddit.com/user/pryanie/"))
),
CROTAS_END("Crota's End", "crotas_end", null, null);

@Getter
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/com/deahtstroke/rivenbot/enums/RaidEncounter.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package com.deahtstroke.rivenbot.enums;

import lombok.Getter;
import reactor.core.publisher.Flux;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import lombok.Getter;
import reactor.core.publisher.Flux;

public enum RaidEncounter {

// Root of Nightmares
CATACLYSM(Raid.ROOT_OF_NIGHTMARES, "Cataclysm", "cataclysm"),
SCISSION(Raid.ROOT_OF_NIGHTMARES, "Scission", "scission"),
CHASM(Raid.ROOT_OF_NIGHTMARES, "Chasm", "chasm"),
ZO_AURC(Raid.ROOT_OF_NIGHTMARES, "Zo'Aurc, Explicator of Planets", "zoaurc"),
NEZAREC(Raid.ROOT_OF_NIGHTMARES, "Nezarec, the Final God of Pain", "nezarec"),

Expand All @@ -22,7 +20,6 @@ public enum RaidEncounter {
MORGETH(Raid.LAST_WISH, "Morgeth, the Spirekeeper", "morgeth"),
VAULT_SECURITY_MECHANISM(Raid.LAST_WISH, "Vault Security Mechanism", "vault_security"),
RIVEN_OF_A_THOUSAND_VOICES(Raid.LAST_WISH, "Riven of a Thousand Voices", "riven"),
QUEENSWALK(Raid.LAST_WISH, "Queenswalk", "queenswalk"),

// Garden of Salvation
EMBRACE(Raid.GARDEN_OF_SALVATION, "Embrace", "embrace"),
Expand All @@ -35,7 +32,8 @@ public enum RaidEncounter {
CRYPT_SECURITY(Raid.DEEP_STONE_CRYPT, "Crypt Security", "crypt_security"),
ATRAKS_1(Raid.DEEP_STONE_CRYPT, "Atraks-1", "atraks_1"),
TANIKS_REBORN(Raid.DEEP_STONE_CRYPT, "Taniks-Reborn/Nuclear Descent", "taniks_reborn"),
TANIKS_THE_ABOMNITAION(Raid.DEEP_STONE_CRYPT, "Taniks, the Abomination", "taniks_the_abomination"),
TANIKS_THE_ABOMNITAION(Raid.DEEP_STONE_CRYPT, "Taniks, the Abomination",
"taniks_the_abomination"),

// Vault of Glass
CONFLUXES(Raid.VAULT_OF_GLASS, "Confluxes", "confluxes"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
public enum SocialPlatform {

DEVIANTART("DeviantArt", ":deviantart:", 1240125288885784616L),
STEAM("Steam", ":steamlogo:", 1240514012215513139L);
STEAM("Steam", ":steamlogo:", 1240765704114798635L),
REDDIT("Reddit", "redditlogo", 1240767009910947861L),
TWITTER("Twitter/X", "xlogo", 1240767798792294503L);

@Getter
private final String platformName;
Expand Down
30 changes: 19 additions & 11 deletions src/main/java/com/deahtstroke/rivenbot/handler/RaidMapHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.Map;
import java.util.Objects;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
import reactor.core.publisher.Flux;
Expand Down Expand Up @@ -63,6 +64,23 @@ private static InteractionResponse formatInteractionResponse(

RaidEncounter raidEncounter = RaidEncounter.findEncounter(raid, encounterDirectory);

List<Component> socials;
if (CollectionUtils.isNotEmpty(raid.getArtistSocials())) {
socials = raid.getArtistSocials().stream()
.map(socialLink -> Component.builder()
.type(2)
.style(5)
.url(socialLink.getSocialLink())
.label(SOCIAL_LINK_LABEL_FORMAT.formatted(raid.getArtistName(),
socialLink.getSocialPlatform().getPlatformName()))
.emoji(new Emoji(socialLink.getSocialPlatform().getEmojiId(),
socialLink.getSocialPlatform().getEmojiName(), false))
.build())
.toList();
} else {
socials = null;
}

List<Embedded> embeds = attachments.stream()
.map(attachment -> Embedded.builder()
.title(EMBED_TITLE.formatted(raid.getRaidName(), raidEncounter.getName()))
Expand All @@ -79,17 +97,7 @@ private static InteractionResponse formatInteractionResponse(
InteractionResponseData data = InteractionResponseData.builder()
.components(List.of(Component.builder()
.type(1)
.components(raid.getArtistSocials().stream()
.map(socialLink -> Component.builder()
.type(2)
.style(5)
.url(socialLink.getSocialLink())
.label(SOCIAL_LINK_LABEL_FORMAT.formatted(raid.getArtistName(),
socialLink.getSocialPlatform().getPlatformName()))
.emoji(new Emoji(socialLink.getSocialPlatform().getEmojiId(),
socialLink.getSocialPlatform().getEmojiName(), false))
.build())
.toList())
.components(socials)
.build()))
.attachments(attachments)
.embeds(embeds)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public void autocompleteRequestsForRaidMapAreSuccessful()
.expectBody()
.consumeWith(System.out::println)
.jsonPath("$.type").isEqualTo(8)
.jsonPath("$.data.choices.size()").isEqualTo(6)
.jsonPath("$.data.choices.size()").isEqualTo(5)
.jsonPath("$.data.choices").isArray()
.returnResult().getResponseBody();

Expand Down
Loading