{"action":"created","issue":{"url":"https://api.github.com/repos/dhilln/caffeine-bot/issues/8","repository_url":"https://api.github.com/repos/dhilln/caffeine-bot","labels_url":"https://api.github.com/repos/dhilln/caffeine-bot/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/dhilln/caffeine-bot/issues/8/comments","events_url":"https://api.github.com/repos/dhilln/caffeine-bot/issues/8/events","html_url":"https://github.com/dhilln/caffeine-bot/pull/8","id":357478928,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzNDgyMzQ2","number":8,"title":"Added spam detector","user":{"login":"rainqubit","id":8548422,"node_id":"MDQ6VXNlcjg1NDg0MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/8548422?v=4","gravatar_id":"","url":"https://api.github.com/users/rainqubit","html_url":"https://github.com/rainqubit","followers_url":"https://api.github.com/users/rainqubit/followers","following_url":"https://api.github.com/users/rainqubit/following{/other_user}","gists_url":"https://api.github.com/users/rainqubit/gists{/gist_id}","starred_url":"https://api.github.com/users/rainqubit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainqubit/subscriptions","organizations_url":"https://api.github.com/users/rainqubit/orgs","repos_url":"https://api.github.com/users/rainqubit/repos","events_url":"https://api.github.com/users/rainqubit/events{/privacy}","received_events_url":"https://api.github.com/users/rainqubit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-06T03:03:32Z","updated_at":"2018-09-07T08:40:19Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/dhilln/caffeine-bot/pulls/8","html_url":"https://github.com/dhilln/caffeine-bot/pull/8","diff_url":"https://github.com/dhilln/caffeine-bot/pull/8.diff","patch_url":"https://github.com/dhilln/caffeine-bot/pull/8.patch"},"body":"- The spam detector is in [npm package](https://www.npmjs.com/package/spamnya) to make the code cleaner\r\n- Changes to message event handler\r\n```javascript\r\n//initiate spam detector with 50 max logged chats\r\n  spam.log(message, 50)\r\n  if(spam.tooQuick(2, 1000)){\r\n    //when someone send 2 chats in less than a second\r\n    message.channel.send(\"slow down\") //example\r\n  }\r\n\r\n  if(spam.sameMessages(3)){\r\n    //when someone sends 3 identical messages\r\n    message.channel.send(\"stop spamming\") //example\r\n  }\r\n```\r\n- The rules are customizable"},"comment":{"url":"https://api.github.com/repos/dhilln/caffeine-bot/issues/comments/419367285","html_url":"https://github.com/dhilln/caffeine-bot/pull/8#issuecomment-419367285","issue_url":"https://api.github.com/repos/dhilln/caffeine-bot/issues/8","id":419367285,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTM2NzI4NQ==","user":{"login":"harrego","id":41309736,"node_id":"MDQ6VXNlcjQxMzA5NzM2","avatar_url":"https://avatars3.githubusercontent.com/u/41309736?v=4","gravatar_id":"","url":"https://api.github.com/users/harrego","html_url":"https://github.com/harrego","followers_url":"https://api.github.com/users/harrego/followers","following_url":"https://api.github.com/users/harrego/following{/other_user}","gists_url":"https://api.github.com/users/harrego/gists{/gist_id}","starred_url":"https://api.github.com/users/harrego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrego/subscriptions","organizations_url":"https://api.github.com/users/harrego/orgs","repos_url":"https://api.github.com/users/harrego/repos","events_url":"https://api.github.com/users/harrego/events{/privacy}","received_events_url":"https://api.github.com/users/harrego/received_events","type":"User","site_admin":false},"created_at":"2018-09-07T08:40:19Z","updated_at":"2018-09-07T08:40:19Z","author_association":"COLLABORATOR","body":"Thanks for these updates! I'm currently working on branch `rainqubit-spam-detection` to integrate the module with the bot.\r\n\r\nMy plan is to mute, DM the user and notify staff when someone gets flagged. Currently I'm adding all the muting utils to the bot, should be merging soon."}}
{"actor":{"display_login":"harrego"}}