-
Notifications
You must be signed in to change notification settings - Fork 10
Banning nicks and sessions
Arpit Singla edited this page Oct 16, 2015
·
5 revisions
##Banning the use of reserved nicks
- This banning is done by sending a message to jinora, the message should be prepended with
!
(so that it doesn’t reach any user), and should be something like!ban nick x
. It adds the given nick to a file namedreserved_nicks
. - If a user sends a message to jinora with a nick which is a superstring of any of the nick present in the
reserved_nicks
file, the user is prompted again for a username(the message is not sent to slack or any other user at that time). After the user changes his nick, the message he sent earlier is sent again to jinora with the new nick, so the process continues until user enters a valid nick.
##Banning sessions
- This banning is done by sending a message to jinora, the message should be prepended with
!
(so that it doesn’t reach any user), and should be something like!ban user x
. It adds the session corresponding to that nick to an arraybannedSessions
. - If a user whose session exists in that array sends message to jinora, jinora sends the message to slack’s
#public-hell
, and doesn’t send it to any other user. The message is showed to that user only, so that the banned user doesn’t know that he is banned.
Note: This ban works only when the user has ever sent a message to jinora in that session of jinora. If that is not the case, it will return “error” when the post request is sent.