Skip to content

Commit

Permalink
Added new objects / methods of API v8
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirmukhsin Khamroev committed Jan 15, 2025
1 parent e7713e4 commit 071a561
Show file tree
Hide file tree
Showing 226 changed files with 2,276 additions and 474 deletions.
381 changes: 270 additions & 111 deletions src/Methods/Methods.php

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions src/Types/AffiliateInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

namespace Milly\Laragram\Types;

/**
* AffiliateInfo
*
*<p>*Optional*. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds</p>
*
* @author Mirmuxsin Khamroev (https://github.com/Mirmuxsin)
* @url https://core.telegram.org/bots/api/#affiliateinfo
*/
class AffiliateInfo
{
/**
* <p>*Optional*. The bot or the user that received an affiliate commission if it was received by a bot or a user</p>
* @var User|null
*/
public ?User $affiliate_user = null;

/**
* <p>*Optional*. The chat that received an affiliate commission if it was received by a chat</p>
* @var Chat|null
*/
public ?Chat $affiliate_chat = null;

/**
* <p>The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users</p>
* @var int
*/
public int $commission_per_mille;

/**
* <p>Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds</p>
* @var int
*/
public int $amount;

/**
* <p>*Optional*. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds</p>
* @var int|null
*/
public ?int $nanostar_amount = null;



public function __construct($data)
{
if (isset($data['affiliate_user'])){
$this->affiliate_user = new User($data['affiliate_user']);
}

if (isset($data['affiliate_chat'])){
$this->affiliate_chat = new Chat($data['affiliate_chat']);
}

$this->commission_per_mille = $data['commission_per_mille'];
$this->amount = $data['amount'];
if (isset($data['nanostar_amount'])){
$this->nanostar_amount = $data['nanostar_amount'];
}

}
}
13 changes: 6 additions & 7 deletions src/Types/Animation.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* Animation
*
Expand All @@ -26,37 +25,37 @@ class Animation
public string $file_unique_id;

/**
* <p>Video width as defined by sender</p>
* <p>Video width as defined by the sender</p>
* @var int
*/
public int $width;

/**
* <p>Video height as defined by sender</p>
* <p>Video height as defined by the sender</p>
* @var int
*/
public int $height;

/**
* <p>Duration of the video in seconds as defined by sender</p>
* <p>Duration of the video in seconds as defined by the sender</p>
* @var int
*/
public int $duration;

/**
* <p>*Optional*. Animation thumbnail as defined by sender</p>
* <p>*Optional*. Animation thumbnail as defined by the sender</p>
* @var PhotoSize|null
*/
public ?PhotoSize $thumbnail = null;

/**
* <p>*Optional*. Original animation filename as defined by sender</p>
* <p>*Optional*. Original animation filename as defined by the sender</p>
* @var string|null
*/
public ?string $file_name = null;

/**
* <p>*Optional*. MIME type of the file as defined by sender</p>
* <p>*Optional*. MIME type of the file as defined by the sender</p>
* @var string|null
*/
public ?string $mime_type = null;
Expand Down
11 changes: 5 additions & 6 deletions src/Types/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* Audio
*
Expand All @@ -26,31 +25,31 @@ class Audio
public string $file_unique_id;

/**
* <p>Duration of the audio in seconds as defined by sender</p>
* <p>Duration of the audio in seconds as defined by the sender</p>
* @var int
*/
public int $duration;

/**
* <p>*Optional*. Performer of the audio as defined by sender or by audio tags</p>
* <p>*Optional*. Performer of the audio as defined by the sender or by audio tags</p>
* @var string|null
*/
public ?string $performer = null;

/**
* <p>*Optional*. Title of the audio as defined by sender or by audio tags</p>
* <p>*Optional*. Title of the audio as defined by the sender or by audio tags</p>
* @var string|null
*/
public ?string $title = null;

/**
* <p>*Optional*. Original filename as defined by sender</p>
* <p>*Optional*. Original filename as defined by the sender</p>
* @var string|null
*/
public ?string $file_name = null;

/**
* <p>*Optional*. MIME type of the file as defined by sender</p>
* <p>*Optional*. MIME type of the file as defined by the sender</p>
* @var string|null
*/
public ?string $mime_type = null;
Expand Down
30 changes: 30 additions & 0 deletions src/Types/BackgroundFill.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Milly\Laragram\Types;

/**
* BackgroundFill
*
*
* @author Mirmuxsin Khamroev (https://github.com/Mirmuxsin)
* @url https://core.telegram.org/bots/api/#backgroundfill
*/
class BackgroundFill
{


public BackgroundFillSolid $backgroundFillSolid;

public BackgroundFillGradient $backgroundFillGradient;

public BackgroundFillFreeformGradient $backgroundFillFreeformGradient;



public function __construct($data)
{
$this->backgroundFillSolid = new BackgroundFillSolid($data);
$this->backgroundFillGradient = new BackgroundFillGradient($data);
$this->backgroundFillFreeformGradient = new BackgroundFillFreeformGradient($data);
}
}
1 change: 0 additions & 1 deletion src/Types/BackgroundFillFreeformGradient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BackgroundFillFreeformGradient
*
Expand Down
1 change: 0 additions & 1 deletion src/Types/BackgroundFillGradient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BackgroundFillGradient
*
Expand Down
1 change: 0 additions & 1 deletion src/Types/BackgroundFillSolid.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BackgroundFillSolid
*
Expand Down
33 changes: 33 additions & 0 deletions src/Types/BackgroundType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Milly\Laragram\Types;

/**
* BackgroundType
*
*
* @author Mirmuxsin Khamroev (https://github.com/Mirmuxsin)
* @url https://core.telegram.org/bots/api/#backgroundtype
*/
class BackgroundType
{


public BackgroundTypeFill $backgroundTypeFill;

public BackgroundTypeWallpaper $backgroundTypeWallpaper;

public BackgroundTypePattern $backgroundTypePattern;

public BackgroundTypeChatTheme $backgroundTypeChatTheme;



public function __construct($data)
{
$this->backgroundTypeFill = new BackgroundTypeFill($data);
$this->backgroundTypeWallpaper = new BackgroundTypeWallpaper($data);
$this->backgroundTypePattern = new BackgroundTypePattern($data);
$this->backgroundTypeChatTheme = new BackgroundTypeChatTheme($data);
}
}
1 change: 0 additions & 1 deletion src/Types/BackgroundTypeChatTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BackgroundTypeChatTheme
*
Expand Down
1 change: 0 additions & 1 deletion src/Types/BackgroundTypeFill.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BackgroundTypeFill
*
Expand Down
1 change: 0 additions & 1 deletion src/Types/BackgroundTypePattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BackgroundTypePattern
*
Expand Down
1 change: 0 additions & 1 deletion src/Types/BackgroundTypeWallpaper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BackgroundTypeWallpaper
*
Expand Down
1 change: 0 additions & 1 deletion src/Types/Birthdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* Birthdate
*
Expand Down
1 change: 0 additions & 1 deletion src/Types/BotCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BotCommand
*
Expand Down
42 changes: 42 additions & 0 deletions src/Types/BotCommandScope.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace Milly\Laragram\Types;

/**
* BotCommandScope
*
*
* @author Mirmuxsin Khamroev (https://github.com/Mirmuxsin)
* @url https://core.telegram.org/bots/api/#botcommandscope
*/
class BotCommandScope
{


public BotCommandScopeDefault $botCommandScopeDefault;

public BotCommandScopeAllPrivateChats $botCommandScopeAllPrivateChats;

public BotCommandScopeAllGroupChats $botCommandScopeAllGroupChats;

public BotCommandScopeAllChatAdministrators $botCommandScopeAllChatAdministrators;

public BotCommandScopeChat $botCommandScopeChat;

public BotCommandScopeChatAdministrators $botCommandScopeChatAdministrators;

public BotCommandScopeChatMember $botCommandScopeChatMember;



public function __construct($data)
{
$this->botCommandScopeDefault = new BotCommandScopeDefault($data);
$this->botCommandScopeAllPrivateChats = new BotCommandScopeAllPrivateChats($data);
$this->botCommandScopeAllGroupChats = new BotCommandScopeAllGroupChats($data);
$this->botCommandScopeAllChatAdministrators = new BotCommandScopeAllChatAdministrators($data);
$this->botCommandScopeChat = new BotCommandScopeChat($data);
$this->botCommandScopeChatAdministrators = new BotCommandScopeChatAdministrators($data);
$this->botCommandScopeChatMember = new BotCommandScopeChatMember($data);
}
}
1 change: 0 additions & 1 deletion src/Types/BotCommandScopeAllChatAdministrators.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BotCommandScopeAllChatAdministrators
*
Expand Down
1 change: 0 additions & 1 deletion src/Types/BotCommandScopeAllGroupChats.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BotCommandScopeAllGroupChats
*
Expand Down
1 change: 0 additions & 1 deletion src/Types/BotCommandScopeAllPrivateChats.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BotCommandScopeAllPrivateChats
*
Expand Down
1 change: 0 additions & 1 deletion src/Types/BotCommandScopeChat.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BotCommandScopeChat
*
Expand Down
1 change: 0 additions & 1 deletion src/Types/BotCommandScopeChatAdministrators.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BotCommandScopeChatAdministrators
*
Expand Down
1 change: 0 additions & 1 deletion src/Types/BotCommandScopeChatMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Milly\Laragram\Types;


/**
* BotCommandScopeChatMember
*
Expand Down
Loading

0 comments on commit 071a561

Please sign in to comment.