-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathTelegramTypes.py
172 lines (147 loc) · 6.52 KB
/
TelegramTypes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
class Message:
def __init__(self, update_id, message_id, from_user_id, from_is_bot, from_first_name, from_username,
chat_id, chat_first_name, chat_username, chat_type, date, edit_date, text, caption, media_group_id,
video, photo, voice, audio, sticker, contact, location, document, animation, video_note):
# general IDs
self.update_id = update_id
self.message_id = message_id
# from section
self.from_id = from_user_id
self.from_is_bot = from_is_bot
self.from_first_name = from_first_name
self.from_username = from_username
# chat section
self.chat_id = chat_id
self.chat_first_name = chat_first_name
self.chat_username = chat_username
self.chat_type = chat_type
# dates and basic context
self.date = date
self.text = text
self.caption = caption
self.edit_date = edit_date
# if the post is part of a media group
self.media_group_id = media_group_id
# medias and attachments
self.video = video
self.photo = photo
self.voice = voice
self.audio = audio
self.sticker = sticker
self.contact = contact
self.location = location
self.document = document
self.animation = animation
self.video_note = video_note
class Sticker:
def __init__(self, width, height, emoji, set_name, is_animated, is_video, sticker_type,
file_id, file_unique_id, file_size, thumbnail_file_id, thumbnail_file_unique_id,
thumbnail_file_size, thumbnail_width, thumbnail_height):
self.width = width
self.height = height
self.emoji = emoji
self.set_name = set_name
self.is_animated = is_animated
self.is_video = is_video
self.sticker_type = sticker_type
self.file_id = file_id
self.file_unique_id = file_unique_id
self.file_size = file_size
self.thumbnail_file_id = thumbnail_file_id
self.thumbnail_file_unique_id = thumbnail_file_unique_id
self.thumbnail_file_size = thumbnail_file_size
self.thumbnail_width = thumbnail_width
self.thumbnail_height = thumbnail_height
class Animation:
def __init__(self, file_name, mime_type, duration, width, height, file_id, file_unique_id,
file_size, thumbnail_file_id, thumbnail_file_unique_id, thumbnail_file_size,
thumbnail_width, thumbnail_height):
self.file_name = file_name
self.mime_type = mime_type
self.duration = duration
self.width = width
self.height = height
self.file_id = file_id
self.file_unique_id = file_unique_id
self.file_size = file_size
self.thumbnail_file_id = thumbnail_file_id
self.thumbnail_file_unique_id = thumbnail_file_unique_id
self.thumbnail_file_size = thumbnail_file_size
self.thumbnail_width = thumbnail_width
self.thumbnail_height = thumbnail_height
class Video:
def __init__(self, duration, width, height, file_name, mime_type, file_id, unique_id, size, thumbnail_file_id,
thumbnail_file_unique_id, thumbnail_file_size, thumbnail_width, thumbnail_height):
self.duration = duration
self.width = width
self.height = height
self.file_name = file_name
self.mime_type = mime_type
self.file_id = file_id
self.unique_id = unique_id
self.video_size = size
self.thumbnail_file_id = thumbnail_file_id
self.thumbnail_file_unique_id = thumbnail_file_unique_id
self.thumbnail_file_size = thumbnail_file_size
self.thumbnail_width = thumbnail_width
self.thumbnail_height = thumbnail_height
class Document:
def __init__(self, file_name, mime_type, file_id, file_unique_id, file_size, thumbnail_file_id,
thumbnail_file_unique_id, thumbnail_file_size, thumbnail_width, thumbnail_height):
self.file_name = file_name
self.mime_type = mime_type
self.file_id = file_id
self.file_unique_id = file_unique_id
self.file_size = file_size
self.thumbnail_file_id = thumbnail_file_id
self.thumbnail_file_unique_id = thumbnail_file_unique_id
self.thumbnail_file_size = thumbnail_file_size
self.thumbnail_width = thumbnail_width
self.thumbnail_height = thumbnail_height
class VideoNote:
def __init__(self, duration, length, file_id, file_unique_id, file_size, thumbnail_file_id,
thumbnail_file_unique_id, thumbnail_file_size, thumbnail_width, thumbnail_height):
self.duration = duration
self.length = length
self.file_id = file_id
self.file_unique_id = file_unique_id
self.file_size = file_size
self.thumbnail_file_id = thumbnail_file_id
self.thumbnail_file_unique_id = thumbnail_file_unique_id
self.thumbnail_file_size = thumbnail_file_size
self.thumbnail_width = thumbnail_width
self.thumbnail_height = thumbnail_height
class Audio:
def __init__(self, duration, file_name, mime_type, file_id, file_unique_id, file_size):
self.duration = duration
self.file_name = file_name
self.mime_type = mime_type
self.file_id = file_id
self.file_unique_id = file_unique_id
self.file_size = file_size
class Photo:
def __init__(self, file_id, file_unique_id, file_size, width, height):
self.file_id = file_id
self.file_unique_id = file_unique_id
self.file_size = file_size
self.width = width
self.height = height
class Voice:
def __init__(self, duration, mime_type, file_id, file_unique_id, file_size):
self.duration = duration
self.mime_type = mime_type
self.file_id = file_id
self.file_unique_id = file_unique_id
self.file_size = file_size
class Contact:
def __init__(self, phone_number, first_name, user_id):
self.phone_number = phone_number
self.first_name = first_name
self.user_id = user_id
class Location:
def __init__(self, latitude, longitude, live_period, heading, horizontal_accuracy):
self.latitude = latitude
self.longitude = longitude
self.live_period = live_period
self.heading = heading
self.horizontal_accuracy = horizontal_accuracy