
India have 29 States and in 29 states we have different regional culture and every states have different language and among all the language most common languages are Hindi, English, Telugu, Tamil, Bengali, Kannada, Malayalam, Oriya, Punjabi, Urdu, Sanskrit. Like Russian is most widely speaking language followed by German and french in Europe as per google and people would love to interact with S/4HANA system in Russian Language. For example my mother tongue is Bengali definitely i would be happy to interact with AI based Chat bot in Bengali and get the S/4HANA system insight in Bengali. # output: Translated(src=ko, dest=en, text=Hello.Welcome to my another blog, In this blog i am going to discuss how language barrier can be removed from Enterprise Chat bot so that people can get system insight by interacting with chat bot in their own language. Mirror_message = await nd_message(channel_group_to, message=channel_group_message)īased from the example of googltrans, the sample usage of it is: from googletrans import Translator Print('message Edited in FR :', message_translated)#affichage du message apres traitement et traduction en FRANCAISįor channel_group_to in channel_group_dic_to: Print('Message Edited in EN:', message_text)#affichage du message original apres traitement en anglais


# print('Message:', channel_group_message_text," # ID:", channel_group_id_from)** Message_translated = ( message_text, dest='fr', src='en') **# message_text_a_translate = event.raw_text If replace in channel_group_message_text:Į = channel_group_message_text.replace(replace,replace) Print('Message Skipped:', channel_group_message_text," # ID:", channel_group_id_from) Print('Message Image Skipped # ID:', channel_group_id_from) If channel_group_id_from in skip_message_image_list:

Skip_message_image_list = skip_message_image_list(skip_message_image)Ĭhannel_group_list_from, channel_group_dic_to = channel_group(config)Ĭlient = TelegramClient('session', api_id, def new_message_handler(event):Ĭhannel_group_id_from = _id.channel_idĬhannel_group_id_from = _id.chat_idĬhannel_group_id_from = _id.user_idĬhannel_group_message_id = Ĭhannel_group_message_text = Skip_message_image = config.get('Settings', 'skip_message_image') Replace = config.get('Settings', 'replace')Īllow_voice = config.getboolean('Settings', 'allow_voice')Īllow_gif = config.getboolean('Settings', 'allow_gif') Return channel_group_list, channel_group_dicįor channel_group_from in string.split(" "):Īpi_id = config.get('Settings', 'api_id')Īpi_hash = config.get('Settings', 'api_hash')

Temp_channel_group_list.append(int("-100"+channel_group))Ĭhannel_group_dic)]=temp_channel_group_list If first_letter_channel_group.lower() = "c": Temp_channel_group_list.append(int("-"+channel_group)) If first_letter_channel_group.lower() = "g": If firts_letter.lower() = "g" or firts_letter.lower() = "c" or firts_letter.lower() = "b" or firts_letter.lower() = "u":Ĭhannel_group_list.append(int(channel_group_from))Ĭhannel_group_split = channel_group_to.split(" ")įor channel_group in channel_group_split:įirst_letter_channel_group = channel_group screenshot) from telethon import TelegramClient, eventsįrom telethon.tl.types import PeerChannel, MessageActionChatEditPhotoįrom telethon.tl.ssages import GetBotCallbackAnswerRequest, DeleteMessagesRequestįor channel_group_from, channel_group_to in ems('Settings'):
#Telegram google translate bot how to#
So there's the actual code, I imported google translate api, but don't understand where doing the operations, and how to concatenate without sending me those errors (cf. It apply some changes like replace words, avoid voice or images ( as defined in the upper part of my code), and works perfectly this way.īut i'd like to add a functionally that translate the message AFTER the operations performed on it and forward the result like that : I'm actually doing a bot that forward messages from a channel to another channel.
