@@ -40,7 +40,7 @@ def traduire_texte(texte, de, a):
4040 }
4141
4242 # Envoyer la requête à l'API de traduction
43- response = requests .post ('https://codingtranslator.onrender .com/api' , json = body )
43+ response = requests .post ('https://example .com/api' , json = body )
4444
4545 if response .status_code == 200 :
4646 # Récupérer la réponse de l'API de traduction
@@ -63,18 +63,13 @@ def afficher_message_bienvenue(message):
6363
6464*🆚 Version : 1.0.0 - By @A_liou*
6565 '''
66- bot .send_chat_action (
67- chat_id = message .chat .id ,
68- action = "typing"
69- )
66+ bot .send_chat_action (chat_id = message .chat .id , action = "typing" )
7067 bot .reply_to (message , message_bienvenue , parse_mode = 'Markdown' )
68+
7169# Commande /fr
7270@bot .message_handler (commands = ['fr' ])
7371def traduire_fr (message ):
74- bot .send_chat_action (
75- chat_id = message .chat .id ,
76- action = "typing"
77- )
72+ bot .send_chat_action (chat_id = message .chat .id , action = "typing" )
7873 texte = message .text .replace ('/fr' , '' ).strip ()
7974 if texte :
8075 reponse = traduire_texte (texte , 'en' , 'fr' )
@@ -85,10 +80,7 @@ def traduire_fr(message):
8580# Commande /en
8681@bot .message_handler (commands = ['en' ])
8782def traduire_en (message ):
88- bot .send_chat_action (
89- chat_id = message .chat .id ,
90- action = "typing"
91- )
83+ bot .send_chat_action (chat_id = message .chat .id , action = "typing" )
9284 texte = message .text .replace ('/en' , '' ).strip ()
9385 if texte :
9486 reponse = traduire_texte (texte , 'fr' , 'en' )
@@ -99,10 +91,7 @@ def traduire_en(message):
9991# Répondre aux autres messages
10092@bot .message_handler (func = lambda message : True )
10193def repondre_autre (message ):
102- bot .send_chat_action (
103- chat_id = message .chat .id ,
104- action = "typing"
105- )
94+ bot .send_chat_action (chat_id = message .chat .id , action = "typing" )
10695 bot .reply_to (message , 'Veuillez utiliser la commande /fr ou /en pour traduire le texte.' )
10796
10897# Lancer le bot
0 commit comments