Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Preslav Semov Hadzhitsanev
@preslavsh

@viktordavidovich

Let's picture that I have 200 people. Is it possible to have a "chat" or "group" or whichever it's called in Viber, with all these guys there + Viber Bot (as a separate account in that chat) not posible
Last time I was asking the guy, who has some experience with developing Viber Bot, and he said that it's required to have PUBLIC chat/group, not like general.... He has mentioned that you can add Viber BOT only in such kind of chat types. Is it true? Yeah and i think soon you would be able only to create chatbot and not be able to have public chat with chatbot.
I found it "All communication between bots and Viber users can only be initialized by the Viber user starting a new conversation to the account (opt–in). - yeah and if you have stickers you can make them to subscribe to automatically to your chatbot

thethtun-mmds
@thethtun-mmds
@preslavsh Thanks for responding. Very appreciate it :D. I have got the bot working. (i.e published). It turns out, the bot can't be accessed by users until it has met the required user count. According to the doc, the bot must have at least six users. (https://support.viber.com/customer/en/portal/articles/2856551-increase-the-reach-of-your-public-account?b_id=3838). In my case, I added two more users and the bot went live. Other people can now scan the QR Code and start chatting. :DD
I also tried to reach out to Viber support team and they replied that creating Viber bot is completely free. It only costs when you want to grow the brand. Check out this link they provided which includes the price range for south east asia region. (https://docs.google.com/spreadsheets/d/132XP62Ku-AiSLKDRJSwX4823NI-9k_haZdMqWOGss-A/edit#gid=0)
(https://drive.google.com/file/d/1U4X7TfsaqgMPz5ZfTkht8XGU92fLOXf_/view)
Preslav Semov Hadzhitsanev
@preslavsh
@thethtun-mmds Great thank you
That is very
valuable
info
Viktar Davidovich
@viktordavidovich

Viber support only private chat. You need telegram bot))

thank you for your answer, this is exactly what I've started doing - migrated to Telegram Plaltform :)

@thethtun-mmds This is the menu I see and I can't find "publish" action Publish action is avaliable only in the phone application.
I want the bot to appear in "Discover" section so that people can type in the name and look for it. I think this action can be performed by viber representatives only ask support guys or your nearest representative.

thank you for your answer!

Ivan Yonkov
@RoYaLBG

Hello, I'm receving the following error:

TypeError: Data must be a string or a buffer
    at TypeError (native)
    at Hmac.update (crypto.js:75:16)
    at MessageValidator._calculateHmacFromMessage (/myhost/node_modules/viber-bot/lib/message/message-validator.js:17:54)
    at MessageValidator.validateMessage (/myhost/node_modules/viber-bot/lib/message/message-validator.js:11:30)
    at _app.use (/myhost/node_modules/viber-bot/lib/middleware.js:61:32)
    at Layer.handle [as handle_request] (/myhost/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/myhost/node_modules/express/lib/router/index.js:317:13)
    at /myhost/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/myhost/node_modules/express/lib/router/index.js:335:12)
    at next (/myhost/node_modules/express/lib/router/index.js:275:10)

I guess it's SSL related. I'm trying to run the bot inside nginx, so I start nodejs in HTTP and nginx in HTTPs (which reverse proxies to nodejs).

Starting the server this way: const server = http.createServer(bot.middleware()).listen(port, () => bot.setWebhook(webhookUrl));
Preslav Semov Hadzhitsanev
@preslavsh
@RoYaLBG this usually means that someone is pinging your server and its not Viber. I had the same issue and some random server was pinging my own causing this error to appear. See Viber/viber-bot-node#14 for more info.
Ivan Yonkov
@RoYaLBG
Thank you, I will change the endpoint so it will not be that easily guessable
tchantzakos
@tchantzakos
Hi guys.
I am trying to forward a deep-link through the following url shema: viber://forward?text=<Your Text>
in the place of <Your Text> i have my deep-link
e.g. viber://forward?text=viber://pa?chatURI=testUri&context=blabla
when i click the forward-link the share panel opens as expected but the &context=blabla is missing from the text to be shared and it sends only viber://pa?chatURI=testUri
Is there any way to share the full deep-link?
Thanks for your help :)
Preslav Semov Hadzhitsanev
@preslavsh
@tchantzakos isnt the context received on your handler?
Ghost
@ghost~5dd57cd5d73408ce4fd19e4e

Hi, I am developing an IoT device, which periodically needs to send alarms. I would like to have the option to send these alarms to users that use Viber. Of course, each user shall only get notifications for their specific device that they own.

As I see now, programmatically one may only distinguish the users by their Viber ID and not by phone. This creates the problem that the server cannot know which ID coresponds to which user, and thus it does not know which device's alarms it should send.

Is there any other way to address a specific user (e.g. by their mobile), or generally any way to identify which user has this specific ID?

del333ted
@del333ted
Message media links expire in a few hours, how can I get them again? No ways?
Sergey Novozhilov
@OtecAbsolut
Save media on own server.
tchantzakos
@tchantzakos
@fjpanag Just saw you reply
Viber support gave me the solution
I had to replace & symbol with %26 and then it worked as expected
thanks anw :)
Ruslan Trufanov
@MrGretty
Hello Guys, tell me, please. Can I somehow add an icon to the button for the bot?
I do everything according to the documentation, but the picture becomes the whole button.I need, as in the example on the first screen
https://developers.viber.com/docs/tools/keyboard-examples/
Preslav Semov Hadzhitsanev
@preslavsh
@fjpanag I am confused you have the viberId from which you have broadcast message to specific user. If you need the mobile phone type I think you can make getUserDetails (Node.js) and get the device but I dont think you need it. And if you user is not subscribed you cannot send them message so they should get to your bot first
@MrGretty first are you using pngs and what dimensions is the png. I am shooting in the dark but usually viber has problems with these things.
Also the documentation hasnt change from long time, so better try with the support, you cannot trust it anymore
Ruslan Trufanov
@MrGretty
@preslavsh thanks
Mike Kokkolios
@mikekok
Hello! Is there any way to know if the message received is a location? Thanks!
Preslav Semov Hadzhitsanev
@preslavsh
@mikekok the simplest way is to check its check the message type typeof , which may be considered an antipattern, but "This is the way" . Be aware that you wont receive location messages in the bot.onTextMessage handler, but in bot.on(BotEvents.MESSAGE_RECEIVED, (message, response) => ... ); and also making users send location is considered in Viber for bad ux.
Mike Kokkolios
@mikekok
@preslavsh thank you! The bot is location based so I definitely have to get a location submission by the user, not specifically his own location but it has to be a location in general.
Preslav Semov Hadzhitsanev
@preslavsh
guys I am getting java.util.concurrent.TimeoutException: Total timeout elapsed',
when trying to connect to the bot
any ideas
why
Preslav Semov Hadzhitsanev
@preslavsh
Solved was expired domain
László Monda
@mondalaci
Hi guys! I'd like Viber to send a welcome message on my behalf to people when they message me or try to call me the first time regardless of whether I'm online at the moment. I'd continue the conversation manually from that point onward. I stumbled upon the Bot API, but it seems like a public thing. Any ideas?
Alex Zakharen
@Zakharen
hi, could somebody share a correct example of creating a PictureMessage instance in NodeJS?
Alex Zakharen
@Zakharen
hi, could somebody share a correct example of creating a PictureMessage instance in NodeJS?
Pavel
@shestpa
Hello! Is it possible to edit and/or delete message in chat (with chatbot) via Viber API?
Valentyn Burlachenko
@burlachenkovv

Hello!
Does anybody try to deploy the viber-bot to the Zeit Now?

In my case, it has been deployed well, I see the events capturing in the log (e.g bot.on(Events.SUBSCRIBED, …) or MESSAGE_RECEIVED), but all response methods, like bot.sendMessage aren’t working.

All methods working well locally, so problem probably in Zeit config. My current config is:

{
  "name": "test-viber-bot",
  "version": 2,
  "builds": [
    {
      "src": "src/index.js",
      "use": "@now/node"
    }
  ],
  "routes": [
    {
      "src": "^/(.*)",
      "headers": { "Connection": "keep-alive" },
      "dest": "/src"
    }
  ]
}

Start point for node is simple:

const app = express();
const port = env.PORT || 4000;

app.use("/", bot.middleware());

app.listen(port);

What am I missing? :)

Preslav Semov Hadzhitsanev
@preslavsh
@mondalaci There is not easy way to to that in through the API. You need to have init handler for receiving the first message, and then keep messages from the users and to reply to them with bot.sendMessage. Possible but needs work, maybe Viber is not the best solution for that, but its posible to implement.
@shestpa not posible
@Zakharen picture message are tricky. I prefer using the UrlMessages since you have preview of the pictures inside the Viber chat.
tintoverano
@tintoverano
hi, I'm getting random "notSubscribed" error (6) for subscribed users, any ideas?
Preslav Semov Hadzhitsanev
@preslavsh
@tintoverano are you sure they are subscribed, sometimes it seems that my server does not get the unsuscribe events. Probably should try to investigate with support.
tintoverano
@tintoverano
@preslavsh thanks, I checked with the person in question and he didn't unsubscribe - also, the onError handler wasn't called
I asked him to use the bot again and it behaved for him as he was subscribed
seems like a false positive from the Viber API
Preslav Semov Hadzhitsanev
@preslavsh
Be aware that Promise chain is broken and you wont get the error when trying to handle the promise error Viber/viber-bot-node#15 or in the onError handler of the bot. I receive this error often It would be very helpfull if you can figure out where is the issue with the Viber support.
@tintoverano
tintoverano
@tintoverano
@preslavsh my error is gone for now, next time I'll follow it up
korpmaks
@korpmaks
I want to use bot to send errors and state from industrial object to viber's community. But can't find method for it. Can I use 'postToPublicChat' for this task
Public Accounts are no longer supported, but method is still named "postToPublicChat"
iamkenken
@iamkenken
Hi, I can't hide the input box using InputFieldState: "hidden". is there something that I missed? please help TIA
@Jlomaka Hi, did you solve the problem in InputFieldState: "hidden"?