Skip to content

Commit

Permalink
small pm fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-J-Scofield committed Oct 22, 2018
1 parent a4e17c8 commit c290b5d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2018-present Michael Scofield <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Once you've done this, setting the anti spam up will be very easy.
And you can follow the code below to get started!

```js
var antispam = require("discord-anti-spam");
const antispam = require("discord-anti-spam");

antispam(bot, {
warnBuffer: 3, //Maximum amount of messages allowed to send in the interval time before getting warned.
Expand Down
8 changes: 4 additions & 4 deletions anti_spam.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ module.exports = function (bot, options) {
const maxDuplicatesBan = (options && options.duplicates || 10);
const deleteMessagesAfterBanForPastDays = (options && options.deleteMessagesAfterBanForPastDays || 7);

bot.on('message', msg => {
bot.on("message", msg => {

//Always return with an bot.....
if(msg.author.bot) return;
// bots don't ban do they?
if (msg.author.bot) return;

if(msg.author.id != bot.user.id){
if ( (msg.author.id != bot.user.id) && msg.channel.guild) {
var now = Math.floor(Date.now());
authors.push({
"time": now,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
},
"homepage": "https://github.com/Michael-J-Scofield/discord-anti-spam#readme",
"author": "Michael Scofield",
"license": "ISC"
"license": "MIT"
}

0 comments on commit c290b5d

Please sign in to comment.