Skip to content

Commit

Permalink
Merge pull request #257 from DinoLeung/develop
Browse files Browse the repository at this point in the history
API 6.8
  • Loading branch information
DinoLeung authored Aug 29, 2023
2 parents 4708f9a + 85d0623 commit 38a8054
Show file tree
Hide file tree
Showing 53 changed files with 1,825 additions and 354 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 0.6.0

- Support API 6.5, 6.6, 6.7, 6.8
- Updated method `sendMediaGroup` and `editMessageMedia` to dynamically upload media with multipart post
- Added factory `InputMedia.fromFile` which accepts parameter `media` in type `io.File`
- Added class `InputMediaWithThumbnail` what implements `InputMedia` and factories `withThumbnailFile` and `fromFileWithThumbnailFile`
- **Breaking** Replaced the fields `can_send_media_messages` in the classes [ChatMemberRestricted] and [ChatPermissions] with separate fields `can_send_audios`, `can_send_documents`, `can_send_photos`, `can_send_videos`, `can_send_video_notes`, and `can_send_voice_notes` for different media types
- **Breaking** Renamed the field `thumb` in the classes [Animation], [Audio], [Document], [Sticker], [Video], [VideoNote], [InputMediaAnimation], [InputMediaAudio], [InputMediaDocument], [InputMediaVideo], [StickerSet] to `thumbnail`
- **Breaking** Renamed the parameter `thumb` in the methods [sendAnimation], [sendAudio], [sendDocument], [sendVideo], [sendVideoNote] to `thumbnail`
- **Breaking** Renamed the method `setStickerSetThumb` to `setStickerSetThumbnail` and its parameter `thumb` to `thumbnail`
- **Breaking** Renamed the fields `thumb_url`, `thumb_width`, and `thumb_height` in the classes [InlineQueryResultArticle], [InlineQueryResultContact], [InlineQueryResultDocument], [InlineQueryResultLocation], and [InlineQueryResultVenue] to `thumbnail_url`, `thumbnail_width`, and `thumbnail_height` respectively
- **Breaking** Renamed the field `thumb_url` in the classes [InlineQueryResultPhoto] and [InlineQueryResultVideo] to `thumbnail_url`
- **Breaking** Renamed the fields `thumb_url` and `thumb_mime_type` in the classes [InlineQueryResultGif], and [InlineQueryResultMpeg4Gif] to `thumbnail_url` and `thumbnail_mime_type` respectively.

## 0.5.6

- Export util classes, so users can catch http client exceptions
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ A clean implementation of [Telegram bot API](https://core.telegram.org/bots/api)

![TeleDart](https://raw.githubusercontent.com/DinoLeung/TeleDart/master/example/dash_paper_plane.svg?sanitize=true)

[![Bot API Version](https://img.shields.io/badge/Bot%20API-6.4-blue.svg?style=flat-square)](https://core.telegram.org/bots/api)
[![Dart Version](https://img.shields.io/badge/Dart-2.18-blue.svg?style=flat-square)](https://dart.dev)
[![Bot API Version](https://img.shields.io/badge/Bot%20API-6.8-blue.svg?style=flat-square)](https://core.telegram.org/bots/api)
[![Dart Version](https://img.shields.io/badge/Dart-3.1-blue.svg?style=flat-square)](https://dart.dev)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg?style=flat-square)](https://www.gnu.org/licenses/gpl-3.0)

[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=DinoLeung&repo=TeleDart)](https://github.com/DinoLeung/TeleDart)
Expand Down
17 changes: 9 additions & 8 deletions lib/src/teledart/model/inline_query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ class TeleDartInlineQuery extends InlineQuery {
int? cacheTime,
bool? isPersonal,
String? nextOffset,
String? switchPmText,
String? switchPmParameter,
InlineQueryResultsButton? button,
}) =>
_teledart.answerInlineQuery(id, results,
cacheTime: cacheTime,
isPersonal: isPersonal,
nextOffset: nextOffset,
switchPmText: switchPmText,
switchPmParameter: switchPmParameter);
_teledart.answerInlineQuery(
id,
results,
cacheTime: cacheTime,
isPersonal: isPersonal,
nextOffset: nextOffset,
button: button,
);
}
23 changes: 13 additions & 10 deletions lib/src/teledart/model/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class TeleDartMessage extends Message {
document: message.document,
photo: message.photo,
sticker: message.sticker,
story: message.story,
video: message.video,
videoNote: message.videoNote,
voice: message.voice,
Expand All @@ -88,6 +89,8 @@ class TeleDartMessage extends Message {
pinnedMessage: message.pinnedMessage,
invoice: message.invoice,
successfulPayment: message.successfulPayment,
userShared: message.userShared,
chatShared: message.chatShared,
connectedWebsite: message.connectedWebsite,
writeAccessAllowed: message.writeAccessAllowed,
passportData: message.passportData,
Expand Down Expand Up @@ -190,7 +193,7 @@ class TeleDartMessage extends Message {
int? duration,
String? performer,
String? title,
dynamic thumb,
dynamic thumbnail,
bool? disableNotification,
bool? allowSendingWithoutReply,
ReplyMarkup? replyMarkup,
Expand All @@ -203,7 +206,7 @@ class TeleDartMessage extends Message {
duration: duration,
performer: performer,
title: title,
thumb: thumb,
thumbnail: thumbnail,
disableNotification: disableNotification,
replyToMessageId: withQuote ? messageId : null,
allowSendingWithoutReply: allowSendingWithoutReply,
Expand All @@ -223,7 +226,7 @@ class TeleDartMessage extends Message {
Future<Message> replyDocument(
dynamic document, {
bool withQuote = false,
dynamic thumb,
dynamic thumbnail,
String? caption,
String? parseMode,
List<MessageEntity>? captionEntities,
Expand All @@ -233,7 +236,7 @@ class TeleDartMessage extends Message {
}) =>
_teledart.sendDocument(chat.id, document,
messageThreadId: messageThreadId,
thumb: thumb,
thumbnail: thumbnail,
caption: caption,
parseMode: parseMode,
captionEntities: captionEntities,
Expand All @@ -259,7 +262,7 @@ class TeleDartMessage extends Message {
int? duration,
int? width,
int? height,
dynamic thumb,
dynamic thumbnail,
String? caption,
String? parseMode,
List<MessageEntity>? captionEntities,
Expand All @@ -274,7 +277,7 @@ class TeleDartMessage extends Message {
duration: duration,
width: width,
height: height,
thumb: thumb,
thumbnail: thumbnail,
caption: caption,
parseMode: parseMode,
captionEntities: captionEntities,
Expand Down Expand Up @@ -302,7 +305,7 @@ class TeleDartMessage extends Message {
int? duration,
int? width,
int? height,
dynamic thumb,
dynamic thumbnail,
String? caption,
String? parseMode,
List<MessageEntity>? captionEntities,
Expand All @@ -316,7 +319,7 @@ class TeleDartMessage extends Message {
duration: duration,
width: width,
height: height,
thumb: thumb,
thumbnail: thumbnail,
caption: caption,
parseMode: parseMode,
captionEntities: captionEntities,
Expand Down Expand Up @@ -373,7 +376,7 @@ class TeleDartMessage extends Message {
bool withQuote = false,
int? duration,
int? length,
dynamic thumb,
dynamic thumbnail,
bool? disableNotification,
bool? allowSendingWithoutReply,
ReplyMarkup? replyMarkup,
Expand All @@ -382,7 +385,7 @@ class TeleDartMessage extends Message {
messageThreadId: messageThreadId,
duration: duration,
length: length,
thumb: thumb,
thumbnail: thumbnail,
disableNotification: disableNotification,
replyToMessageId: withQuote ? messageId : null,
allowSendingWithoutReply: allowSendingWithoutReply,
Expand Down
14 changes: 14 additions & 0 deletions lib/src/telegram/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import 'package:http/http.dart';
import 'package:json_annotation/json_annotation.dart';
import '../util/time_helper.dart';
import 'dart:io' as io;

part 'model.g.dart';

Expand All @@ -32,6 +34,9 @@ part 'models/bot_command_scope_chat.dart';
part 'models/bot_command_scope_default.dart';
part 'models/bot_command_scope.dart';
part 'models/bot_command.dart';
part 'models/bot_description.dart';
part 'models/bot_name.dart';
part 'models/bot_short_description.dart';
part 'models/callback_game.dart';
part 'models/callback_query.dart';
part 'models/chat_administrator_rights.dart';
Expand All @@ -48,6 +53,7 @@ part 'models/chat_member_updated.dart';
part 'models/chat_member.dart';
part 'models/chat_permissions.dart';
part 'models/chat_photo.dart';
part 'models/chat_shared.dart';
part 'models/chat.dart';
part 'models/chosen_inline_result.dart';
part 'models/contact.dart';
Expand Down Expand Up @@ -89,6 +95,7 @@ part 'models/inline_query_result_venue.dart';
part 'models/inline_query_result_video.dart';
part 'models/inline_query_result_voice.dart';
part 'models/inline_query_result.dart';
part 'models/inline_query_results_button.dart';
part 'models/inline_query.dart';
part 'models/input_contact_message_content.dart';
part 'models/input_invoice_message_content.dart';
Expand All @@ -98,12 +105,16 @@ part 'models/input_media_audio.dart';
part 'models/input_media_document.dart';
part 'models/input_media_photo.dart';
part 'models/input_media_video.dart';
part 'models/input_media_with_thumbnail.dart';
part 'models/input_media.dart';
part 'models/input_message_content.dart';
part 'models/input_sticker.dart';
part 'models/input_text_message_content.dart';
part 'models/input_venue_message_content.dart';
part 'models/invoice.dart';
part 'models/keyboard_button_poll_type.dart';
part 'models/keyboard_button_request_chat.dart';
part 'models/keyboard_button_request_user.dart';
part 'models/keyboard_button.dart';
part 'models/labeled_price.dart';
part 'models/location.dart';
Expand Down Expand Up @@ -147,9 +158,12 @@ part 'models/shipping_option.dart';
part 'models/shipping_query.dart';
part 'models/sticker_set.dart';
part 'models/sticker.dart';
part 'models/story.dart';
part 'models/successful_payment.dart';
part 'models/switch_inline_query_chosen_chat.dart';
part 'models/update.dart';
part 'models/user_profile_photos.dart';
part 'models/user_shared.dart';
part 'models/user.dart';
part 'models/venue.dart';
part 'models/video_note.dart';
Expand Down
Loading

0 comments on commit 38a8054

Please sign in to comment.