30 Commits

Author SHA1 Message Date
1b7dcedca2 Update index.js 2020-05-27 11:07:17 -05:00
cedf3c6d72 Update index.js 2020-05-26 19:23:04 -05:00
4e334c1459 Update index.js 2020-05-26 19:04:50 -05:00
dad83d5001 the magic of repl 2020-05-26 22:26:31 +00:00
8a1bc2137b egg 2020-05-26 17:09:56 -05:00
c6fb55a097 egg 2020-05-25 20:27:26 -05:00
a4e30196be no more war 2020-05-25 20:24:23 -05:00
Alex
d1749c7760 Merge pull request #4 from Technicolor-creamsicle/dev
Dev
2020-05-25 20:20:48 -05:00
Alex
5a42a3e11a Merge branch 'master' into dev 2020-05-25 20:20:39 -05:00
c15ddaa8ed fuck tgis 2020-05-25 20:10:21 -05:00
275493b0f5 it works 2020-05-26 01:09:55 +00:00
3a84baa944 ah 2020-05-26 00:04:04 +00:00
4a7e7ea431 erghjnm 2020-05-25 18:50:53 -05:00
b28ed796d6 hjgcljcgultd 2020-05-25 18:31:53 -05:00
9239d10a6f asdfghjk 2020-05-25 18:31:10 -05:00
abb41e182e fuck you gamma 2020-05-25 18:17:55 -05:00
02f9f7e643 look at this 2020-05-25 18:06:00 -05:00
fdb14602c3 ah 2020-05-25 17:32:35 -05:00
007e46b135 Take a look if you wish 2020-05-25 16:23:31 -05:00
b75e153a1a a 2020-05-25 13:25:58 -05:00
174737a4a4 ah 2020-05-25 12:41:39 -05:00
76d24311f0 thats why that brke 2020-05-24 14:07:29 -05:00
95e85be5de ag 2020-05-24 14:05:56 -05:00
3bb8fc6d76 fuck google api 2020-05-24 01:47:11 -05:00
2aa12d057c ah
this sucks
2020-05-24 00:56:39 -05:00
Alex Brow
816118633d aaaa 2020-05-24 00:26:36 -05:00
c8e2828043 more 2.1.0 2020-05-18 14:22:09 -05:00
167d69e564 2.1.0 Because versioning is wack 2020-05-18 14:20:50 -05:00
b155c84cfc Merge branch 'master' of https://github.com/Technicolor-creamsicle/Osselbot 2020-05-18 13:58:00 -05:00
2b98f98b1c 2.0.4 FINAL 2020-05-18 13:51:01 -05:00
8 changed files with 196 additions and 149 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
node_modules/ node_modules/
.DS_Store

2
.replit Normal file
View File

@@ -0,0 +1,2 @@
language = "nodejs"
run = "npm start"

2
npm-shrinkwrap.json generated
View File

@@ -1,6 +1,6 @@
{ {
"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": {

View File

@@ -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}`));

View File

@@ -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
View 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."]}

View File

@@ -1,4 +1,4 @@
{ {
"token" : "Njc4MDkzNjY4NzcwNTEyOTE3.Xr7SNw.XS_D_dEJ7hX6N5Rmnfr_OQpfznU", "token" : "Njc4MDkzNjY4NzcwNTEyOTE3.Xr7SNw.XS_D_dEJ7hX6N5Rmnfr_OQpfznU",
"prefix" : ";" "prefix" : "?"
} }

View File

@@ -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);
}; };
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@@ -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);
};
////////////////////////////////////////////////////////////////////////////////
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 { else {
return message.channel.send("Im sorry but we cant have nice things...") 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 \
```") \`\`\``)
} };