コード例 #1
0
 internal static CallbackData ToCallbackData(this MessageRequestPayload payload)
 {
     return(new CallbackData
     {
         UserId = payload.User.Id,
         ResponseUrl = payload.ResponseUrl
     });
 }
コード例 #2
0
ファイル: SlackService.cs プロジェクト: tonybaba2007/TeaTime
        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);
        }