joaoricardo000 / whatsapp-bot-seed

A small python framework to create a whatsapp bot, with regex-callback message routing.
727 stars 245 forks source link

howto determine if someone sends over a group or direct? #30

Closed x23piracy closed 8 years ago

x23piracy commented 8 years ago

Hi,

for some scripting i need to know if someone sends something to the bot via group or direct. How is that possible?

Regards X23

ghost commented 8 years ago
message.isGroupMessage()
x23piracy commented 8 years ago

Hi,

thank you :) and if detected as true howto send the answer not to the group but to the contact directly instead?

my goal is to not react on some command with the bot when used in a group (bot in group) then i want to except and tell the user that he need to use the specifiy command directly and not in a group.

Regards X23

ghost commented 8 years ago
message.getParticipant()
Sunil02324 commented 8 years ago

Hi,

How to check whether the message is from specific number? I was try if (message.getParticipant() == '919800116113')

but it is not working

Thanks.

x23piracy commented 8 years ago

Hi,

you need to check for number@s.whatsapp.net ;)

Regards X23