mirror of
https://github.com/Technicolor-creamsicle/Osselbot.git
synced 2025-10-20 04:34:02 -04:00
Compare commits
30 Commits
Author | SHA1 | Date | |
---|---|---|---|
1b7dcedca2 | |||
cedf3c6d72 | |||
4e334c1459 | |||
dad83d5001 | |||
8a1bc2137b | |||
c6fb55a097 | |||
a4e30196be | |||
|
d1749c7760 | ||
|
5a42a3e11a | ||
c15ddaa8ed | |||
275493b0f5 | |||
3a84baa944 | |||
4a7e7ea431 | |||
b28ed796d6 | |||
9239d10a6f | |||
abb41e182e | |||
02f9f7e643 | |||
fdb14602c3 | |||
007e46b135 | |||
b75e153a1a | |||
174737a4a4 | |||
76d24311f0 | |||
95e85be5de | |||
3bb8fc6d76 | |||
2aa12d057c | |||
|
816118633d | ||
c8e2828043 | |||
167d69e564 | |||
b155c84cfc | |||
2b98f98b1c |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
.DS_Store
|
246
npm-shrinkwrap.json
generated
246
npm-shrinkwrap.json
generated
@@ -1,125 +1,125 @@
|
|||||||
{
|
{
|
||||||
"name": "@technicolor-creamsicle/osselbot",
|
"name": "@technicolor-creamsicle/osselbot",
|
||||||
"version": "2.0.4",
|
"version": "2.1.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/collection": {
|
"@discordjs/collection": {
|
||||||
"version": "0.1.5",
|
"version": "0.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz",
|
||||||
"integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw=="
|
"integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw=="
|
||||||
},
|
},
|
||||||
"@discordjs/form-data": {
|
"@discordjs/form-data": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
||||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"asynckit": "^0.4.0",
|
"asynckit": "^0.4.0",
|
||||||
"combined-stream": "^1.0.8",
|
"combined-stream": "^1.0.8",
|
||||||
"mime-types": "^2.1.12"
|
"mime-types": "^2.1.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"abort-controller": {
|
"abort-controller": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
||||||
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"event-target-shim": "^5.0.0"
|
"event-target-shim": "^5.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"asynckit": {
|
"asynckit": {
|
||||||
"version": "0.4.0",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||||
},
|
},
|
||||||
"combined-stream": {
|
"combined-stream": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"delayed-stream": "~1.0.0"
|
"delayed-stream": "~1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"delayed-stream": {
|
"delayed-stream": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||||
},
|
},
|
||||||
"discord.js": {
|
"discord.js": {
|
||||||
"version": "12.2.0",
|
"version": "12.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.2.0.tgz",
|
||||||
"integrity": "sha512-Ueb/0SOsxXyqwvwFYFe0msMrGqH1OMqpp2Dpbplnlr4MzcRrFWwsBM9gKNZXPVBHWUKiQkwU8AihXBXIvTTSvg==",
|
"integrity": "sha512-Ueb/0SOsxXyqwvwFYFe0msMrGqH1OMqpp2Dpbplnlr4MzcRrFWwsBM9gKNZXPVBHWUKiQkwU8AihXBXIvTTSvg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@discordjs/collection": "^0.1.5",
|
"@discordjs/collection": "^0.1.5",
|
||||||
"@discordjs/form-data": "^3.0.1",
|
"@discordjs/form-data": "^3.0.1",
|
||||||
"abort-controller": "^3.0.0",
|
"abort-controller": "^3.0.0",
|
||||||
"node-fetch": "^2.6.0",
|
"node-fetch": "^2.6.0",
|
||||||
"prism-media": "^1.2.0",
|
"prism-media": "^1.2.0",
|
||||||
"setimmediate": "^1.0.5",
|
"setimmediate": "^1.0.5",
|
||||||
"tweetnacl": "^1.0.3",
|
"tweetnacl": "^1.0.3",
|
||||||
"ws": "^7.2.1"
|
"ws": "^7.2.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"event-target-shim": {
|
"event-target-shim": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
||||||
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
|
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
|
||||||
},
|
},
|
||||||
"mime-db": {
|
"mime-db": {
|
||||||
"version": "1.44.0",
|
"version": "1.44.0",
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
|
||||||
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
|
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
|
||||||
},
|
},
|
||||||
"mime-types": {
|
"mime-types": {
|
||||||
"version": "2.1.27",
|
"version": "2.1.27",
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
|
||||||
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
|
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"mime-db": "1.44.0"
|
"mime-db": "1.44.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"n": {
|
"n": {
|
||||||
"version": "6.5.1",
|
"version": "6.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/n/-/n-6.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/n/-/n-6.5.1.tgz",
|
||||||
"integrity": "sha512-CSDShHuBlYHfS5PR4BxwkZYNrDnc3B7GCRdAhSvnzl681Pd4Y4qOOTWQqjB8Cp6gYOIQI9qJxLK0Q1YI4xO2Kg=="
|
"integrity": "sha512-CSDShHuBlYHfS5PR4BxwkZYNrDnc3B7GCRdAhSvnzl681Pd4Y4qOOTWQqjB8Cp6gYOIQI9qJxLK0Q1YI4xO2Kg=="
|
||||||
},
|
},
|
||||||
"node-fetch": {
|
"node-fetch": {
|
||||||
"version": "2.6.0",
|
"version": "2.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||||
},
|
},
|
||||||
"parse-ms": {
|
"parse-ms": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz",
|
||||||
"integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA=="
|
"integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA=="
|
||||||
},
|
},
|
||||||
"pretty-ms": {
|
"pretty-ms": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-6.0.1.tgz",
|
||||||
"integrity": "sha512-ke4njoVmlotekHlHyCZ3wI/c5AMT8peuHs8rKJqekj/oR5G8lND2dVpicFlUz5cbZgE290vvkMuDwfj/OcW1kw==",
|
"integrity": "sha512-ke4njoVmlotekHlHyCZ3wI/c5AMT8peuHs8rKJqekj/oR5G8lND2dVpicFlUz5cbZgE290vvkMuDwfj/OcW1kw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"parse-ms": "^2.1.0"
|
"parse-ms": "^2.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"prism-media": {
|
"prism-media": {
|
||||||
"version": "1.2.2",
|
"version": "1.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.2.tgz",
|
||||||
"integrity": "sha512-I+nkWY212lJ500jLe4tN9tWO7nRiBAVdMv76P9kffZjYhw20raMlW1HSSvS+MLXC9MmbNZCazMrAr+5jEEgTuw=="
|
"integrity": "sha512-I+nkWY212lJ500jLe4tN9tWO7nRiBAVdMv76P9kffZjYhw20raMlW1HSSvS+MLXC9MmbNZCazMrAr+5jEEgTuw=="
|
||||||
},
|
},
|
||||||
"setimmediate": {
|
"setimmediate": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
||||||
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
|
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
|
||||||
},
|
},
|
||||||
"tweetnacl": {
|
"tweetnacl": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
|
||||||
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
|
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
|
||||||
},
|
},
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "7.3.0",
|
"version": "7.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz",
|
||||||
"integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w=="
|
"integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,2 @@
|
|||||||
const { ShardingManager } = require('discord.js');
|
|
||||||
const manager = new ShardingManager('./bot.js', { token: 'Njc4MDkzNjY4NzcwNTEyOTE3.XkdyyA.6n4wvPmzOw-fwuysEoTPU8Cv2x0' });
|
|
||||||
|
|
||||||
manager.spawn();
|
DEPRICATED
|
||||||
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@technicolor-creamsicle/osselbot",
|
"name": "@technicolor-creamsicle/osselbot",
|
||||||
"version": "2.0.4",
|
"version": "2.1.0",
|
||||||
"description": "A discord bot on Discord.js",
|
"description": "A discord bot on Discord.js",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node ./src/index --TEST",
|
"test": "node ./src/index --TEST",
|
||||||
"start": "npm install; node ./src/index.js"
|
"start": "node ./src/index.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
1
quotes.json
Normal file
1
quotes.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"quotes":["you can add quotes by running ?quote add <person> Quote goes here","techt parm arm zarm","<@!258325046869622785> I HATE JS."]}
|
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"token" : "Njc4MDkzNjY4NzcwNTEyOTE3.Xr7SNw.XS_D_dEJ7hX6N5Rmnfr_OQpfznU",
|
"token" : "Njc4MDkzNjY4NzcwNTEyOTE3.Xr7SNw.XS_D_dEJ7hX6N5Rmnfr_OQpfznU",
|
||||||
"prefix" : ";"
|
"prefix" : "?"
|
||||||
}
|
}
|
||||||
|
84
src/index.js
84
src/index.js
@@ -2,29 +2,50 @@
|
|||||||
// Load up the libraries
|
// Load up the libraries
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const prettyMilliseconds = require('pretty-ms');
|
const prettyMilliseconds = require('pretty-ms');
|
||||||
|
const fs = require('fs');
|
||||||
|
const homedir = require('os').homedir;
|
||||||
|
const info = require("../package.json")
|
||||||
|
//importing files
|
||||||
const config = require("./config.json");
|
const config = require("./config.json");
|
||||||
// This is the client
|
// This is making clients
|
||||||
const client = new Discord.Client();
|
const client = new Discord.Client();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function activity() {
|
||||||
|
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||||
|
};
|
||||||
|
|
||||||
client.on("ready", () => {
|
client.on("ready", () => {
|
||||||
// This event will run if the bot starts, and logs in, successfully.
|
// This event will run if the bot starts, and logs in, successfully.
|
||||||
console.log(`Bot has started, with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`);
|
console.log(`Bot has started, with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`);
|
||||||
// Example of changing the bot's playing game to something useful. `client.user` is what the
|
// Example of changing the bot's playing game to something useful. `client.user` is what the
|
||||||
// docs refer to as the "ClientUser".
|
// docs refer to as the "ClientUser".
|
||||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
activity();
|
||||||
});
|
});
|
||||||
//Updates people count
|
//Updates people count
|
||||||
client.on('guildMemberAdd', member => {
|
client.on('guildMemberAdd', member => {
|
||||||
console.log(`New member joined: ${member.name} (id: ${member.id}).`);
|
console.log(`New member joined: ${member.name} (id: ${member.id}).`);
|
||||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
activity();
|
||||||
});
|
});
|
||||||
client.on('guildMemberRemove', member => {
|
client.on('guildMemberRemove', member => {
|
||||||
console.log(` member left: ${member.name} (id: ${member.id}).`);
|
console.log(` member left: ${member.name} (id: ${member.id}).`);
|
||||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
activity();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setInterval(activity, 300000);
|
||||||
|
|
||||||
////// ACTUAL MESSAGE PROCESSING
|
////// ACTUAL MESSAGE PROCESSING
|
||||||
client.on("message", async message => {
|
client.on("message", async message => {
|
||||||
//stops bots from activating the Osselbot
|
//stops bots from activating the Osselbot
|
||||||
//Message processing
|
//Message processing
|
||||||
|
|
||||||
|
if(message.content.toLowerCase().includes('nigg',"niglet","negro","fag","f4g","n1gg","gg3r")) {
|
||||||
|
message.delete();
|
||||||
|
return message.reply(`Listen here cum-sock we dont appeciate that here ${message.member}. If you gonna be like that you may just well end up in the JAR and we all know how that ends...`)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(message.author.bot) return;
|
if(message.author.bot) return;
|
||||||
if(message.content.indexOf(config.prefix) !== 0) return;
|
if(message.content.indexOf(config.prefix) !== 0) return;
|
||||||
// Here we separate our "command" name, and our "arguments" for the command.
|
// Here we separate our "command" name, and our "arguments" for the command.
|
||||||
@@ -54,13 +75,14 @@ client.on("message", async message => {
|
|||||||
if (command === "stats") {
|
if (command === "stats") {
|
||||||
let embed = new Discord.MessageEmbed()
|
let embed = new Discord.MessageEmbed()
|
||||||
.setTitle('Stats')
|
.setTitle('Stats')
|
||||||
|
.setAuthor("Osselbot", "https://cdn.discordapp.com/attachments/597814181084921866/711843993914310656/animated-beach-balls-29.gif")
|
||||||
.setColor(0x195080)
|
.setColor(0x195080)
|
||||||
.setDescription(`\
|
.setDescription(`\
|
||||||
**Stats for 0SSELB0T** \n \
|
**Stats for 0SSELB0T** \n \
|
||||||
**Uptime:** ${prettyMilliseconds(client.uptime)} \n \
|
**Uptime:** ${prettyMilliseconds(client.uptime)} \n \
|
||||||
**Started at:** ${client.readyAt} \n \
|
**Started at:** ${client.readyAt} \n \
|
||||||
**People:** ${client.users.cache.size}\
|
**People:** ${client.users.cache.size}`)
|
||||||
`);
|
.setFooter(`osselbot v${info.version} run version for full info`);
|
||||||
return message.channel.send(embed);
|
return message.channel.send(embed);
|
||||||
};
|
};
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -93,7 +115,7 @@ client.on("message", async message => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(command === "squad") {
|
if(command === "squad") {
|
||||||
min = Math.ceil(0);
|
min = Math.ceil(0);
|
||||||
max = Math.floor(11);
|
max = Math.floor(11);
|
||||||
let rate = Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
|
let rate = Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
|
||||||
return message.reply(`The squad rates this ${rate} out of 10`);
|
return message.reply(`The squad rates this ${rate} out of 10`);
|
||||||
@@ -118,31 +140,55 @@ client.on("message", async message => {
|
|||||||
// makes the bot say something and delete the message. As an example, it's open to anyone to use.
|
// 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:
|
// To get the "message" itself we join the `args` back into a string with spaces:
|
||||||
const sayMessage = args.join(" ");
|
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 (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.
|
// Then we delete the command message (sneaky, right?). The catch just ignores the error with a cute smiley thing.
|
||||||
message.delete().catch(O_o=>{});
|
message.delete().catch(O_o=>{});
|
||||||
// And we get the bot to say the thing:
|
// And we get the bot to say the thing:
|
||||||
return message.channel.send(sayMessage);
|
return message.channel.send(sayMessage);
|
||||||
}
|
|
||||||
else {
|
|
||||||
return message.channel.send("Im sorry but we cant have nice things...")
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
if(command === "quote") {
|
||||||
|
|
||||||
|
let quotes = require(`${homedir}/quotes.json`);
|
||||||
|
var quoteadd = "";
|
||||||
|
var selector;
|
||||||
|
try{
|
||||||
|
selector = args[0].toLowerCase();
|
||||||
|
} catch (err) {
|
||||||
|
var number = quotes.quotes.length + 1;
|
||||||
|
let quotesend = Math.floor(Math.random() * (number - 0) + 0);
|
||||||
|
return message.channel.send(`${quotes.quotes[quotesend]}`);
|
||||||
|
};
|
||||||
|
if(selector === "add") {
|
||||||
|
if (!(message.member.roles.cache.some(r => ["Admin","Mods","Member of the Order","Botmeister","Ally of the Order","say"].includes(r.name)))) return message.reply("Ask someone with the quote role to add that.")
|
||||||
|
args.shift();
|
||||||
|
//This does logic to make it from an array to a nice string.
|
||||||
|
quoteadd = args.join(' ');
|
||||||
|
quotes.quotes.push(quoteadd)
|
||||||
|
fs.writeFile(`${homedir}/quotes.json`, JSON.stringify(quotes, null, 2), (err) => {
|
||||||
|
if (err) return message.reply("Something went wrong");``
|
||||||
|
client.channels.cache.get('712084662033580064').send(`${message.member} has submitted \`${quoteadd}\` to the quote repository`);
|
||||||
|
return message.reply("Quote added to repository");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return message.reply("you can add quotes by running `?quote add <person> Quote goes here`");
|
||||||
|
};
|
||||||
|
};
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
if (command === "version") {
|
if (command === "version") {
|
||||||
return message.channel.send("``` ________________________________________\n \
|
return message.channel.send(`\`\`\`\
|
||||||
< @technicolor-creamsicle/osselbot@2.0.4 >\n \
|
________________________________________\n \
|
||||||
|
< @technicolor-creamsicle/osselbot@v${info.version}>\n \
|
||||||
----------------------------------------\n \
|
----------------------------------------\n \
|
||||||
\\ ^__^\n \
|
\\ ^__^\n \
|
||||||
\\ (oo)\\_______\n \
|
\\ (oo)\\_______\n \
|
||||||
(__)\\ )\\/\\\n \
|
(__)\\ )\\/\\\n \
|
||||||
||----w |\n \
|
||----w |\n \
|
||||||
|| ||\n \
|
|| ||\n \
|
||||||
```")
|
\`\`\``)
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user