Updated ForceReply

This commit is contained in:
netkas 2024-10-07 15:41:23 -04:00
parent 458ebac946
commit b132c2c982

View file

@ -21,6 +21,18 @@
return $this->force_reply;
}
/**
* Sets the force reply
*
* @param bool $force_reply
* @return ForceReply
*/
public function setForceReply(bool $force_reply): ForceReply
{
$this->force_reply = $force_reply;
return $this;
}
/**
* Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters
*
@ -31,6 +43,18 @@
return $this->inline_field_placeholder;
}
/**
* Sets the placeholder to be shown in the input field when the reply is active; 1-64 characters
*
* @param string|null $inline_field_placeholder
* @return ForceReply
*/
public function setInlineFieldPlaceholder(?string $inline_field_placeholder): ForceReply
{
$this->inline_field_placeholder = $inline_field_placeholder;
return $this;
}
/**
* Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are
* @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id),
@ -43,16 +67,34 @@
return $this->selective;
}
/**
* Sets the selective
*
* @param bool $selective
* @return ForceReply
*/
public function setSelective(bool $selective): ForceReply
{
$this->selective = $selective;
return $this;
}
/**
* @inheritDoc
*/
public function toArray(): array
{
return [
$array = [
'force_reply' => $this->force_reply,
'inline_field_placeholder' => $this->inline_field_placeholder,
'selective' => $this->selective,
];
if($this->inline_field_placeholder !== null)
{
$array['inline_field_placeholder'] = $this->inline_field_placeholder;
}
return $array;
}
/**