File tree Expand file tree Collapse file tree 1 file changed +1
-19
lines changed
Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -231,25 +231,7 @@ def callback_eval(bot, update):
231231
232232 # For changing the language:
233233 if query_data .startswith ("ch_lang" ):
234- if query_data == "ch_lang_de" :
235- lang_id = "de"
236- elif query_data == "ch_lang_en" :
237- lang_id = "en"
238- elif query_data == "ch_lang_nl" :
239- lang_id = "nl"
240- elif query_data == "ch_lang_eo" :
241- lang_id = "eo"
242- elif query_data == "ch_lang_br" :
243- lang_id = "br"
244- elif query_data == "ch_lang_es" :
245- lang_id = "es"
246- elif query_data == "ch_lang_ru" :
247- lang_id = "ru"
248- elif query_data == "ch_lang_fa" :
249- lang_id = "fa"
250- else :
251- lang_id = "en"
252-
234+ lang_id = re .search ("ch_lang_([a-z]{2})" , query_data ).group (1 )
253235 change_language (bot = bot , update = update , lang_id = lang_id )
254236
255237 elif query_data == "com_ch_lang" :
You can’t perform that action at this time.
0 commit comments