Skip to content

Commit 5a33cff

Browse files
committed
add value parameter to createBotField method
1 parent 21207bf commit 5a33cff

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Structure/Fb/Page.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,21 +244,27 @@ public function getBotFields(): array
244244
*
245245
* @param string $name Bot field name
246246
* @param string $type Bot field type
247-
* @param string $description Description of the bot field
247+
* @param string|null $description Description of the bot field
248+
* @param string|int|null $value Bot field value
248249
*
249250
* @return array The resulting array that was received from ManyChat API
250251
* @throws CallMethodNotSucceedException If the result of calling method didn't succeed
251252
* @see https://api.manychat.com/swagger#/Page/post_fb_page_createBotField Documentation
252253
* of /fb/page/createBotField method at manychat.com.
253254
*
254255
*/
255-
public function createBotField(string $name, string $type, string $description): array
256+
public function createBotField(string $name, string $type, ?string $description = null, $value = null): array
256257
{
257258
$arguments = [
258259
'name' => $name,
259260
'type' => $type,
260-
'description' => $description,
261261
];
262+
if (null !== $description) {
263+
$arguments['description'] = $description;
264+
}
265+
if (null !== $value) {
266+
$arguments['value'] = $value;
267+
}
262268
$methodName = $this->getMethodAddress(__FUNCTION__);
263269

264270
return $this->getApi()->callMethod($methodName, $arguments, Request::POST);

0 commit comments

Comments
 (0)