tomer8007 / kik-bot-api-unofficial

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

Block a user by @name? #197

Closed Jumvah closed 2 years ago

Jumvah commented 3 years ago

Can boot or ban a user easily enough, but is it possible to block a user from their @name?

I want to be able to pm the bot with "block @name" so that the bot will only see " blocked message " message from that user no matter which group.

Handy for stopping people trolling/spamming the bot.

Thanks. Keep up the good work 👍🏻

bluemods commented 3 years ago

*** blocked message *** is a replacement done in the app itself, not by Kik.

Blocking on Kik is pretty useless at the moment, as it doesn't stop them from being able to send you messages (even though on their website it says it does) it's just a hint to the mobile client that they should be placed in a seperate block list.

What you can do instead, is just put their username or JID in a list you maintain for the bot and write a function to add to and check the list, and if on the list the bot will ignore their messages.

A common method to handle people spamming the bot (which I use and others use) is to create an anti spam threshold of messages allowed per few seconds. When exceeded, the bot starts ignoring messages from them for several hours.