示例#1
0
        public async Task <SetWebhookResponse> SetWebHookAsync()
        {
            string             webHook = $"{_webHook}{_viberUrl}";
            SetWebhookResponse res     = await _viberBotClient.SetWebhookAsync(webHook);

            return(res);
        }
示例#2
0
        public async Task <SetWebhookResponse> SetWebhookAsync(string url, ICollection <EventType> eventTypes = null, bool sendName = true, bool sendPhoto = true)
        {
            var webHookViberModel = new WebHookViber()
            {
                URL        = url,
                EventTypes = eventTypes?.Select(x => x.ToString()).ToArray(),
                SendName   = sendName,
                SendPhoto  = sendPhoto,
            };

            string method = UrlTypes.set_webhook.ToString();

            SetWebhookResponse result = await RequestApiAsync <SetWebhookResponse>(method, webHookViberModel);

            return(result);
        }
示例#3
0
 public SetWebhookResponse SetWebhook(SetWebhookRequest setWebhookRequest)
 {
     Log.Info(nameof(SetWebhook));
     return(SetWebhookResponse.Parse(ExecuteAction(setWebhookRequest)));
 }
示例#4
0
 public SetWebhookResponse SetWebhook(SetWebhookRequest setWebhookRequest)
 {
     return(SetWebhookResponse.Parse(ExecuteAction(setWebhookRequest)));
 }