Fix placeholder prefixes in impls, fix color relookup for user_color

This commit is contained in:
Vankka 2023-12-31 17:36:49 +02:00
parent 5652a7d544
commit 3b7701ee1a
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0
3 changed files with 5 additions and 1 deletions

View File

@ -123,7 +123,7 @@ public interface DiscordGuildMember extends JDAEntity<Member>, Mentionable {
* Gets the color of this user's highest role that has a color. * Gets the color of this user's highest role that has a color.
* @return the color that will be used for this user * @return the color that will be used for this user
*/ */
@Placeholder("color") @Placeholder(value = "color", relookup = "color")
Color getColor(); Color getColor();
/** /**

View File

@ -24,6 +24,7 @@ import com.discordsrv.api.discord.entity.guild.DiscordGuild;
import com.discordsrv.api.discord.entity.guild.DiscordGuildMember; import com.discordsrv.api.discord.entity.guild.DiscordGuildMember;
import com.discordsrv.api.discord.entity.guild.DiscordRole; import com.discordsrv.api.discord.entity.guild.DiscordRole;
import com.discordsrv.api.placeholder.annotation.Placeholder; import com.discordsrv.api.placeholder.annotation.Placeholder;
import com.discordsrv.api.placeholder.annotation.PlaceholderPrefix;
import com.discordsrv.api.placeholder.annotation.PlaceholderRemainder; import com.discordsrv.api.placeholder.annotation.PlaceholderRemainder;
import com.discordsrv.common.DiscordSRV; import com.discordsrv.common.DiscordSRV;
import com.discordsrv.common.component.util.ComponentUtil; import com.discordsrv.common.component.util.ComponentUtil;
@ -39,6 +40,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
@PlaceholderPrefix("user_")
public class DiscordGuildMemberImpl implements DiscordGuildMember { public class DiscordGuildMemberImpl implements DiscordGuildMember {
private final DiscordSRV discordSRV; private final DiscordSRV discordSRV;

View File

@ -30,6 +30,7 @@ import com.discordsrv.api.discord.entity.message.ReceivedDiscordMessage;
import com.discordsrv.api.discord.entity.message.SendableDiscordMessage; import com.discordsrv.api.discord.entity.message.SendableDiscordMessage;
import com.discordsrv.api.discord.exception.RestErrorResponseException; import com.discordsrv.api.discord.exception.RestErrorResponseException;
import com.discordsrv.api.placeholder.annotation.Placeholder; import com.discordsrv.api.placeholder.annotation.Placeholder;
import com.discordsrv.api.placeholder.annotation.PlaceholderPrefix;
import com.discordsrv.api.placeholder.annotation.PlaceholderRemainder; import com.discordsrv.api.placeholder.annotation.PlaceholderRemainder;
import com.discordsrv.common.DiscordSRV; import com.discordsrv.common.DiscordSRV;
import com.discordsrv.common.component.util.ComponentUtil; import com.discordsrv.common.component.util.ComponentUtil;
@ -49,6 +50,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
@PlaceholderPrefix("message_")
public class ReceivedDiscordMessageImpl implements ReceivedDiscordMessage { public class ReceivedDiscordMessageImpl implements ReceivedDiscordMessage {
public static ReceivedDiscordMessage fromJDA(DiscordSRV discordSRV, Message message) { public static ReceivedDiscordMessage fromJDA(DiscordSRV discordSRV, Message message) {