botapi-py 1.5.0__tar.gz → 1.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: botapi-py
3
- Version: 1.5.0
3
+ Version: 1.5.1
4
4
  Summary: A simple and flexible Python library to conveniently build fast Telegram bots using the Bot API.
5
5
  Requires-Dist: httpx>=0.28.1
6
6
  Requires-Dist: pydantic>=2.12.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "botapi-py"
3
- version = "1.5.0"
3
+ version = "1.5.1"
4
4
  description = "A simple and flexible Python library to conveniently build fast Telegram bots using the Bot API."
5
5
  # readme = "README.md"
6
6
  # authors = [
@@ -60,20 +60,6 @@ class MediaType(enum.StrEnum):
60
60
  STORY = 'story' # does not have `file_id`, only `id`
61
61
  PAID_MEDIA = 'paid_media' # this contains a `photo` attribute that is a list of `PhotoSize` objects
62
62
 
63
- SendMediaGroupValidMediaTypes = Union[
64
- MediaType.AUDIO,
65
- MediaType.DOCUMENT,
66
- MediaType.PHOTO,
67
- MediaType.VIDEO,
68
- ]
69
- '''
70
- Valid media types you can use with the `send_media_group` method.
71
-
72
- This is a subset of `MediaType`.
73
-
74
- Source: https://core.telegram.org/bots/api#sendmediagroup
75
- '''
76
-
77
63
  class ServiceMessage(enum.StrEnum):
78
64
  '''
79
65
  Subset of `MessageType`.
@@ -325,7 +325,7 @@ class Methods(core.BaseBot):
325
325
  offset: Optional[int] = None,
326
326
  limit: Optional[int] = None,
327
327
  timeout: Optional[int] = None,
328
- allowed_updates: Optional[List[Union[str, enums.UpdateType]]] = None,
328
+ allowed_updates: Optional[Union[List[str], List[enums.UpdateType]]] = None,
329
329
  ) -> List[Update]:
330
330
  '''
331
331
  Use this method to receive incoming updates using
@@ -349,7 +349,7 @@ class Methods(core.BaseBot):
349
349
  certificate: Optional[InputFile] = None,
350
350
  ip_address: Optional[str] = None,
351
351
  max_connections: Optional[int] = None,
352
- allowed_updates: Optional[List[Union[str, enums.UpdateType]]] = None,
352
+ allowed_updates: Optional[Union[List[str], List[enums.UpdateType]]] = None,
353
353
  drop_pending_updates: Optional[bool] = None,
354
354
  secret_token: Optional[str] = None,
355
355
  ) -> bool:
@@ -4607,10 +4607,31 @@ class GameHighScore(BaseModel):
4607
4607
  user: User
4608
4608
  score: int
4609
4609
 
4610
+
4610
4611
  # Raw Python type adapters
4611
4612
  IntAdapter = TypeAdapter[int](int)
4612
4613
  StrAdapter = TypeAdapter[str](str)
4613
4614
  FloatAdapter = TypeAdapter[float](float)
4614
4615
  BoolAdapter = TypeAdapter[bool](bool)
4615
4616
 
4616
- MediaTypeUnion = Union[Animation, Audio, Document, List[PhotoSize], Sticker, Video, VideoNote, Voice, Story, PaidMedia]
4617
+ # Convenience manually-generated Unions & Type Adapters
4618
+ MediaTypeUnion = Union[
4619
+ Animation,
4620
+ Audio,
4621
+ Document,
4622
+ List[PhotoSize],
4623
+ Sticker,
4624
+ Video,
4625
+ VideoNote,
4626
+ Voice,
4627
+ Story,
4628
+ PaidMedia
4629
+ ]
4630
+
4631
+ _InputMediaGroupTypes = Union[
4632
+ InputMediaAudio,
4633
+ InputMediaDocument,
4634
+ InputMediaPhoto,
4635
+ InputMediaVideo,
4636
+ ]
4637
+ InputMediaGroupTypeAdapter = TypeAdapter[_InputMediaGroupTypes](_InputMediaGroupTypes)
File without changes
File without changes