3939ALL_COMMANDS = []
4040
4141
42- def run_command (message : Message , sleep_seconds : int = 10 ):
42+ def run_command (message : Message , sleep_seconds : int = 10 ) -> None :
4343 time .sleep (sleep_seconds )
4444 message .reply_text ("Hello World!" )
4545
4646
4747@log_func (log )
48- def on_start (update : Update , _ : CallbackContext ):
48+ def on_start (update : Update , _ : CallbackContext ) -> None :
4949 update .effective_message .reply_text ("Write something" )
5050
5151
5252@log_func (log )
53- def on_request (update : Update , _ : CallbackContext ):
53+ def on_request (update : Update , _ : CallbackContext ) -> None :
5454 message = update .effective_message
5555
5656 text = "Commands:\n " + "\n " .join (f" /{ x } " for x in ALL_COMMANDS )
5757 message .reply_text (text )
5858
5959
6060@log_func (log )
61- def on_simple (update : Update , _ : CallbackContext ):
61+ def on_simple (update : Update , _ : CallbackContext ) -> None :
6262 message = update .effective_message
6363 run_command (message )
6464
6565
6666@log_func (log )
6767@show_temp_message_decorator ()
68- def on_in_progress (update : Update , _ : CallbackContext ):
68+ def on_in_progress (update : Update , _ : CallbackContext ) -> None :
6969 message = update .effective_message
7070 run_command (message )
7171
7272
7373@log_func (log )
7474@show_temp_message_decorator (text = "Пожалуйста, подождите..." )
75- def on_custom_in_progress (update : Update , _ : CallbackContext ):
75+ def on_custom_in_progress (update : Update , _ : CallbackContext ) -> None :
7676 message = update .effective_message
7777 run_command (message )
7878
@@ -89,7 +89,7 @@ def on_custom_in_progress(update: Update, _: CallbackContext):
8989 )
9090 ),
9191)
92- def on_custom_all_in_progress (update : Update , _ : CallbackContext ):
92+ def on_custom_all_in_progress (update : Update , _ : CallbackContext ) -> None :
9393 message = update .effective_message
9494 run_command (message )
9595
@@ -99,7 +99,7 @@ def on_custom_all_in_progress(update: Update, _: CallbackContext):
9999 text = "Выполняется работа {value}" ,
100100 progress_value = ProgressValue .LINES ,
101101)
102- def on_animation_lines (update : Update , _ : CallbackContext ):
102+ def on_animation_lines (update : Update , _ : CallbackContext ) -> None :
103103 message = update .effective_message
104104 run_command (message )
105105
@@ -109,7 +109,7 @@ def on_animation_lines(update: Update, _: CallbackContext):
109109 text = "Выполняется работа {value}" ,
110110 progress_value = ProgressValue .SPINNER ,
111111)
112- def on_animation_spinner (update : Update , _ : CallbackContext ):
112+ def on_animation_spinner (update : Update , _ : CallbackContext ) -> None :
113113 message = update .effective_message
114114 run_command (message )
115115
@@ -119,7 +119,7 @@ def on_animation_spinner(update: Update, _: CallbackContext):
119119 text = "Please, wait {value}" ,
120120 progress_value = ProgressValue .POINTS ,
121121)
122- def on_animation_points (update : Update , _ : CallbackContext ):
122+ def on_animation_points (update : Update , _ : CallbackContext ) -> None :
123123 message = update .effective_message
124124 run_command (message )
125125
@@ -130,7 +130,7 @@ def on_animation_points(update: Update, _: CallbackContext):
130130 parse_mode = ParseMode .HTML ,
131131 progress_value = ProgressValue .MOON_PHASES_1 ,
132132)
133- def on_animation_moon_phases1 (update : Update , _ : CallbackContext ):
133+ def on_animation_moon_phases1 (update : Update , _ : CallbackContext ) -> None :
134134 message = update .effective_message
135135 run_command (message )
136136
@@ -141,7 +141,7 @@ def on_animation_moon_phases1(update: Update, _: CallbackContext):
141141 parse_mode = ParseMode .HTML ,
142142 progress_value = ProgressValue .MOON_PHASES_2 ,
143143)
144- def on_animation_moon_phases2 (update : Update , _ : CallbackContext ):
144+ def on_animation_moon_phases2 (update : Update , _ : CallbackContext ) -> None :
145145 message = update .effective_message
146146 run_command (message )
147147
@@ -151,7 +151,7 @@ def on_animation_moon_phases2(update: Update, _: CallbackContext):
151151 text = "Loading {value}" ,
152152 progress_value = ProgressValue .BLOCKS ,
153153)
154- def on_animation_blocks (update : Update , _ : CallbackContext ):
154+ def on_animation_blocks (update : Update , _ : CallbackContext ) -> None :
155155 message = update .effective_message
156156 run_command (message )
157157
@@ -161,7 +161,7 @@ def on_animation_blocks(update: Update, _: CallbackContext):
161161 text = "Loading {value}" ,
162162 progress_value = ProgressValue .RECTS_LARGE ,
163163)
164- def on_animation_rects_large (update : Update , _ : CallbackContext ):
164+ def on_animation_rects_large (update : Update , _ : CallbackContext ) -> None :
165165 message = update .effective_message
166166 run_command (message )
167167
@@ -171,7 +171,7 @@ def on_animation_rects_large(update: Update, _: CallbackContext):
171171 text = "Loading {value}" ,
172172 progress_value = ProgressValue .RECTS_SMALL ,
173173)
174- def on_animation_rects_small (update : Update , _ : CallbackContext ):
174+ def on_animation_rects_small (update : Update , _ : CallbackContext ) -> None :
175175 message = update .effective_message
176176 run_command (message )
177177
@@ -181,7 +181,7 @@ def on_animation_rects_small(update: Update, _: CallbackContext):
181181 text = "Loading {value}" ,
182182 progress_value = ProgressValue .PARALLELOGRAMS ,
183183)
184- def on_animation_parallelograms (update : Update , _ : CallbackContext ):
184+ def on_animation_parallelograms (update : Update , _ : CallbackContext ) -> None :
185185 message = update .effective_message
186186 run_command (message )
187187
@@ -191,7 +191,7 @@ def on_animation_parallelograms(update: Update, _: CallbackContext):
191191 text = "Loading {value}" ,
192192 progress_value = ProgressValue .CIRCLES ,
193193)
194- def on_animation_circles (update : Update , _ : CallbackContext ):
194+ def on_animation_circles (update : Update , _ : CallbackContext ) -> None :
195195 message = update .effective_message
196196 run_command (message )
197197
@@ -212,7 +212,7 @@ def on_animation_circles(update: Update, _: CallbackContext):
212212 )
213213 ),
214214)
215- def on_custom_all_animation (update : Update , _ : CallbackContext ):
215+ def on_custom_all_animation (update : Update , _ : CallbackContext ) -> None :
216216 message = update .effective_message
217217 run_command (message )
218218
@@ -222,7 +222,7 @@ def on_custom_all_animation(update: Update, _: CallbackContext):
222222 text = "{value} x {value}" ,
223223 progress_value = ProgressValue .RECTS_SMALL ,
224224)
225- def on_custom_no_text_animation (update : Update , _ : CallbackContext ):
225+ def on_custom_no_text_animation (update : Update , _ : CallbackContext ) -> None :
226226 message = update .effective_message
227227 run_command (message )
228228
@@ -232,7 +232,7 @@ def on_custom_no_text_animation(update: Update, _: CallbackContext):
232232 text = "KFC {value}" ,
233233 progress_value = ProgressValue .CHICKENS ,
234234)
235- def on_sub_animation_chickens (update : Update , _ : CallbackContext ):
235+ def on_sub_animation_chickens (update : Update , _ : CallbackContext ) -> None :
236236 message = update .effective_message
237237 run_command (message , sleep_seconds = 30 )
238238
@@ -242,12 +242,12 @@ def on_sub_animation_chickens(update: Update, _: CallbackContext):
242242 text = "Faces {value}" ,
243243 progress_value = ProgressValue .FACES ,
244244)
245- def on_sub_animation_faces (update : Update , _ : CallbackContext ):
245+ def on_sub_animation_faces (update : Update , _ : CallbackContext ) -> None :
246246 message = update .effective_message
247247 run_command (message , sleep_seconds = 30 )
248248
249249
250- def main ():
250+ def main () -> None :
251251 handlers = [
252252 CommandHandler ("start" , on_start ),
253253 CommandHandler ("simple" , on_simple ),
@@ -271,7 +271,7 @@ def main():
271271 MessageHandler (Filters .text , on_request ),
272272 ]
273273
274- def before_start_func (updater : Updater ):
274+ def before_start_func (updater : Updater ) -> None :
275275 for commands in updater .dispatcher .handlers .values ():
276276 for command in commands :
277277 if isinstance (command , CommandHandler ):
0 commit comments