@@ -157,7 +157,7 @@ trait Methods {
157
157
* Required if ok is True. A JSON-serialized array of available shipping options.
158
158
* @param errorMessage
159
159
* Required if ok is False. Error message in human readable form that explains why it is impossible to complete the
160
- * order (e.g. " Sorry, delivery to your desired address is unavailable' ). Telegram will display this message to the
160
+ * order (e.g. “ Sorry, delivery to your desired address is unavailable” ). Telegram will display this message to the
161
161
* user.
162
162
*/
163
163
def answerShippingQuery (
@@ -290,6 +290,8 @@ trait Methods {
290
290
* Message identifier in the chat specified in from_chat_id
291
291
* @param messageThreadId
292
292
* Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
293
+ * @param videoStartTimestamp
294
+ * New start timestamp for the copied video in the message
293
295
* @param caption
294
296
* New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
295
297
* @param parseMode
@@ -317,6 +319,7 @@ trait Methods {
317
319
fromChatId : ChatId ,
318
320
messageId : Int ,
319
321
messageThreadId : Option [Int ] = Option .empty,
322
+ videoStartTimestamp : Option [Int ] = Option .empty,
320
323
caption : Option [String ] = Option .empty,
321
324
parseMode : Option [ParseMode ] = Option .empty,
322
325
captionEntities : List [MessageEntity ] = List .empty,
@@ -332,6 +335,7 @@ trait Methods {
332
335
fromChatId,
333
336
messageId,
334
337
messageThreadId,
338
+ videoStartTimestamp,
335
339
caption,
336
340
parseMode,
337
341
captionEntities,
@@ -1103,6 +1107,8 @@ trait Methods {
1103
1107
* Message identifier in the chat specified in from_chat_id
1104
1108
* @param messageThreadId
1105
1109
* Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
1110
+ * @param videoStartTimestamp
1111
+ * New start timestamp for the forwarded video in the message
1106
1112
* @param disableNotification
1107
1113
* Sends the message silently. Users will receive a notification with no sound.
1108
1114
* @param protectContent
@@ -1113,10 +1119,19 @@ trait Methods {
1113
1119
fromChatId : ChatId ,
1114
1120
messageId : Int ,
1115
1121
messageThreadId : Option [Int ] = Option .empty,
1122
+ videoStartTimestamp : Option [Int ] = Option .empty,
1116
1123
disableNotification : Option [Boolean ] = Option .empty,
1117
1124
protectContent : Option [Boolean ] = Option .empty
1118
1125
): Method [Message ] = {
1119
- val req = ForwardMessageReq (chatId, fromChatId, messageId, messageThreadId, disableNotification, protectContent)
1126
+ val req = ForwardMessageReq (
1127
+ chatId,
1128
+ fromChatId,
1129
+ messageId,
1130
+ messageThreadId,
1131
+ videoStartTimestamp,
1132
+ disableNotification,
1133
+ protectContent
1134
+ )
1120
1135
MethodReq [Message ](" forwardMessage" , req.asJson)
1121
1136
}
1122
1137
@@ -1151,7 +1166,8 @@ trait Methods {
1151
1166
MethodReq [List [MessageId ]](" forwardMessages" , req.asJson)
1152
1167
}
1153
1168
1154
- /** Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object.
1169
+ /** Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns
1170
+ * a Gifts object.
1155
1171
*/
1156
1172
def getAvailableGifts (): Method [Gifts ] = {
1157
1173
val req = GetAvailableGiftsReq
@@ -2220,17 +2236,20 @@ trait Methods {
2220
2236
MethodReq [Message ](" sendGame" , req.asJson)
2221
2237
}
2222
2238
2223
- /** Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on
2224
- * success.
2239
+ /** Sends a gift to the given user or channel chat . The gift can't be converted to Telegram Stars by the receiver.
2240
+ * Returns True on success.
2225
2241
*
2226
- * @param userId
2227
- * Unique identifier of the target user that will receive the gift
2228
2242
* @param giftId
2229
2243
* Identifier of the gift
2244
+ * @param userId
2245
+ * Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.
2246
+ * @param chatId
2247
+ * Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format
2248
+ * @channelusername) that will receive the gift.
2230
2249
* @param payForUpgrade
2231
2250
* Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
2232
2251
* @param text
2233
- * Text that will be shown along with the gift; 0-255 characters
2252
+ * Text that will be shown along with the gift; 0-128 characters
2234
2253
* @param textParseMode
2235
2254
* Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”,
2236
2255
* “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
@@ -2240,14 +2259,15 @@ trait Methods {
2240
2259
* “custom_emoji” are ignored.
2241
2260
*/
2242
2261
def sendGift (
2243
- userId : Long ,
2244
2262
giftId : String ,
2263
+ userId : Option [Long ] = Option .empty,
2264
+ chatId : Option [ChatId ] = Option .empty,
2245
2265
payForUpgrade : Option [Boolean ] = Option .empty,
2246
2266
text : Option [String ] = Option .empty,
2247
2267
textParseMode : Option [ParseMode ] = Option .empty,
2248
2268
textEntities : List [MessageEntity ] = List .empty
2249
2269
): Method [Boolean ] = {
2250
- val req = SendGiftReq (userId, giftId , payForUpgrade, text, textParseMode, textEntities)
2270
+ val req = SendGiftReq (giftId, userId, chatId , payForUpgrade, text, textParseMode, textEntities)
2251
2271
MethodReq [Boolean ](" sendGift" , req.asJson)
2252
2272
}
2253
2273
@@ -3007,6 +3027,12 @@ trait Methods {
3007
3027
* exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be
3008
3028
* only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using
3009
3029
* multipart/form-data under <file_attach_name>.
3030
+ * @param cover
3031
+ * Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers
3032
+ * (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass
3033
+ * “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name.
3034
+ * @param startTimestamp
3035
+ * Start timestamp for the video in the message
3010
3036
* @param caption
3011
3037
* Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
3012
3038
* @param parseMode
@@ -3044,6 +3070,8 @@ trait Methods {
3044
3070
width : Option [Int ] = Option .empty,
3045
3071
height : Option [Int ] = Option .empty,
3046
3072
thumbnail : Option [IFile ] = Option .empty,
3073
+ cover : Option [IFile ] = Option .empty,
3074
+ startTimestamp : Option [Int ] = Option .empty,
3047
3075
caption : Option [String ] = Option .empty,
3048
3076
parseMode : Option [ParseMode ] = Option .empty,
3049
3077
captionEntities : List [MessageEntity ] = List .empty,
@@ -3066,6 +3094,8 @@ trait Methods {
3066
3094
width,
3067
3095
height,
3068
3096
thumbnail,
3097
+ cover,
3098
+ startTimestamp,
3069
3099
caption,
3070
3100
parseMode,
3071
3101
captionEntities,
@@ -3082,7 +3112,7 @@ trait Methods {
3082
3112
MethodReq [Message ](
3083
3113
" sendVideo" ,
3084
3114
req.asJson,
3085
- Map (" video" -> Option (video), " thumbnail" -> thumbnail).collect { case (k, Some (v)) => k -> v }
3115
+ Map (" video" -> Option (video), " thumbnail" -> thumbnail, " cover " -> cover ).collect { case (k, Some (v)) => k -> v }
3086
3116
)
3087
3117
}
3088
3118
@@ -3396,9 +3426,9 @@ trait Methods {
3396
3426
MethodReq [Either [Boolean , Message ]](" setGameScore" , req.asJson)
3397
3427
}
3398
3428
3399
- /** Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically
3400
- * forwarded messages from a channel to its discussion group have the same available reactions as messages in the
3401
- * channel. Bots can't use paid reactions. Returns True on success.
3429
+ /** Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to.
3430
+ * Automatically forwarded messages from a channel to its discussion group have the same available reactions as
3431
+ * messages in the channel. Bots can't use paid reactions. Returns True on success.
3402
3432
*
3403
3433
* @param chatId
3404
3434
* Unique identifier for the target chat or username of the target channel (in the format @channelusername)
0 commit comments