You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,8 @@
1
-
# Types for the Telegram Bot API[](https://deno.land/x/telegraf_types)
1
+
# Types for the Telegram Bot API
2
2
3
-
[](https://core.telegram.org/bots/api)[](https://npmjs.com/package/@telegraf/types)
3
+
[](https://core.telegram.org/bots/api)[](https://npmjs.com/package/@telegraf/types)
4
4
5
-
This project is a fork of [@KnorpelSenf/typegram](https://github.com/KnorpelSenf/typegram), specialised for Telegraf. Typegram is legacy, and now backported from [@grammyjs/types](https://github.com/grammyjs/types).
6
-
7
-
This fork keeps Telegram Bot API types updated for Telegraf. This project provides TypeScript types for the entire [Telegram Bot API](https://core.telegram.org/bots/api).
5
+
This project keeps Telegram Bot API types updated for Telegraf. This project provides TypeScript types for the entire [Telegram Bot API](https://core.telegram.org/bots/api).
8
6
9
7
It contains zero bytes of executable code.
10
8
@@ -110,4 +108,4 @@ This project is written for Deno and built for Node. Running `npm prepare` runs
110
108
111
109
## Where do the types come from
112
110
113
-
They're handwritten. Typegram was started by [@KnorpelSenf](https://github.com/KnorpelSenf), who eventually used it as a starting point for [the grammYtypes package](https://github.com/grammyjs/types). `@telegraf/types`is based on both packages, and regularly syncs with them and the Bot API.
111
+
They're handwritten. [Typegram](https://github.com/KnorpelSenf/typegram) was started by [@KnorpelSenf](https://github.com/KnorpelSenf), who eventually used it as a starting point for grammY's [types](https://github.com/grammyjs/types) package. `@telegraf/types`started as a fork of Typegram, specialised for Telegraf. It is now independently maintained and updated from the Bot API directly.
/** Describes a regular gift owned by a user or a chat. */
1104
+
exportinterfaceOwnedGiftRegular{
1105
+
/** Type of the gift, always “regular” */
1106
+
type: "regular";
1107
+
/** Information about the regular gift */
1108
+
gift: Gift;
1109
+
/** Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only */
1110
+
owned_gift_id?: string;
1111
+
/** Sender of the gift if it is a known user */
1112
+
sender_user?: User;
1113
+
/** Date the gift was sent in Unix time */
1114
+
send_date: number;
1115
+
/** Text of the message that was added to the gift */
1116
+
text?: string;
1117
+
/** Special entities that appear in the text */
1118
+
entities?: MessageEntity[];
1119
+
/** True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */
1120
+
is_private?: boolean;
1121
+
/** True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only */
1122
+
is_saved?: boolean;
1123
+
/** True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only */
1124
+
can_be_upgraded?: boolean;
1125
+
/** True, if the gift was refunded and isn't available anymore */
1126
+
was_refunded?: boolean;
1127
+
/** Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars */
1128
+
convert_star_count?: number;
1129
+
/** Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift */
1130
+
prepaid_upgrade_star_count?: number;
1131
+
}
1132
+
1133
+
/** Describes a unique gift received and owned by a user or a chat. */
1134
+
exportinterfaceOwnedGiftUnique{
1135
+
/** Type of the gift, always “unique” */
1136
+
type: "unique";
1137
+
/** Information about the unique gift */
1138
+
gift: UniqueGift;
1139
+
/** Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only */
1140
+
owned_gift_id?: string;
1141
+
/** Sender of the gift if it is a known user */
1142
+
sender_user?: User;
1143
+
/** Date the gift was sent in Unix time */
1144
+
send_date: number;
1145
+
/** True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only */
1146
+
is_saved?: boolean;
1147
+
/** True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only */
1148
+
can_be_transferred?: boolean;
1149
+
/** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
1150
+
transfer_star_count?: number;
1151
+
}
1152
+
1153
+
/** Contains the list of gifts received and owned by a user or a chat. */
1154
+
exportinterfaceOwnedGifts{
1155
+
/** The total number of gifts owned by the user or the chat */
1156
+
total_count: number;
1157
+
/** The list of gifts */
1158
+
gifts: OwnedGift[];
1159
+
/** Offset for the next request. If empty, then there are no more results */
1160
+
next_offset?: string;
1161
+
}
1162
+
1163
+
/** This object describes the types of gifts that can be gifted to a user or a chat. */
1164
+
exportinterfaceAcceptedGiftTypes{
1165
+
/** True, if unlimited regular gifts are accepted */
1166
+
unlimited_gifts: boolean;
1167
+
/** True, if limited regular gifts are accepted */
1168
+
limited_gifts: boolean;
1169
+
/** True, if unique gifts or gifts that can be upgraded to unique for free are accepted */
1170
+
unique_gifts: boolean;
1171
+
/** True, if a Telegram Premium subscription is accepted */
1172
+
premium_subscription: boolean;
1173
+
}
1174
+
1175
+
/** Describes an amount of Telegram Stars. */
1176
+
exportinterfaceStarAmount{
1177
+
/** Integer amount of Telegram Stars, rounded to 0; can be negative */
1178
+
amount: number;
1179
+
/** Optional. The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive */
0 commit comments