Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing types #961

Merged
merged 1 commit into from Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/Objects/ChatInviteLink.php
@@ -0,0 +1,30 @@
<?php

namespace Telegram\Bot\Objects;

/**
* Class ChatInviteLink.
*
*
* @property string $invite_link The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.
* @property User $creator Creator of the link.
* @property bool $creates_join_request True, if users joining the chat via the link need to be approved by chat administrators.
* @property bool $is_primary True, if the link is primary.
* @property bool $is_revoked True, if the link is revoked.
* @property string|null $name Optional. Invite link name.
* @property int|null $expire_date Optional. Point in time (Unix timestamp) when the link will expire or has been expired.
* @property int|null $member_limit Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999.
* @property int|null $pending_join_request_count Optional. Number of pending join requests created using this link.
*/
class ChatInviteLink extends BaseObject
{
/**
* {@inheritdoc}
*/
public function relations()
{
return [
'creator' => User::class,
];
}
}
28 changes: 28 additions & 0 deletions src/Objects/ChatJoinRequest.php
@@ -0,0 +1,28 @@
<?php

namespace Telegram\Bot\Objects;

/**
* Class ChatJoinRequest.
*
*
* @property Chat $chat Chat to which the request was sent.
* @property User $from User that sent the join request.
* @property int $date Date the request was sent in Unix time.
* @property string|null $bio Optional. Bio of the user.
* @property ChatInviteLink|null $invite_link Optional. Chat invite link that was used by the user to send the join request.
*/
class ChatJoinRequest extends BaseObject
{
/**
* {@inheritdoc}
*/
public function relations()
{
return [
'chat' => Chat::class,
'from' => User::class,
'invite_link' => ChatInviteLink::class,
];
}
}
31 changes: 31 additions & 0 deletions src/Objects/ChatMemberUpdated.php
@@ -0,0 +1,31 @@
<?php

namespace Telegram\Bot\Objects;

/**
* Class ChatMemberUpdated.
*
*
* @property Chat $chat Chat the user belongs to.
* @property User $from Performer of the action, which resulted in the change.
* @property int $date Date the change was done in Unix time.
* @property ChatMember $old_chat_member Previous information about the chat member.
* @property ChatMember $new_chat_member Previous information about the chat member.
* @property ChatInviteLink|null $invite_link Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
*/
class ChatMemberUpdated extends BaseObject
{
/**
* {@inheritdoc}
*/
public function relations()
{
return [
'chat' => Chat::class,
'from' => User::class,
'old_chat_member' => ChatMember::class,
'new_chat_member' => ChatMember::class,
'invite_link' => ChatInviteLink::class,
];
}
}
24 changes: 24 additions & 0 deletions src/Objects/PollAnswer.php
@@ -0,0 +1,24 @@
<?php

namespace Telegram\Bot\Objects;

/**
* Class PollAnswer.
*
*
* @property string $poll_id Unique poll identifier.
* @property User $user The user, who changed the answer to the poll.
* @property array $option_ids 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
*/
class PollAnswer extends BaseObject
{
/**
* {@inheritdoc}
*/
public function relations()
{
return [
'user' => User::class,
];
}
}
4 changes: 4 additions & 0 deletions src/Objects/Update.php
Expand Up @@ -97,6 +97,10 @@ public function detectType()
'shipping_query',
'pre_checkout_query',
'poll',
'poll_answer',
'my_chat_member',
'chat_member',
'chat_join_request',
];

return $this->keys()
Expand Down