public IActionResult TranslateRaw([FromRoute] string question, [FromQuery] string lang) { var result = _bingTranslator.CallTranslate(question, lang); return(Json(new { value = result })); }
public override async Task OnMessage(string inputMessage, NewMessageEvent eventContext) { if (eventContext.Muted) { return; } if (eventContext.Message.SenderId == Profile.Id) { return; } inputMessage = inputMessage.Replace($"@{Profile.NickName.Replace(" ", "")}", ""); var translated = _bingTranslator.CallTranslate(inputMessage, "en"); await SendMessage(translated, eventContext.Message.ConversationId, eventContext.AESKey); }
public override async Task OnMessage(string inputMessage, NewMessageEvent eventContext) { if (eventContext.Muted) { return; } if (eventContext.Message.SenderId == Profile.Id) { return; } inputMessage = RemoveMentionMe(inputMessage); var translated = _bingTranslator.CallTranslate(inputMessage, "en"); if (eventContext.Mentioned) { translated += Mention(eventContext.Message.Sender); } await SendMessage(translated, eventContext.ConversationId); }