-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update code to reflect latest changes to the Bot API documentation
- Loading branch information
Showing
6 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
/** | ||
* This file is auto-generated. | ||
*/ | ||
|
||
namespace Telepath\Telegram; | ||
|
||
use Telepath\Types\Type; | ||
|
||
/** | ||
* Contains information about the affiliate that received a commission via this transaction. | ||
*/ | ||
class AffiliateInfo extends Type | ||
{ | ||
/** The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users */ | ||
public int $commission_per_mille; | ||
|
||
/** Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds */ | ||
public int $amount; | ||
|
||
/** <em>Optional</em>. The bot or the user that received an affiliate commission if it was received by a bot or a user */ | ||
public ?User $affiliate_user = null; | ||
|
||
/** <em>Optional</em>. The chat that received an affiliate commission if it was received by a chat */ | ||
public ?Chat $affiliate_chat = null; | ||
|
||
/** <em>Optional</em>. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds */ | ||
public ?int $nanostar_amount = null; | ||
|
||
/** | ||
* @param int $commission_per_mille The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users | ||
* @param int $amount Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds | ||
* @param User $affiliate_user <em>Optional</em>. The bot or the user that received an affiliate commission if it was received by a bot or a user | ||
* @param Chat $affiliate_chat <em>Optional</em>. The chat that received an affiliate commission if it was received by a chat | ||
* @param int $nanostar_amount <em>Optional</em>. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds | ||
*/ | ||
public static function make( | ||
int $commission_per_mille, | ||
int $amount, | ||
?User $affiliate_user = null, | ||
?Chat $affiliate_chat = null, | ||
?int $nanostar_amount = null, | ||
): static { | ||
return new static([ | ||
'commission_per_mille' => $commission_per_mille, | ||
'amount' => $amount, | ||
'affiliate_user' => $affiliate_user, | ||
'affiliate_chat' => $affiliate_chat, | ||
'nanostar_amount' => $nanostar_amount, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/** | ||
* This file is auto-generated. | ||
*/ | ||
|
||
namespace Telepath\Telegram; | ||
|
||
/** | ||
* Describes the affiliate program that issued the affiliate commission received via this transaction. | ||
*/ | ||
class TransactionPartnerAffiliateProgram extends TransactionPartner | ||
{ | ||
/** Type of the transaction partner, always “affiliate_program” */ | ||
public string $type = 'affiliate_program'; | ||
|
||
/** The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users */ | ||
public int $commission_per_mille; | ||
|
||
/** <em>Optional</em>. Information about the bot that sponsored the affiliate program */ | ||
public ?User $sponsor_user = null; | ||
|
||
/** | ||
* @param int $commission_per_mille The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users | ||
* @param User $sponsor_user <em>Optional</em>. Information about the bot that sponsored the affiliate program | ||
*/ | ||
public static function make(int $commission_per_mille, ?User $sponsor_user = null): static | ||
{ | ||
return new static([ | ||
'commission_per_mille' => $commission_per_mille, | ||
'sponsor_user' => $sponsor_user, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters