viber | Viber messaging/chatbot for Go/Golang | Chat library
kandi X-RAY | viber Summary
kandi X-RAY | viber Summary
With this package you can use Viber REST API to send and receive messages from Viber platform. All structs used in package represents the structs identical to Viber REST API. To fully understand Viber messaging platform and this package as well, you should read Viber REST API. Before using this package you will need Viber public account and your App key which you can find in Edit section of your Viber public account.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- SetWebhook sends a webhook request to the given URL .
- parseMsgResponse is used to parse a response token
- New returns a new Viber instance .
- peekMessageType returns the peer message type .
- ErrorStatus returns the status of e .
viber Key Features
viber Examples and Code Snippets
package main
import (
"fmt"
"log"
"net/http"
"time"
"github.com/mileusna/viber"
)
func main() {
v := &viber.Viber{
AppKey: "YOUR-APP-KEY-FROM-VIBER",
Sender: viber.Sender{
Name: "MyPage",
package main
import (
"fmt"
"log"
"github.com/mileusna/viber"
)
func main() {
v := viber.New("YOUR-APP-KEY-FROM-VIBER", "MyPage", "https://mysite.com/img/avatar.jpg")
// you really need this only once, remove after you set th
v.SendTextMessage(userID, "Hello, World!")
v.SendURLMessage(userID, "Visit my site", "http://mysite.com/")
v.SendPictureMessage(userID, "Take a look at this photo", "http://mysite.com/photo.jpg")
// create message, change the sender for this messa
Community Discussions
Trending Discussions on viber
QUESTION
In custom html/css template I have instagram svg icon, defined as :
...ANSWER
Answered 2022-Jan-08 at 16:06you can just add for him a style property and give it width and height if its not work : you can find s good icons from these website: heroicons flaticons feathericons. with these links you can search for your icons and just copy svg codes and paste it on you html code
QUESTION
I encountered a problem when trying to send sms using the SMSC service in Django project.
My Celery task for sending email and sms:
...ANSWER
Answered 2021-Dec-20 at 10:06to solve this problem, I started investigating the functions that were giving out the error.
It turned out that I was passing an incorrect value. the function was expecting a string. And it took me a long time to figure out why editing didn't help.
It turns out that you have to RESET CELERY every time you make an edit.
QUESTION
- I am using spring-context 5.3.13 (no spring-boot)
- I have a file named "config.yaml" under "src/main/resources"
- I have this @PropertySource configured:
@PropertySource(value = "classpath:config.yaml", factory = TypesafeAdapterPropertySourceFactory.class)
- When I run it from intellij it successfully loads the file
My issue: When running a jar the file is not found due to the path being unavailable inside the jar. More info:
- the file itself is inside the jar root (checked it)
- Exception:
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.viber.httpmsexample.Application]; nested exception is java.io.FileNotFoundException: class path resource [config.yaml] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/C:/Repositories/http-ms-example/target/app.jar!/config.yaml at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) at org.springframework.context.annotation.AnnotationConfigApplicationContext.(AnnotationConfigApplicationContext.java:93) at com.mytest.httpmsexample.Application.main(Application.java:63) Caused by: java.io.FileNotFoundException: class path resource [config.yaml] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/C:/Repositories/http-ms-example/target/app.jar!/config.yaml at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:217) at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:162) at com.mytest.libraries.anticorruption.config.TypesafeAdapterPropertySourceFactory.createPropertySource(TypesafeAdapterPropertySourceFactory.java:14) at org.springframework.context.annotation.ConfigurationClassParser.processPropertySource(ConfigurationClassParser.java:463) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:280) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:304) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175) ... 8 more
I can externalize this config but I wish to keep it there for now. Is it possible to get over that issue?
Thanks!
...ANSWER
Answered 2021-Nov-29 at 13:22The problem is your own TypesafeAdapterPropertySourceFactory
which tries to create the property source based on a File
which doesn't work when the file is in a jar. A File in the sense of java is a physical file on the filesystem, one that is inside an archive isn't.
I would strongly suggest to use the ResourcePropertySource
to create the property source and decorate that instead of something else.
QUESTION
I want to get some extra data from the user in my viber bot. This can be done via [optionalTrackingData]. But no matter how hard I try to send a message with [optionalTrackingData], the message from the user is always empty. Maybe there are some additional settings? I write on Node.js
this what I tried: bot.sendMessage(response.userProfile, [ new TextMessage("please select your email:"), keyboardMessage ], {'trackingData':'trackingData'});
please help
...ANSWER
Answered 2021-Oct-07 at 11:18ok, I just reload mode.js and it start working
QUESTION
I'd like to parse strings from message. (not in channel, from user's message). I get a message like this by using this --> print(client.get_messages('bot_name')).
I applicated an image because i want to show you, that i want to get from message.
...[Message(id=177, peer_id=PeerUser(user_id=123456789), date=datetime.datetime(2021, 8, 31, 10, 30, 35, tzinfo=datetime.timezone.utc), message='📱\n├ Номер: 79991234567\n├ Страна: Россия\n├ Регион: г.Москва и Московская область\n└ Оператор: Билайн\n\n📓 Возможные имена:\n└ Джек и еще 6 имен\n\n👤 ФИО: найдено\n🏠 Возможные адреса: найдено\n🌐 Вконтакте: найдено\n🏥 Дата рождения: найдено\n🙎\u200d♂️ Facebook: найдено\n📧 Telegram: найдено\n✅ Whatsapp: есть\n✅ Viber: есть\n🏪 Объявлений: 26 шт\n👮\u200d♂️ Интересовались: 2 человека\n🏅 Репутация: (0)👍 (0)👎 \n\n⚠️ Для просмотра результатов поиска необходимо приобрести подписку!\nℹ️ Если информация не найдена, закажите «Расширенный поиск»', out=False, mentioned=False, media_unread=False, silent=False, post=False, from_scheduled=False, legacy=False, edit_hide=False, pinned=False, from_id=None, fwd_from=None, via_bot_id=None, reply_to=None, media=None, reply_markup=ReplyInlineMarkup(rows=[KeyboardButtonRow(buttons=[KeyboardButtonCallback(text='💳 Оформить подписку', data=b'PREMIUM|welcome', requires_password=False)]), KeyboardButtonRow(buttons=[KeyboardButtonCallback(text='🔎 Расширенный поиск - 30₽', data=b'PREMIUM|PHONE|79991234567', requires_password=False)]), KeyboardButtonRow(buttons=[KeyboardButtonCallback(text='🏅 Добавить репутацию', data=b'REP|0|79991234567', requires_password=False)]), KeyboardButtonRow(buttons=[KeyboardButtonUrl(text='✅ Whatsapp', url='https://botapi.co/whatsapp/79991234567?&gclid=18547829:695de1f0395e3a1a2496bbc02629c1c6&_bk=cloudflare'), KeyboardButtonUrl(text='📧 Viber', url='https://botapi.co/viber/79991234567?&gclid=18547829:695de1f0395e3a1a2496bbc02629c1c6&_bk=cloudflare')])]), entities=[MessageEntityBold(offset=5, length=6), MessageEntityCode(offset=12, length=11), MessageEntityBold(offset=26, length=7), MessageEntityBold(offset=43, length=7), MessageEntityBold(offset=83, length=9), MessageEntityBold(offset=104, length=16), MessageEntityBold(offset=124, length=6), MessageEntityItalic(offset=131, length=12), MessageEntityBold(offset=148, length=4), MessageEntityCode(offset=153, length=7), MessageEntityBold(offset=164, length=17), MessageEntityCode(offset=182, length=7), MessageEntityBold(offset=193, length=10), MessageEntityCode(offset=204, length=7), MessageEntityBold(offset=215, length=14), MessageEntityCode(offset=230, length=7), MessageEntityBold(offset=244, length=9), MessageEntityCode(offset=255, length=7), MessageEntityBold(offset=266, length=9), MessageEntityCode(offset=276, length=7), MessageEntityBold(offset=286, length=9), MessageEntityCode(offset=296, length=4), MessageEntityBold(offset=303, length=6), MessageEntityCode(offset=310, length=4), MessageEntityBold(offset=318, length=11), MessageEntityCode(offset=330, length=5), MessageEntityBold(offset=342, length=15), MessageEntityCode(offset=358, length=10), MessageEntityBold(offset=372, length=10), MessageEntityCode(offset=384, length=1), MessageEntityCode(offset=390, length=1), MessageEntityBold(offset=400, length=64), MessageEntityBold(offset=468, length=4), MessageEntityBold(offset=505, length=19)], views=None, forwards=None, replies=None, edit_date=None, post_author=None, grouped_id=None, restriction_reason=[], ttl_period=None), total=35][enter image description here]
ANSWER
Answered 2021-Aug-31 at 17:54This is explained in Telethon's FAQ:
QUESTION
I have a form, and I need to hide the buttons if in the email input there is no "@" and if the phone input doesn't have at least 8 numbers. I have success with the second but trouble with the first condition
...ANSWER
Answered 2021-Aug-24 at 21:24You can use javascript's include function
QUESTION
My data model:
...ANSWER
Answered 2021-Jul-17 at 14:13One possible way to use *ngTemplateOutlet
instead of *ngIf
QUESTION
I have some troubles with setting webhook to my viber bot. Every time I wanna set my url viber api returns error. So I am trying to use this in postman:
Url: https://chatapi.viber.com/pa/set_webhook
ANSWER
Answered 2021-May-05 at 14:36You have Http error: "500 (Internal Server Error)" on any post request. So problem is on your side :)
Try to send POST request to https://gutapi.ml/api/viber/post (your server) with following payload using Postman and look to your logs.
QUESTION
I want to give a more realistic experience to user by showing the text "Bot is typing" under chatbox, before viber bot sends the message (even simulated with a delay).
It is already implemented by viber but i could'n find any callback for that. Also known as Typing Receipts or Typing Indicator
Your help will be appreciated! thanks!
...ANSWER
Answered 2021-Apr-23 at 12:27It is not available for Viber Bots.
I saw similar functionality for Telegram and others, but not for Viber Bot API.
QUESTION
Hi I am trying to upload a file and a text, using multipart form-data HttpURLConnection java, sample of code below:
...ANSWER
Answered 2021-Mar-31 at 16:50so my last issue was in write of the image, correct code below, works like a charm now ;):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install viber
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page