tomer8007 / kik-bot-api-unofficial

Python API for writing unoffical Kik bots that act like humans
MIT License
126 stars 76 forks source link

on_group_status_received issue #157

Open lexinnit opened 4 years ago

lexinnit commented 4 years ago

so i'm trying to make it so when a user joins the group the bot sends a message by using this code

def on_group_status_received(self, response: chatting.IncomingGroupStatus):
      if response.status.find("has joined the chat") > 0:
         client.send_chat_message(response.group_jid, rules)

but it's throwing a 'Received unknown group message.' error even though IncomingGroupStatus is imported correctly

tomer8007 commented 4 years ago

Do you actually see the message your bot has sent after client.send_chat_message(response.group_jid, rules) runs?

lexinnit commented 4 years ago

def on_group_status_received isn't even triggered, just realised that 'Received unknown group message' is thrown for all group statuses.

Ralf-Os commented 2 years ago

Joins are in

def on_group_status_received(self, response: chatting.IncomingGroupStatus):
        print(Fore.GREEN + "[+] Status message in {}: {}".format(response.group_jid, response.status) + Style.RESET_ALL)

        if "has joined" in response.status.lower():
            group_id = response.group_jid
tomer8007 commented 4 months ago

@lexinnit Does it still happen? You should look at this code: https://github.com/tomer8007/kik-bot-api-unofficial/blob/bae0d8d60fe78953d7a203f559174844b6fc621d/kik_unofficial/xmlns_handlers.py#L49 What are the contents of the message you're getting? Why on_group_status_received is not called for you?