Skip to content

Banning nicks and sessions

Nemo edited this page Oct 17, 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 named reserved_nicks.

  • Jinora is meant to be used on Heroku, which has ephemeral storage. You cannot rely on the reserved_nicks file. Better to have a sane default and allow the user to set a few extra ones (such as sdslabs) using ENV variables - @captn3m0

  • 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.

  • Make sure you read the entire file in the first load, and not on every message - @captn3m0

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 array bannedSessions.

  • 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.

  • #public-banned is better than hell. Better connotations.

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.

Clone this wiki locally