# telegram.Bot(TelegramToken).send_message(user_id,anslate(user_text, dest=lang_type). Global paused # inform function to use external variable instead of local variable paused = False # created outside functions Every time a new message is posted to a specified Telegram chat/channel, Make will automatically add that message. Save Telegram messages to a Google Sheets spreadsheet. Every time a new row is added to your Google Sheets spreadsheet, Make will automatically send a message in Telegram. (multiprocessing would need to keep it in file or database).Ĭode needs also to check user ID so only admin could do this. Get Telegram messages for new Google Sheets rows. If you have comments, please contact us via: PROMTcom Send Message. Not tested code - I'm not sure if module runs all in one thread I translate messages or posts from and into many languages. And use message /start to set it False, and /end to set it True. Googles free service instantly translates words, phrases, and web pages between English and over 100 other languages. Ive created bot, registered it and made it possible receive and answer users messages. For now I just want to have some practice and selected free plan for 2m words. You could use global variable to control when it can translate and when it can't do it - ie, paused. Im creating translate bot, and Ive selected Microsoft Translator - Text Translation from Microsoft Azure Market Place. I don't think this will work and actually doesn't. Telegram.Bot(TelegramToken).send_message(user_id, reply_to_message_id=_id, text=c) Telegram.Bot(TelegramToken).send_message(user_id, reply_to_message_id=_id, text=b)Ĭ = 'es : ' anslate(user_text, dest=lang_type).text '\n' 'ko : ' anslate(user_text, dest=lang_type).text '\n' 'en : ' anslate(user_text, dest=lang_type).text # telegram.Bot(TelegramToken).send_message(user_id,anslate(user_text, dest=lang_type).text)ī = 'en : ' anslate(user_text, dest=lang_type).text '\n' 'ko : ' anslate(user_text, dest=lang_type).text '\n' 'es : ' anslate(user_text, dest=lang_type).text Telegram.Bot(TelegramToken).send_message(user_id, reply_to_message_id=_id, text=a) It translates all messages that every member types in the group.īut sometimes it's annoying when loads of texts are uploaded so I want to pause some time and restart by typing some order likeĭo you think it's going to be possible to do? I want some hints text=()Ī = 'ko : ' anslate(user_text, dest=lang_type).text '\n' 'en : ' anslate(user_text, dest=lang_type).text '\n' 'es : ' anslate(user_text, dest=lang_type).text I have a translator bot in telegram group.
0 Comments
Leave a Reply. |