internal static CallbackData ToCallbackData(this MessageRequestPayload payload) { return(new CallbackData { UserId = payload.User.Id, ResponseUrl = payload.ResponseUrl }); }
public async Task JoinRunAsync(MessageRequestPayload requestPayload) { var user = await GetOrCreateUser(requestPayload.User.Id, requestPayload.User.Name).ConfigureAwait(false); var room = await GetOrCreateRoom(requestPayload.Channel.Id, requestPayload.Channel.Name, user.Id).ConfigureAwait(false); var firstAction = requestPayload.Actions.First(); var optionId = long.Parse(firstAction.Value); await JoinRunAsync(user.Id, room.Id, optionId, requestPayload.ToCallbackData()).ConfigureAwait(false); }