chat commands: fix cmb to use correct endpoint

This commit is contained in:
Adam Keenan
2022-01-30 19:57:35 -05:00
committed by GitHub
parent 9458bd8d65
commit 58d2b2e0e1

View File

@@ -1407,21 +1407,11 @@ public class ChatCommandsPlugin extends Plugin
return; return;
} }
ChatMessageType type = chatMessage.getType(); final HiscoreLookup lookup = getCorrectLookupFor(chatMessage);
String player;
if (type == ChatMessageType.PRIVATECHATOUT)
{
player = client.getLocalPlayer().getName();
}
else
{
player = Text.sanitize(chatMessage.getName());
}
try try
{ {
HiscoreResult playerStats = hiscoreClient.lookup(player); HiscoreResult playerStats = hiscoreClient.lookup(lookup.getName(), lookup.getEndpoint());
if (playerStats == null) if (playerStats == null)
{ {