Skip to content

Commit

Permalink
pre3 3.0 script preloading + fixes, better bot load
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragon1320 committed Nov 6, 2018
1 parent 7e59011 commit cf81d3a
Show file tree
Hide file tree
Showing 54 changed files with 311 additions and 22 deletions.
2 changes: 2 additions & 0 deletions src/bot/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class Command {

this.featured = options.featured;

this.preload = options.preload;

this.cb = options.cb;
this.load = options.load;
}
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ const xp = new Command({

featured: false,

preload: false,

cb: function(client, message, guild, user, script, match) {

if (match === 0) {
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/advice.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const advice = new Command({

featured: false,

preload: false,

cb: function (client, message, guildDoc) {

let advice = [
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/america.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const america = new Command({

featured: false,

preload: false,

cb: function (client, message, guildDoc) {

let randomnumber = Math.random();
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/artcomp.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const artcomp = new Command({

featured: false,

preload: false,

cb: function (client, message, guildDoc) {

const artall = [{
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const avatar = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

let scaledSize = 512;
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/back.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const back = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

message.channel.send("<:imback:452191400268922900> <@" + message.author.id + ">" + " is baaaaaaack!");
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/batman.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const batman = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

message.channel.send("", {
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const binding = new Command({

featured: false,

preload: false,

cb: function(client, message, guild, user, script, match) {

// action: text, file, embed
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/butters.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const butters = new Command({

featured: false,

preload: false,

cb: function (client, message, guildDoc) {

const buttersimg = [
Expand Down
4 changes: 3 additions & 1 deletion src/bot/commands/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ const card = new Command({
match_type: "command",
match: "card",

featured: true,
featured: false,

preload: false,

cb: async function (client, message, guild, user, script, match) {

Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/coinflip.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const coinflip = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

message.reply(Math.floor(Math.random() * 2) === 0 ? "heads" : "tails");
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/colour.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const colour = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

message.channel.send(new discord.RichEmbed().setColor(0xff594f).setDescription("The Feinwaru colour is: **0xff594f**"));
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/dam.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const dam = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

message.reply("No, I broke the dam");
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/dice.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const dice = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

message.reply(Math.floor(Math.random() * 6) + 1);
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/dick.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const dick = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

message.channel.send("", {
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/f.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const f = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

message.reply("Repects have been paid.");
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/fm.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const fm = new Command({

featured: false,

preload: false,

cb: function (client, message, guildDoc) {

const args = message.content.split(" ");
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/fuckyou.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const fuckyou = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

message.channel.send("", {
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/fuckyourself.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const fuckyourself = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

message.channel.send("", {
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/gif.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const gif = new Command({

featured: false,

preload: false,

cb: function (client, message, guildDoc) {

const map = ["vchip", "buttersgun", "buttersdance", "kennydance", "meeem", "cartmandance", "slap", "zimmerman", "nice", "triggered", "cartmansmile", "stanninja", "kylethinking", "ninjastar", "cartmaninvisible", "stanpuking", "kylegiant", "iketrumpet"];
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/harvest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const harvest = new Command({

featured: false,

preload: false,

cb: function (client, message, guildDoc) {

message.channel.send(new discord.RichEmbed()
Expand Down
52 changes: 52 additions & 0 deletions src/bot/commands/help.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"use strict"

const discord = require("discord.js");

const Command = require("../command");
const schemas = require("../../db");

const help = new Command({

name: "AWESOM-O Help",
description: "Lists all the commands enabled on the current server.",
thumbnail: "https://cdn.discordapp.com/attachments/209040403918356481/509384571842723849/Untitled-1.png",
marketplace_enabled: true,

type: "js",
match_type: "command",
match: "help",

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

schemas.ScriptSchema
.find({ __id: { $in: guildDoc.scripts.map(e => e.object_id) } })
.then(scripts => {

if (scripts.length === 0) {

return message.channel.send("no scripts enabled in this server :(");
}

const embed = discord.RichEmbed();
embed.setAuthor("AWESOM-O 3.0 // Help", "https://cdn.discordapp.com/attachments/209040403918356481/509385256760115210/favicon.png");
embed.setDescription("index | name | description | usage\n\n");

for (let [i, script] of scripts.entries()) {

embed.description += `${i}. ${script.name}: ${script.description} (${"`"}${guildDoc.prefix}${"`"})\n`;
}

message.channel.send(embed);
})
.catch(error => {

message.channel.send(`error fetching scripts: ${error}`);
})
}
});

module.exports = help;
2 changes: 2 additions & 0 deletions src/bot/commands/kickbaby.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const kickbaby = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

message.reply("Don't kick the goddamn baby!");
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/levels.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ const levels = new Command({

featured: false,

preload: false,

cb: function (client, message, guild, user, script, match) {

let searchUser = message.author;
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/love.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const love = new Command({

featured: false,

preload: false,

cb: function (client, message, guildDoc) {

const chefquotes = [
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/member.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const member = new Command({

featured: false,

preload: false,

cb: function (client, message, guildDoc) {

const memberMessages = ["I member!", "Ohh yeah I member!", "Me member!", "Ohh boy I member that", "I member!, do you member?"];
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/micro.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const micro = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

message.channel.send("", {
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/movieidea.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const movieidea = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

const movieIdeas = [
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/nathan.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const nathan = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

const nathan = [
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/nathanrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const nathanrate = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

const quotes = [
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/random.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const random = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

if (cachedeplist === undefined) {
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/reminder.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ let reminder = new Command({

featured: false,

preload: false,

cb: function (client, message, guildDoc) {

let random = Math.random();
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/rps.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const rps = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

const rand = Math.floor(Math.random() * 3);
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/rr.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const rr = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

let random = Math.random();
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/ship.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ let ship = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

const randommale = Math.floor(Math.random() * males.length);
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/shipyaoi.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ let shipyaoi = new Command({

featured: false,

preload: false,

cb: function(client, message, guildDoc) {

let gayMods = Math.random()
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/shipyuri.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ let shipyuri = new Command({

featured: false,

preload: false,

cb: function (client, message, guildDoc) {

const randomfemale1 = Math.floor(Math.random() * females.length);
Expand Down
2 changes: 2 additions & 0 deletions src/bot/commands/shits.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const shits = new Command({

featured: false,

preload: false,

cb: function(client, message, guild, user, script, match) {

if (match === 0) {
Expand Down

0 comments on commit cf81d3a

Please sign in to comment.