Compare commits

...

99 Commits

Author SHA1 Message Date
Alex 8831641bce remove idea files 2020-11-23 23:04:37 -05:00
Alex c03c964ac0 I did something partaining to ssh deployment
Took 1 minute
2020-08-28 13:02:39 -04:00
Alex 889f62d66f I did something...
Took 2 hours 27 minutes
2020-08-28 13:01:17 -04:00
Alex 352d001dc2 Merge branch 'master' of https://github.com/Technicolor-creamsicle/Osselbot 2020-07-15 16:05:08 -05:00
Alex 0801ef2ea6
Delete .replit 2020-07-15 09:44:29 -05:00
Alex 4a465bbe95
Delete .npmrc 2020-07-15 09:44:03 -05:00
Alex 7caf8524cb
Delete npmpublish.yml 2020-07-15 09:20:39 -05:00
Alex a19bb6b17e
Update README.md 2020-07-15 09:19:40 -05:00
Alex 178f93ad3f idk what Idea is doing but its doing something 2020-07-14 14:27:43 -05:00
Alex adc258fb1d Changine help location 2020-07-14 14:04:26 -05:00
Alex 4152a32ef7 Merge remote-tracking branch 'origin/master' 2020-07-14 14:00:54 -05:00
Alex 494f345d05 Converting to google JS specs 2020-07-14 13:57:24 -05:00
Alex 09fbe7a5d7
Update README.md 2020-07-14 13:47:48 -05:00
Alex 26a1cf9571
Update config.json 2020-07-14 13:45:11 -05:00
Alex 79cc4838e4
Create config.json 2020-07-14 13:42:53 -05:00
Alex 5a83b5097d Converting to google JS specs 2020-07-14 13:35:59 -05:00
Alex ffb9e943a5 pain 2020-07-13 14:49:35 -05:00
Alex ab91e14dfc pain 2020-07-13 14:48:45 -05:00
Alex 7a96ffe960 Hi John 2020-07-13 13:39:16 -05:00
Alex 0c9954a41f UwU 2020-07-12 17:58:26 -05:00
Alex aeb04580e0 UwU 2020-07-12 17:53:39 -05:00
Alex 980161af4c UwU 2020-07-12 17:48:47 -05:00
Alex 14cd7fd7c9 Merge remote-tracking branch 'origin/master' 2020-07-12 17:45:23 -05:00
Alex e334febf08
Create config.json 2020-07-12 17:36:09 -05:00
Alex f5bbbdf533 UwU 2020-07-12 15:41:43 -05:00
Alex 9f16f04e20 Merge remote-tracking branch 'origin/master' 2020-07-12 15:40:08 -05:00
Alex 3573141963
Delete config.json 2020-07-12 15:39:58 -05:00
Alex 97970c23f8 UwU 2020-07-12 15:36:42 -05:00
Alex 0796d13937 UwU 2020-07-12 15:07:04 -05:00
Alex a3fe0af8ad Commit message 2020-07-12 13:52:25 -05:00
Alex 8544676e74 I seem to be more productive recently 2020-07-12 13:42:01 -05:00
Alex 35576298e8 YEET! 2020-07-12 03:03:29 -05:00
Alex f900652347 YEET! 2020-07-12 00:40:41 -05:00
Alex 51fdae02d6 MMM 2020-07-11 17:20:36 -05:00
Alex 84d1b62309 adding some more verbal abuse 2020-07-10 22:59:38 -05:00
Alex e2b95f5aec fixed the ping command 2020-07-10 20:15:30 -05:00
Alex deb0118652 egg 2020-07-08 16:19:35 -05:00
Alex 601dc1755a WoW iM sTuPiD 2020-07-08 12:42:59 -05:00
Alex a8abbd0174 fix? 2020-07-08 00:44:59 -05:00
Alex a3dde7383a Merge branch 'master' of https://github.com/Technicolor-creamsicle/Osselbot 2020-07-08 00:27:13 -05:00
Alex 15badc68c8 fix error 2020-07-07 21:25:19 -05:00
Alex ea85a8da9e LJbvdihbnaqp'nm 2020-07-07 03:36:32 +00:00
Alex 85398fc4e0 faufn] 2020-06-30 00:11:26 -05:00
Alex 0c14891aba aaaa 2020-06-18 23:53:53 -05:00
Alex a9cf34717b fumck 2020-06-18 12:09:29 -05:00
Alex 03a9b72247 padres? 2020-06-18 11:48:13 -05:00
Alex d82de68c70 Im done for right now 2020-06-18 03:45:40 -05:00
Alex 7af1e4b483 pog 2020-06-18 03:16:08 -05:00
Alex e5a0077ff4 pogger 2020-06-18 03:12:52 -05:00
Alex 136b88a77d poggers 2020-06-18 02:06:34 -05:00
Alex e86016c322 Update package.json 2020-06-13 22:51:49 -05:00
Alex 4a59ad7103 Update index.js 2020-06-13 22:16:58 -05:00
Alex 349ad4d926 Update index.js 2020-06-13 22:15:18 -05:00
Alex 1b7dcedca2 Update index.js 2020-05-27 11:07:17 -05:00
Alex cedf3c6d72 Update index.js 2020-05-26 19:23:04 -05:00
Alex 4e334c1459 Update index.js 2020-05-26 19:04:50 -05:00
Alex dad83d5001 the magic of repl 2020-05-26 22:26:31 +00:00
Alex 8a1bc2137b egg 2020-05-26 17:09:56 -05:00
Alex c6fb55a097 egg 2020-05-25 20:27:26 -05:00
Alex 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
Alex c15ddaa8ed fuck tgis 2020-05-25 20:10:21 -05:00
Alex 275493b0f5 it works 2020-05-26 01:09:55 +00:00
Alex 3a84baa944 ah 2020-05-26 00:04:04 +00:00
Alex 4a7e7ea431 erghjnm 2020-05-25 18:50:53 -05:00
Alex b28ed796d6 hjgcljcgultd 2020-05-25 18:31:53 -05:00
Alex 9239d10a6f asdfghjk 2020-05-25 18:31:10 -05:00
Alex abb41e182e fuck you gamma 2020-05-25 18:17:55 -05:00
Alex 02f9f7e643 look at this 2020-05-25 18:06:00 -05:00
Alex fdb14602c3 ah 2020-05-25 17:32:35 -05:00
Alex 007e46b135 Take a look if you wish 2020-05-25 16:23:31 -05:00
Alex b75e153a1a a 2020-05-25 13:25:58 -05:00
Alex 174737a4a4 ah 2020-05-25 12:41:39 -05:00
Alex 76d24311f0 thats why that brke 2020-05-24 14:07:29 -05:00
Alex 95e85be5de ag 2020-05-24 14:05:56 -05:00
Alex 3bb8fc6d76 fuck google api 2020-05-24 01:47:11 -05:00
Alex 2aa12d057c ah
this sucks
2020-05-24 00:56:39 -05:00
Alex Brow 816118633d
aaaa 2020-05-24 00:26:36 -05:00
Alex c8e2828043 more 2.1.0 2020-05-18 14:22:09 -05:00
Alex 167d69e564 2.1.0 Because versioning is wack 2020-05-18 14:20:50 -05:00
Alex b155c84cfc Merge branch 'master' of https://github.com/Technicolor-creamsicle/Osselbot 2020-05-18 13:58:00 -05:00
Alex 7ff29383a2
Update package.json 2020-05-18 13:51:34 -05:00
Alex 2b98f98b1c 2.0.4 FINAL 2020-05-18 13:51:01 -05:00
Alex 41d0ad4f58 the egg behind the egg 2020-05-18 13:06:35 -05:00
Alex 793239ed36 2.0.4-alpha release 2020-05-18 03:01:47 -05:00
Alex 000a629bff thanks 2020-05-18 03:00:05 -05:00
Alex be11882ba4 not actaully doing a release yet cause i can 2020-05-18 02:58:12 -05:00
Alex cc72efadce 2.0.4-alpha 2020-05-18 01:13:37 -05:00
Alex f490760d11 so help me god
BUILD CORRECTLY
2020-05-18 01:13:17 -05:00
Alex b3b6da7775 actually had to make index executable 2020-05-17 14:19:02 -05:00
Alex 51b5d48d4a allow npx install 1 command install and run 2020-05-17 13:57:03 -05:00
Alex 2825436969 release 2.0.3 2020-05-17 13:08:09 -05:00
Alex Brow ccb79f1233
Merge branch 'master' of github.com:Technicolor-creamsicle/Osselbot 2020-05-17 03:29:56 -04:00
Alex Brow 866756dfb2
eee 2020-05-17 03:28:09 -04:00
Alex 9cef57c075
Create nodejs.yml 2020-05-17 03:12:35 -04:00
Alex Brow e0d2b5d291
lego? 2020-05-17 02:59:12 -04:00
Alex 80c6a2fe8c
Create npmpublish.yml 2020-05-17 02:39:28 -04:00
Alex 5c2692b660 nfnfnfnnfnfnfn 2020-05-15 16:51:26 -05:00
15 changed files with 395 additions and 490 deletions

29
.github/workflows/nodejs.yml vendored Normal file
View File

@ -0,0 +1,29 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test

2
.gitignore vendored
View File

@ -1 +1,3 @@
node_modules/
.DS_Store
/src/config.json

View File

@ -1,5 +1,28 @@
# Osselbot
A bot that is kinda stupid but it works surprisingly well
A bot that is kinda stupid, but it works surprisingly well
![Node.js CI](https://github.com/Technicolor-creamsicle/Osselbot/workflows/Node.js%20CI/badge.svg)
![Docker Image CI](https://github.com/Technicolor-creamsicle/Osselbot/workflows/Docker%20Image%20CI/badge.svg)
**THIS BOT REQUIRES HEAVY MODIFICATION TO WORK ON OTHER SERVERS!**
**NPM PACKAGE IS NO LONGER MAINTAINED**
Example config.js to be placed in /src
```json
{
"token" : "API KEY",
"prefix": "?",
"verbalabuse": [
"Quotes",
"to insult.",
"your members."
]
}
```
---
# Contributing
If your a member of civilians all partying then talk to @Technicolor Creamsicle#0773
This code follows the Google JS specs for code formatting.
If you use the WebStorm IDE this will automatically be applied.

View File

@ -1,2 +0,0 @@
#!/usr/bin/env bash
#logs in as Alex

1
docs/index.md Normal file
View File

@ -0,0 +1 @@
# Welcome to the osselbot help docs

8
npm-shrinkwrap.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@technicolor-creamsicle/osselbot",
"version": "1.1.0",
"version": "2.1.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -79,9 +79,9 @@
}
},
"n": {
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/n/-/n-6.5.1.tgz",
"integrity": "sha512-CSDShHuBlYHfS5PR4BxwkZYNrDnc3B7GCRdAhSvnzl681Pd4Y4qOOTWQqjB8Cp6gYOIQI9qJxLK0Q1YI4xO2Kg=="
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/n/-/n-6.6.0.tgz",
"integrity": "sha512-Yk2z0OQKDCmDyBHltJRg2RsxPsdc2DHcM8fFN21j1rzqior+FifdqhvcbZ+k00EgiSvR6p8+s9whWLwvzSeqcw=="
},
"node-fetch": {
"version": "2.6.0",

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
echo "Updating"
#Update Node Based stuff
cd /home/ec2-user/github/Osselbot/
nvm node
npm upgrade
#update code
git pull --force
#Starts the bot
cd ./src
echo "STARTING"
node index.js

View File

@ -1,286 +0,0 @@
// Here we load the config.json file that contains our token and our prefix values.
const config = require("./config.json");
// config.token contains the bot's token
// config.prefix contains the message prefix.
//Activity setting
client.on('guildMemberAdd', member => {
console.log(`New member joined: ${member.name} (id: ${member.id}).`);
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
});
client.on('guildMemberRemove', member => {
console.log(` member left: ${member.name} (id: ${member.id}).`);
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
});
client.on("guildDelete", guild => {
// this event triggers when the bot is removed from a guild.
console.log(`I have been removed from: ${guild.name} (id: ${guild.id})`);
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
});
//Actual command stuff
client.on("message", async message => {
// This event will run on every single message received, from any channel or DM.
// It's good practice to ignoe other bots. This also makes your bot ignore itself
// and not get into a spam loop (we call that "botception ").
if(message.author.bot) return;
//people are assholes so this blocks it!
if(message.content.toLowerCase().includes('nigger',"nigga","niglet","nigglet")){
message.member.roles.add('654366653093642241').catch(console.error);
message.member.roles.remove('514254335425773589').catch(console.error);
console.log(`${message.member} has been detained`)
return message.reply('Member has been D E T A I N E D <:yikes:632660765878255636>')
}
// Also good practice to ignore any message that does not start with our prefix,
// which is set in the configuration file.
if(message.content.indexOf(config.prefix) !== 0) return;
// Here we separate our "command" name, and our "arguments" for the command.
// e.g. if we have the message "+say Is this the real life?" , we'll get the following:
// command = say
// args = ["Is", "this", "the", "real", "life?"]
const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
// Let's go with a few common example commands! Feel free to delete or change those.
if(command === "ping") {
// Calculates ping between sending a message and editing it, giving a nice round-trip latency.
// The second ping is an average latency between the bot and the websocket server (one-way, not round-trip)
const m = await message.channel.send("Ping?");
m.edit(`Pong! Latency is ${m.createdTimestamp - message.createdTimestamp}ms`);
}
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 of the b l u e","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...")
}
}
if(command === "kick") {
// This command must be limited to mods and admins. In this example we just hardcode the role names.
// Please read on Array.some() to understand this bit:
// https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/some?
if(!message.member.roles.cache.some(r=>["Admin", "Moderator","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
return message.reply("Sorry, you don't have permissions to use this!");
// Let's first check if we have a member and if we can kick them!
// message.mentions.members is a collection of people that have been mentioned, as GuildMembers.
// We can also support getting the member by ID, which would be args[0]
let member = message.mentions.members.first() || message.guild.members.get(args[0]);
if(!member)
return message.reply("Please mention a valid member of this server");
if(!member.kickable)
return message.reply("I cannot kick this user! Do they have a higher role? Do I have kick permissions?");
// slice(1) removes the first part, which here should be the user mention or ID
// join(' ') takes all the various parts to make it a single string.
let reason = args.slice(1).join(' ');
if(!reason) reason = "No reason provided";
// Now, time for a swift kick in the nuts!
await member.kick(reason)
.catch(error => message.reply(`Sorry ${message.author} I couldn't kick because of : ${error}`));
message.reply(`${member.user.tag} has been kicked by ${message.author.tag} because: ${reason}`);
}
if(command === "ban") {
// Most of this command is identical to kick, except that here we'll only let admins do it.
// In the real world mods could ban too, but this is just an example, right? ;)
if(!message.member.roles.cache.some(r=>["Administrator","Member of the Order of the b l u e"].includes(r.name)) )
return message.reply("Sorry, you don't have permissions to use this!");
let member = message.mentions.members.first();
if(!member)
return message.reply("Please mention a valid member of this server");
if(!member.bannable)
return message.reply("I cannot ban this user! Do they have a higher role? Do I have ban permissions?");
let reason = args.slice(1).join(' ');
if(!reason) reason = "No reason provided";
await member.ban(reason)
.catch(error => message.reply(`Sorry ${message.author} I couldn't ban because of : ${error}`));
message.reply(`${member.user.tag} has been banned by ${message.author.tag} because: ${reason}`);
}
if(command === "purge") {
//Vibe check
if(!message.member.roles.cache.some(r=>["Admin","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
return message.reply("Sorry, you don't have permissions to use this!");
// This command removes all messages from all users in the channel, up to 100.
else {
// get the delete count, as an actual number.
const deleteCount = parseInt(args[0], 10);
// Ooooh nice, combined conditions. <3
if(!deleteCount || deleteCount < 2 || deleteCount > 100)
return message.reply("Please provide a number between 2 and 100 for the number of messages to delete");
// So we get our messages, and delete them. Simple enough, right?
const fetched = await message.channel.messages.fetch({limit: deleteCount});
message.channel.bulkDelete(fetched)
.catch(error => message.reply(`Couldn't delete messages because of: ${error}`));
}
};
if(command === "detain") {
//For Civilians all partying
if(!message.member.roles.cache.some(r=>["Admin","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
return message.reply("Sorry, you don't have permissions to use this!");
let member = message.mentions.members.first();
if(!member)
return message.reply("Please mention a valid member of this server");
else {
member.roles.add('654366653093642241').catch(console.error);
member.roles.remove('514254335425773589').catch(console.error);
return message.reply("Member has been D E T A I N E D<:yikes:632660765878255636>\n**DEFCON** level increased\nGod Bless their souls")
}
}
if(command === "retain") {
//For Civilians all partying
if(!message.member.roles.cache.some(r=>["Admin","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
return message.reply("Sorry, you don't have permissions to use this!");
let member = message.mentions.members.first();
if(!member)
return message.reply("Please mention a valid member of this server");
else {
member.roles.add('514254335425773589').catch(console.error);
member.roles.remove('654366653093642241').catch(console.error);
return message.reply("Member has been R E T A I N E D <:MilkTurtle:628399622678773760>")
}
}
// HERE COMES SHITTY COMMANDS MADE BY YOURS TRUELY
if(command === 'help') {
return message.reply('https://technicolor.2a03.party/bot/');
};
if(command === "rand") {
//Generates random number between 1-100
min = Math.ceil(0);
max = Math.floor(101);
return message.channel.send(Math.floor(Math.random() * (max - min)) + min); //The maximum is exclusive and the minimum is inclusive
};
if(command === "oath") {
return message.reply("The cadet oath is as follows.\nI pledge that I will serve faithfully in the Civil Air Patrol cadet program. That I will attend meetings regularly, wear my uniform properly, obey my officers, and advance my education and training rapidly to prepare myself to be of service to my community state and nation.");
};
if(command === "ask") {
return message.channel.send("Dont Ask, Just ask!\n https://iki.fi/sol/dontask.html")
};
if(command === "damage") {
return message.channel.send("https://cdn.discordapp.com/attachments/619631814696239142/678467158660874270/ohmydamage.mov")
};
if(command === "osseley") {
return message.channel.send("Ohhh Osseley,\n how I missed you sooo much \nOne of these days...")
};
if(command === "psych") {
return message.channel.send("Rules for finding a psychopath: \n1. Favorite color is orange \n2. Likes the left burners, worse if its top left\n3. Calls pizza sauce/tomato sauce gravy\n4. Doesnt like salad\n5. Likes country music\n6. Makes hot chocolate with water\n7. Likes black licorice")
};
if(command === "squad") {
min = Math.ceil(0);
max = Math.floor(11);
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`);
};
if(command === "magic") {
return message.channel.send("Do you believe in magic in a young girl\'s heart\nHow the music can free her, whenever it starts\nAnd it\'s magic, if the music is groovy\nIt makes you feel happy like an old-time movie\nI\'ll tell you about the magic, and it\'ll free your soul\nBut it\'s like trying to tell a stranger bout \'rock and roll\'")
}
if(command === "simp") {
if(!message.member.roles.cache.some(r=>["Admin", "Moderator","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
return message.reply("Sorry, you don't have permissions to use this!");
let embed = new Discord.MessageEmbed()
.setTitle("SIMP Alert")
.setURL("https://www.youtube.com/watch?v=c3m4Q07TkMk")
.setColor(0x195080)
.setDescription("__**ALERT**__ SIMP detected!")
.setImage("https://vignette.wikia.nocookie.net/disney/images/6/64/Kronk_.jpg/revision/latest?cb=20160720194635")
.setTimestamp()
message.channel.send({embed})
}
//DEFCON Roles
if(command === "defcon") {
//5 levels till ban
if(!message.member.roles.cache.some(r=>["Admin","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
return message.reply("Sorry, you don't have permissions to use this!");
else {
let member = message.mentions.members.first();
var role = "";
switch(parseInt(args[1],10)) {
case 5:
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 5`);
member.roles.add(role);
break;
case 4:
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 4`);
member.roles.add(role);
break;
case 3:
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 3`);
member.roles.add(role);
break;
case 2:
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 2`);
member.roles.add(role);
break;
case 1:
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 1`);
member.roles.add(role);
break;
default:
return message.reply(`DEFCON not set is ${args[1]} a number between 1-5?`)
};
return message.reply(`\n**DEFCON** level set to DEFCON ${args[1]}\nGod Bless their souls`)
};
};
if (command === "fix") {
if(message.member.roles.cache.some(r=>["Botmeister"].includes(r.name))) {
return message.channel.send("I guess it\'s my fault will fix.");
};
return;
};
if (command === "stats") {
let embed = new Discord.MessageEmbed()
.setTitle('Stats')
.setColor(0x195080)
.setDescription(`\
**Stats for 0SSELB0T** \n \
**Uptime:** ${prettyMilliseconds(client.uptime)} \n \
**Started at:** ${client.readyAt} \n \
**People:** ${client.users.cache.size}\
`);
return message.channel.send(embed);
};
if (command === "reboot"){
function shutdown(){
client.destroy();
process.exit(69);
}
if (message.author.id === '216042720047661057') {
message.reply("**Authenticated**, Restarting now.");
client.user.setActivity(`Itself die`,{ type: 'WATCHING' });
setTimeout(shutdown, 5000, 'shutdown');
}
else {
return message.reply("No");
};
};
});
client.login(config.token)

View File

@ -1,17 +0,0 @@
[Unit]
Description="Osselbot coded for civilians all partying"
[Service]
Type=simple
ExecStart=/home/ec2-user/Osselbot/src/bot-start.sh
Restart=on-failure
RestartSec=5s
User=ec2-user
# Note Debian/Ubuntu uses 'nogroup', RHEL/Fedora uses 'nobody'
Group=nobody
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/home/ec2-user/Osselbot/src/
[Install]
WantedBy=multi-user.target

View File

@ -1,5 +0,0 @@
const { ShardingManager } = require('discord.js');
const manager = new ShardingManager('./bot.js', { token: 'Njc4MDkzNjY4NzcwNTEyOTE3.XkdyyA.6n4wvPmzOw-fwuysEoTPU8Cv2x0' });
manager.spawn();
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));

7
osselbot.code-workspace Normal file
View File

@ -0,0 +1,7 @@
{
"folders": [
{
"path": "."
}
]
}

View File

@ -1,32 +1,36 @@
{
"name": "@technicolor-creamsicle/osselbot",
"version": "2.0.2-alpha",
"description": "A discord bot on Discord.js",
"main": "index.js",
"dependencies": {
"discord.js": "^12.1.1",
"n": "^6.4.0",
"pretty-ms": "^6.0.1"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
},
"files": [
"./src"
],
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npm install; node ./src/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Technicolor-creamsicle/Osselbot.git"
},
"author": "Alex Technicolor <technicolor@2a03.party> (http://technicolor.2a03.party)",
"license": "SEE LICENSE IN LICENCE",
"bugs": {
"url": "https://github.com/Technicolor-creamsicle/Osselbot/issues"
},
"homepage": "https://technicolor.2a03.party/bot"
"name": "@technicolor-creamsicle/osselbot",
"version": "2.1.2",
"description": "A discord bot on Discord.js",
"main": "index.js",
"dependencies": {
"discord.js": "^12.1.1",
"n": "^6.6.0",
"node-fetch": "^2.6.0",
"pretty-ms": "^6.0.1"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
},
"bin": {
"osselbot": "./src/index.js"
},
"files": [
"/src/"
],
"devDependencies": {},
"scripts": {
"test": "node --trace-warnings ./src/index.js --TEST",
"start": "node ./src/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Technicolor-creamsicle/Osselbot.git"
},
"author": "Alex Technicolor <technicolor@2a03.party> (http://technicolor.2a03.party)",
"license": "SEE LICENSE IN LICENCE",
"bugs": {
"url": "https://github.com/Technicolor-creamsicle/Osselbot/issues"
},
"homepage": "https://technicolor.2a03.party/bot"
}

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,9 @@
{
"token" : "Njc4MDkzNjY4NzcwNTEyOTE3.Xr7SNw.XS_D_dEJ7hX6N5Rmnfr_OQpfznU",
"prefix" : ";"
"COMMENT": "THIS IS A CONFIG FOR TESTING THE BOT",
"token" : "THIS IS AN API TOKEN",
"prefix": "?",
"verbalabuse": [
"THIS IS MEAN"
]
}

415
src/index.js Normal file → Executable file
View File

@ -1,156 +1,311 @@
#!/usr/bin/env node
// These are so I remember stuff
// Load up the libraries
const Discord = require("discord.js");
const Discord = require('discord.js');
const prettyMilliseconds = require('pretty-ms');
const config = require("./config.json");
// This is the client
const fs = require('fs');
const homedir = require('os').homedir;
const info = require('../package.json');
// Imports config file from the src dir.
const config = require('./config.json');
// This is making a client for discord
const client = new Discord.Client();
client.on("ready", () => {
// 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.`);
// Example of changing the bot's playing game to something useful. `client.user` is what the
// docs refer to as the "ClientUser".
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
// Stores the last quote
let last_quote;
function activity() {
//This function sets a status for the bot currently it is set to Do Not
// Disturb and "LISTENING to USERS of you, why do I do this to myself?"
client.user.setPresence({
activity: {
name: `${client.users.cache.size} of you, why do I do this to myself?`,
type: 'LISTENING',
},
status: 'dnd',
}).then(() => {
});
}
client.on('ready', () => {
// This event will run if the bot starts, and logs in, successfully.
// noinspection LongLine
console.log(
`Bot has started, with ${client.users.cache.size} users, in \
${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`);
activity();
});
//Updates people count
client.on('guildMemberAdd', member => {
console.log(`New member joined: ${member.name} (id: ${member.id}).`);
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
console.log(`New member joined: ${member.nickname} (id: ${member.id}).`);
activity();
});
client.on('guildMemberRemove', member => {
console.log(` member left: ${member.name} (id: ${member.id}).`);
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
console.log(` member left: ${member.nickname} (id: ${member.id}).`);
activity();
});
setInterval(activity, 300000);
////// ACTUAL MESSAGE PROCESSING
client.on("message", async message => {
//stops bots from activating the Osselbot
//Message processing
if(message.author.bot) return;
if(message.content.indexOf(config.prefix) !== 0) return;
// Here we separate our "command" name, and our "arguments" for the command.
// e.g. if we have the message "+say Is this the real life?" , we'll get the following:
client.on('message', async message => {
//stops bots from activating the Osselbot
//Message processing
// noinspection SpellCheckingInspection
if (message.content.toLowerCase().
includes('nigg' || 'negro' || 'niglet' || 'fag' || 'f4g' || 'n1gg' ||
'gg3r')) {
await message.delete();
return message.reply(
`Listen here cum-sock we dont appreciate 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...`);
}
// Reacts to messages with UwU
if (message.content.toLowerCase().includes('uwu')) await message.react(
'741755736417108071');
if (message.author.bot) return;
if (message.content.indexOf(config.prefix) !== 0) return;
// Here we separate our "command" name, and our "arguments" for the command.
// e.g. if we have the message "+say Is this the real life?" , we'll get the
// following:
// command = say
// args = ["Is", "this", "the", "real", "life?"]
const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
//////////////////////////////////////////////////////////////////////////////
//COMMAND TIME
//////////////////////////////////////////////////////////////////////////////
if (command === "reboot"){
function shutdown(){
client.destroy();
process.exit(69);
}
if (message.author.id === '216042720047661057') {
message.reply("**Authenticated**, Restarting now.");
client.user.setActivity(`Itself die`,{ type: 'WATCHING' });
setTimeout(shutdown, 5000, 'shutdown');
}
else {
return message.reply("No");
};
};
//////////////////////////////////////////////////////////////////////////////
if (command === "stats") {
let embed = new Discord.MessageEmbed()
.setTitle('Stats')
.setColor(0x195080)
.setDescription(`\
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////COMMAND TIME////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
if (command === 'stats') {
let embed = new Discord.MessageEmbed().setTitle('Stats').
setAuthor('Osselbot',
'https://cdn.discordapp.com/attachments/597814181084921866' +
'/711843993914310656/animated-beach-balls-29.gif').
setColor(0x195080).
setDescription(`\
**Stats for 0SSELB0T** \n \
**Uptime:** ${prettyMilliseconds(client.uptime)} \n \
**Started at:** ${client.readyAt} \n \
**People:** ${client.users.cache.size}\
`);
return message.channel.send(embed);
};
//////////////////////////////////////////////////////////////////////////////
if(command === "ping") {
// Calculates ping between sending a message and editing it, giving a nice round-trip latency.
const m = await message.channel.send("Ping?");
m.edit(`Pong! Latency is ${m.createdTimestamp - message.createdTimestamp}ms`);
};
//////////////////////////////////////////////////////////////////////////////
//HOW QUOTEABLE
if(command === "psych") {
return message.channel.send("Rules for finding a psychopath: \n1. Favorite color is orange \n2. Likes the left burners, worse if its top left\n3. Calls pizza sauce/tomato sauce gravy\n4. Doesnt like salad\n5. Likes country music\n6. Makes hot chocolate with water\n7. Likes black licorice")
};
**People:** ${client.users.cache.size}`).
setFooter(`osselbot v${info.version} run version for full info`);
return message.channel.send(embed);
}
//////////////////////////////////////////////////////////////////////////////
if (command === 'ping') {
// Calculates ping between sending a message and editing it, giving a
// nice round-trip latency.
const m = await message.channel.send('Ping?');
await m.edit('Pong! Latency is`' + client.ws.ping + '` ms');
}
//HOW QUOTEABLE
if (command === 'psych') {
return message.channel.send(
'Rules for finding a psychopath: \n1. Favorite color is orange \n2.' +
' Likes the left burners, worse if its top left\n3. Calls pizza' +
' sauce/tomato sauce gravy\n4. Doesnt like salad\n5.' +
' Likes country music\n6. Makes hot chocolate with water\n7. Likes' +
' black licorice');
}
if (command === 'ask') {
return message.channel.send(
'Dont Ask, Just ask!\n https://iki.fi/sol/dontask.html');
}
if (command === 'simp') {
if (!message.member.roles.cache.some(r => [
'Admin',
'Moderator',
'Botmeister'].includes(r.name)))
return message.reply('Sorry, you don\'t have permissions to use this!');
let embed = new Discord.MessageEmbed().setTitle('SIMP Alert').
setURL('https://www.youtube.com/watch?v=c3m4Q07TkMk').
setColor(0x195080).
setDescription('__**ALERT**__ SIMP detected!').
setImage(
'https://vignette.wikia.nocookie.net/disney/images/6/64/' +
'Kronk_.jpg/revision/latest?cb=20160720194635').
setTimestamp();
await message.channel.send({embed});
}
if (command === 'squad') {
let min = Math.ceil(0);
let max = Math.floor(11);
//The maximum is exclusive and the minimum is inclusive
let rate = Math.floor(Math.random() * (max - min) + min);
return message.reply(`The squad rates this ${rate} out of 10`);
}
if (command === 'magic') {
return message.channel.send(
'Do you believe in magic in a young girl\'s heart\nHow the music can' +
' free her, whenever it starts \nAnd it\'s magic, if the music is' +
' groovy\nIt makes you feel happy like an old-time movie\nI\'ll tell' +
' you about the magic, and it\'ll free your soul\nBut it\'s like ' +
'trying to tell a stranger bout \'rock and roll\'');
}
if (command === 'help') {
return message.reply('https://technicolor.2a03.party/osselbot/');
}
if (command === 'fix') {
if (message.member.roles.cache.some(
r => ['Ally of the Order'].includes(r.name))) {
return message.channel.send('I guess it\'s my fault will fix.');
}
return;
}
if (command === 'va') {
//The maximum is exclusive and the minimum is inclusive
let num = Math.floor(Math.random() * (config.verbalabuse.length + 1));
return message.reply(`${config.verbalabuse[num]}`);
}
////////////////////////////////////////////////////////////////////////////////
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 (message.content.includes('@')) {
return message.reply('haha no');
}
// Then we delete the command message (sneaky, right?). The catch just
// ignores the error with a cute smiley thing.
message.delete().catch(() => {
});
// And we get the bot to say the thing:
return message.channel.send(sayMessage);
}
}
if(command === "ask") {
return message.channel.send("Dont Ask, Just ask!\n https://iki.fi/sol/dontask.html")
};
////////////////////////////////////////////////////////////////////////////////
if (command === 'quote') {
let quotes = require(`${homedir}/quotes.json`);
let quoteadd = '';
let selector;
try {
selector = args[0].toLowerCase();
} catch (err) {
let length = quotes.quotes.length;
let quotesend = 0;
function choose() {
quotesend = Math.floor(Math.random() * (length));
console.log(quotesend);
if (last_quote === quotesend) choose();
}
choose();
last_quote = quotesend;
return message.channel.send(`${quotes.quotes[quotesend]}`);
}
if (selector === 'add') {
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') {
return message.channel.send(`\`\`\`\
________________________________________\n \
< @technicolor-creamsicle/osselbot@v${info.version}>\n \
----------------------------------------\n \
\\ ^__^\n \
\\ (oo)\\_______\n \
(__)\\ )\\/\\\n \
||----w |\n \
|| ||\n \
\`\`\``);
}
if(command === "simp") {
if(!message.member.roles.cache.some(r=>["Admin", "Moderator","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
return message.reply("Sorry, you don't have permissions to use this!");
let embed = new Discord.MessageEmbed()
.setTitle("SIMP Alert")
.setURL("https://www.youtube.com/watch?v=c3m4Q07TkMk")
.setColor(0x195080)
.setDescription("__**ALERT**__ SIMP detected!")
.setImage("https://vignette.wikia.nocookie.net/disney/images/6/64/Kronk_.jpg/revision/latest?cb=20160720194635")
.setTimestamp()
message.channel.send({embed})
};
if(command === "squad") {
min = Math.ceil(0);
max = Math.floor(11);
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`);
};
if(command === "magic") {
return message.channel.send("Do you believe in magic in a young girl\'s heart\nHow the music can free her, whenever it starts\nAnd it\'s magic, if the music is groovy\nIt makes you feel happy like an old-time movie\nI\'ll tell you about the magic, and it\'ll free your soul\nBut it\'s like trying to tell a stranger bout \'rock and roll\'");
};
if(command === 'help') {
return message.reply('https://technicolor.2a03.party/bot/');
};
if (command === "fix") {
if(message.member.roles.cache.some(r=>["Botmeister"].includes(r.name))) {
return message.channel.send("I guess it\'s my fault will fix.");
};
return;
};
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////DEFCON//////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
if(command === "defcon") {
//5 levels till ban
if(!message.member.roles.cache.some(r=>["Admin","Member of the Order of the b l u e","Botmeister"].includes(r.name)) )
return message.reply("Sorry, you don't have permissions to use this!");
else {
let member = message.mentions.members.first();
var role = "";
switch(parseInt(args[1],10)) {
case 5:
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 5`);
member.roles.add(role);
break;
case 4:
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 4`);
member.roles.add(role);
break;
case 3:
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 3`);
member.roles.add(role);
break;
case 2:
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 2`);
member.roles.add(role);
break;
case 1:
var role = message.guild.roles.cache.find(role => role.name === `DEFCON 1`);
member.roles.add(role);
break;
default:
return message.reply(`DEFCON not set is ${args[1]} a number between 1-5?`)
};
return message.reply(`\n**DEFCON** level set to DEFCON ${args[1]}\nGod Bless their souls`)
};
};
if (command === 'defcon') {
//5 levels till ban
if (!message.member.roles.cache.some(r => [
'Admin'].includes(r.name)))
return message.reply('Sorry, you don\'t have permissions to use this!');
else {
let member = message.mentions.members.first();
let role;
switch (parseInt(args[1], 10)) {
case 5:
role = message.guild.roles.cache.find(
role => role.name === `DEFCON 5`);
await member.roles.add(role);
break;
case 4:
role = message.guild.roles.cache.find(
role => role.name === `DEFCON 4`);
await member.roles.add(role);
break;
case 3:
role = message.guild.roles.cache.find(
role => role.name === `DEFCON 3`);
await member.roles.add(role);
break;
case 2:
role = message.guild.roles.cache.find(
role => role.name === `DEFCON 2`);
await member.roles.add(role);
break;
case 1:
role = message.guild.roles.cache.find(
role => role.name === `DEFCON 1`);
await member.roles.add(role);
break;
default:
return message.reply(
`DEFCON not set is ${args[1]} a number between 1-5?`);
}
return message.reply(
`\n**DEFCON** level set to DEFCON ${args[1]}\nGod Bless their souls`);
}
}
});
if (process.argv.slice(2).includes('--TEST')) {
console.log('Test Pass!');
process.exit(0);
}
//Logging in the bot
client.login(config.token)
client.login(config.token).then(() => {
console.log('Logged in');
});