diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7486cb0..4c79bd4 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "@technicolor-creamsicle/osselbot", - "version": "2.0.3", + "version": "2.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/index.js b/src/index.js index 33655d3..e5f50f3 100755 --- a/src/index.js +++ b/src/index.js @@ -113,6 +113,24 @@ client.on("message", async message => { }; return; }; +//////////////////////////////////////////////////////////////////////////////// + if(command === "say") { + // makes the bot say something and delete the message. As an example, it's open to anyone to use. + // To get the "message" itself we join the `args` back into a string with spaces: + const sayMessage = args.join(" "); + if (message.member.roles.cache.some(r=>["Admin","Mods","Member of the Order","Botmeister","Ally of the Order","say"].includes(r.name)) ){ + if(sayMessage.includes('@')) { + return message.reply("\nStop pinging yourself \nStop pinging yourself"); + }; + // Then we delete the command message (sneaky, right?). The catch just ignores the error with a cute smiley thing. + message.delete().catch(O_o=>{}); + // And we get the bot to say the thing: + return message.channel.send(sayMessage); + }; + else { + return message.channel.send("Im sorry but we cant have nice things...") + }; +}; //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////DEFCON////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////