Fixes to getting values from buttons

This commit is contained in:
Deon George 2022-08-30 12:01:13 +10:00
parent 9611939c57
commit 80c1768534
1 changed files with 5 additions and 3 deletions

View File

@ -87,11 +87,13 @@ final class BlockActions extends Base
// For app hometab, the callback is in the view->callback_id array.
return object_get($this->_data,sprintf('%s.%s',$this->container_type,$key));
case 'message_attachment':
return NULL;
default:
throw new SlackException('Unknown container type: '.$this->container_type);
}
// @todo See if all responses have a container.type, and if so, put this in base.
case 'container_type':
return object_get($this->_data,'container.type');
@ -113,14 +115,14 @@ final class BlockActions extends Base
case 'value':
switch (object_get($this->action,'type')) {
case 'button':
return object_get($this->action,'text.text');
case 'external_select':
case 'overflow':
case 'static_select':
return object_get($this->action,'selected_option.value');
case 'multi_static_select':
return object_get($this->action,'selected_options.value');
case 'button':
default:
return object_get($this->action,$key);
}