Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sender is null in message #1

Open
deniskristov opened this issue Jun 12, 2020 · 1 comment
Open

Sender is null in message #1

deniskristov opened this issue Jun 12, 2020 · 1 comment

Comments

@deniskristov
Copy link

Hi, I tried to use your lib and got an NPE in this part of example code:

viberBot.sendMessage(message.getSender().getId(),

as I see in my Viber's incoming request, sender is a part of event attribute:

{"event":"message","timestamp":1591899411331,"chat_hostname":"SN-CHAT-10_","message_token"...,"sender":{"id":"....","name":"Denis Kristov","language":"en","country":"UA","api_version":8},"message":{"text":"test","type":"text"},"silent":false}

so it looks like you need to change this part to:

viberBot.sendMessage(event.getSender().getId(),

@themronion
Copy link

+1 here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants