public async Task SendMsg() { ViberBotClient viberBotClient = new ViberBotClient(""); HttpResponseMessage setWebhook = await viberBotClient.SendMessage(new TextMessage("test log event reloaded 3", "TestProject", "")); string result = await setWebhook.Content.ReadAsStringAsync(); viberBotClient.Dispose(); TestContext.WriteLine(result); }
static void SensMessage(Options options) { ViberBotClient viberBotClient = new ViberBotClient(Settings.Default.ViberToken); string text = options.Text; string from = options.Sender ?? Settings.Default.ViberClientFrom; var message = new TextMessage(text, from, Settings.Default.ViberClientTo); HttpResponseMessage sendMessage = viberBotClient.SendMessage(message).Result; var stringResp = sendMessage.Content.ReadAsStringAsync().Result; Console.WriteLine(stringResp); }