private bool ClickButton(User user, string message, BaseChat chat, Message messageData) { if (!string.IsNullOrEmpty(messageData.Payload)) { try { var payload = KeyboardButtonPayload.Deserialize(messageData.Payload); if (payload != null && payload.IsValid()) { if (payload.GroupId == VkApi.GroupId || payload.GroupId == 0) { OnButtonClick(chat, user, message, payload, messageData); } return(true); } } catch (Exception e) { VkApi.Core.Log.Error(e.ToString()); } } return(false); }
internal bool ClickButton(BaseChat chat, User user, EventId eventId, string payload) { if (!string.IsNullOrEmpty(payload)) { try { var _payload = KeyboardButtonPayload.Deserialize(payload); if (_payload != null && _payload.IsValid()) { _payload.EventId = eventId; if (_payload.GroupId == VkApi.GroupId || _payload.GroupId == 0) { OnButtonClick(chat, user, _payload); } return(true); } } catch (Exception e) { VkApi.Core.Log.Error(e.ToString()); } } return(false); }