/// <summary> /// Clears the emote for the provided <see cref="XMPPClient"/>. /// </summary> /// <param name="xmppClient">The <see cref="XMPPClient"/> to clear the emote for.</param> public async Task ClearEmote(XMPPClient xmppClient) { // Reset the FrontendEmote property in the member meta. Meta["Default:FrontendEmote_j"] = new FrontendEmote().ToString(); // Update the member. await PartyService.UpdateMember(xmppClient.AuthSession, this, xmppClient.CurrentParty.Id, new() { { "Default:FrontendEmote_j", Meta["Default:FrontendEmote_j"] } }); }
/// <summary> /// Sets the emoji of the provided <see cref="XMPPClient"/>. /// </summary> /// <param name="xmppClient">The <see cref="XMPPClient"/> to set the emoji for.</param> /// <param name="emoji">The name of the desired emoji.</param> public async Task SetEmoji(XMPPClient xmppClient, string emoji) { // Get the emoji by its name. var cosmetic = await CosmeticHelper.GetCosmeticByName(emoji, "AthenaEmoji"); // If the client is emoting, clear the emote. if (JsonConvert.DeserializeObject <FrontendEmote>(Meta["Default:FrontendEmote_j"]).Data.EmoteItemDefinition != "None") { await ClearEmote(xmppClient); } // Update the meta. Meta["Default:FrontendEmote_j"] = new FrontendEmote(cosmetic.Id, true, -2).ToString(); // Update the member. await PartyService.UpdateMember(xmppClient.AuthSession, this, xmppClient.CurrentParty.Id, new() { { "Default:FrontendEmote_j", Meta["Default:FrontendEmote_j"] } }); }