Skip to content

Commit

Permalink
Updated to 1.1.0
Browse files Browse the repository at this point in the history
See https://bastion.js.org/changes/ for complete changelog
  • Loading branch information
iamtraction committed Mar 1, 2017
1 parent 833e020 commit 116b7f5
Show file tree
Hide file tree
Showing 118 changed files with 831 additions and 276 deletions.
126 changes: 91 additions & 35 deletions data/quotes.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
"author": "Albert Einstein"
},
"114": {
"quote": "If A is a success in life, then A equals X plus Y plus Z. Work is X; Y is play; and Z is keeping your mouth shut.",
"quote": "If A is a success in life, then A equals X plus Y plus Z. X is work; Y is play; and Z is keeping your mouth shut.",
"author": "Albert Einstein"
},
"115": {
Expand Down Expand Up @@ -812,71 +812,127 @@
"author": "Ray Kroc"
},
"204": {
"quote": "",
"author": "-"
"quote": "Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine.",
"author": "Nikola Tesla"
},
"205": {
"quote": "",
"author": "-"
"quote": "I don't care that they stole my idea . . I care that they don't have any of their own.",
"author": "Nikola Tesla"
},
"206": {
"quote": "",
"author": "-"
"quote": "Be alone, that is the secret of invention; be alone, that is when ideas are born.",
"author": "Nikola Tesla"
},
"207": {
"quote": "",
"author": "-"
"quote": "I do not think there is any thrill that can go through the human heart like that felt by the inventor as he sees some creation of the brain unfolding to success . . . Such emotions make a man forget food, sleep, friends, love, everything.",
"author": "Nikola Tesla"
},
"208": {
"quote": "",
"author": "-"
"quote": "I have not failed. I've just found 10,000 ways that won't work.",
"author": "Thomas Alva Edison"
},
"209": {
"quote": "",
"author": "-"
"quote": "If we all did the things we are capable of doing, we would literally astound ourselves.",
"author": "Thomas Alva Edison"
},
"210": {
"quote": "",
"author": "-"
"quote": "Show me a thoroughly satisfied man and I will show you a failure.",
"author": "Thomas Alva Edison"
},
"211": {
"quote": "",
"author": "-"
"quote": "Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time.",
"author": "Thomas Alva Edison"
},
"212": {
"quote": "",
"author": "-"
"quote": "Just because something doesn't do what you planned it to do doesn't mean it's useless.",
"author": "Thomas Alva Edison"
},
"213": {
"quote": "",
"author": "-"
"quote": "Everything comes to him who hustles while he waits.",
"author": "Thomas Alva Edison"
},
"214": {
"quote": "",
"author": "-"
"quote": "Negative results are just what I want. They’re just as valuable to me as positive results. I can never find the thing that does the job best until I find the ones that don’t.",
"author": "Thomas Alva Edison"
},
"215": {
"quote": "",
"author": "-"
"quote": "Success is a lousy teacher. It seduces smart people into thinking they can't lose.",
"author": "Bill Gates"
},
"216": {
"quote": "",
"author": "-"
"quote": "Your most unhappy customers are your greatest source of learning.",
"author": "Bill Gates"
},
"217": {
"quote": "",
"author": "-"
"quote": "It's fine to celebrate success but it is more important to heed the lessons of failure.",
"author": "Bill Gates"
},
"218": {
"quote": "",
"author": "-"
"quote": "Don't compare yourself with anyone in this world...if you do so, you are insulting yourself.",
"author": "Bill Gates"
},
"219": {
"quote": "",
"author": "-"
"quote": "I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.",
"author": "Bill Gates"
},
"220": {
"quote": "",
"author": "-"
"quote": "I failed in some subjects in exam, but my friend passed in all. Now he is an engineer in Microsoft and I am the owner of Microsoft.",
"author": "Bill Gates"
},
"221": {
"quote": "Most people overestimate what they can do in one year and underestimate what they can do in ten years.",
"author": "Bill Gates"
},
"222": {
"quote": "If you are born poor its not your mistake, But if you die poor its your mistake.",
"author": "Bill Gates"
},
"223": {
"quote": "If you give people tools, and they use their natural abilities and their curiosity, they will develop things in ways that will surprise you very much beyond what you might have expected.",
"author": "Bill Gates"
},
"224": {
"quote": "Measuring programming progress by lines of code is like measuring aircraft building progress by weight.",
"author": "Bill Gates"
},
"225": {
"quote": "Some people may call me a nerd. I claim the label with pride.",
"author": "Bill Gates"
},
"226": {
"quote": "To win big, you sometimes have to take big risks.",
"author": "Bill Gates"
},
"227": {
"quote": "Long ago, Ben Graham taught me that 'Price is what you pay; value is what you get.' Whether we're talking about socks or stocks, I like buying quality merchandise when it is marked down.",
"author": "Warren Buffet"
},
"228": {
"quote": "It takes 20 years to build a reputation and five minutes to ruin it. If you think about that, you'll do things differently.",
"author": "Warren Buffet"
},
"229": {
"quote": "Someone's sitting in the shade today because someone planted a tree a long time ago.",
"author": "Warren Buffet"
},
"230": {
"quote": "Rule No.1: Never lose money. Rule No.2: Never forget rule No.1.",
"author": "Warren Buffet"
},
"231": {
"quote": "It's better to hang out with people better than you. Pick out associates whose behavior is better than yours and you'll drift in that direction.",
"author": "Warren Buffet"
},
"232": {
"quote": "No matter how great the talent or effort, some things just take time.",
"author": "Warren Buffet"
},
"233": {
"quote": "The difference between successful people and really successful people is that really successful people say no to almost everything.",
"author": "Warren Buffet"
},
"234": {
"quote": "I always knew I was going to be rich. I don’t think I ever doubted it for a minute.",
"author": "Warren Buffet"
}
}
6 changes: 4 additions & 2 deletions events/channelCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ module.exports = channel => {
inline: false
}
]
}});
}}).catch(e => {
channel.client.log.error(e.stack);
});
}).catch(e => {
channel.client.log.error(e.stack);
});;
});
};
6 changes: 4 additions & 2 deletions events/channelDelete.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ module.exports = channel => {
inline: true
}
]
}});
}}).catch(e => {
channel.client.log.error(e.stack);
});
}).catch(e => {
channel.client.log.error(e.stack);
});;
});
};
8 changes: 5 additions & 3 deletions events/channelUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ module.exports = (oldChannel, newChannel) => {
inline: true
}
]
}});
}}).catch(e => {
newChannel.client.log.error(e.stack);
});
}).catch(e => {
channel.client.log.error(e.stack);
});;
newChannel.client.log.error(e.stack);
});
};
28 changes: 0 additions & 28 deletions events/debug.js

This file was deleted.

6 changes: 5 additions & 1 deletion events/guildBanAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ module.exports = (guild, user) => {
inline: false
}
]
}});
}}).catch(e => {
guild.client.log.error(e.stack);
});
}).catch(e => {
guild.client.log.error(e.stack);
});
};
6 changes: 5 additions & 1 deletion events/guildBanRemove.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ module.exports = (guild, user) => {
inline: false
}
]
}});
}}).catch(e => {
guild.client.log.error(e.stack);
});
}).catch(e => {
guild.client.log.error(e.stack);
});
};
8 changes: 6 additions & 2 deletions events/guildCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ const sql = require('sqlite');
sql.open('./data/Bastion.sqlite');

module.exports = guild => {
sql.run("CREATE TABLE IF NOT EXISTS guildSettings (guildID TEXT NOT NULL UNIQUE, greet TEXT NOT NULL DEFAULT 'false', greetChannelID TEXT, greetMessage TEXT NOT NULL DEFAULT 'Welcome to $server.', greetTimeout INTEGER NOT NULL DEFAULT 30, farewell TEXT NOT NULL DEFAULT 'false', farewellChannelID TEXT UNIQUE, farewellMessage TEXT NOT NULL DEFAULT 'We hope you enjoyed your stay here!', farewellTimeout INTEGER NOT NULL DEFAULT 15, log TEXT NOT NULL DEFAULT 'false', logChannelID TEXT UNIQUE, musicTextChannelID TEXT UNIQUE, musicVoiceChannelID TEXT UNIQUE, filterInvite TEXT NOT NULL DEFAULT 'false', chat TEXT NOT NULL DEFAULT 'false', PRIMARY KEY(guildID))").then(() => {
sql.run('INSERT OR IGNORE INTO guildSettings (guildID) VALUES (?)', [guild.id]);
sql.run("CREATE TABLE IF NOT EXISTS guildSettings (guildID TEXT NOT NULL UNIQUE, greet TEXT NOT NULL DEFAULT 'false', greetChannelID TEXT, greetMessage TEXT NOT NULL DEFAULT 'Welcome to $server.', greetTimeout INTEGER NOT NULL DEFAULT 30, farewell TEXT NOT NULL DEFAULT 'false', farewellChannelID TEXT UNIQUE, farewellMessage TEXT NOT NULL DEFAULT 'We hope you enjoyed your stay here!', farewellTimeout INTEGER NOT NULL DEFAULT 15, log TEXT NOT NULL DEFAULT 'false', logChannelID TEXT UNIQUE, musicTextChannelID TEXT UNIQUE, musicVoiceChannelID TEXT UNIQUE, filterInvite TEXT NOT NULL DEFAULT 'false', chat TEXT NOT NULL DEFAULT 'false', levelUpMessage TEXT NOT NULL DEFAULT 'true', PRIMARY KEY(guildID))").then(() => {
sql.run('INSERT OR IGNORE INTO guildSettings (guildID) VALUES (?)', [guild.id]).catch(e => {
guild.client.log.error(e.stack);
});
}).catch(e => {
guild.client.log.error(e.stack);
});
};
8 changes: 3 additions & 5 deletions events/guildDelete.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ const sql = require('sqlite');
sql.open('./data/Bastion.sqlite');

module.exports = guild => {
if(guild.available) {
sql.run(`DELETE FROM guildSettings WHERE guildID=${guild.id}`);
} else {
console.log(`${guild.name} guild with ID: ${guild.id} is not available at the moment. Mostly, this is the cause of a server outage.`);
}
sql.run(`DELETE FROM guildSettings WHERE guildID=${guild.id}`).catch(e => {
guild.client.log.error(e.stack);
});
};
14 changes: 12 additions & 2 deletions events/guildMemberAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ module.exports = member => {
title: `Hello ${member.displayName}`,
description: greetMsg
}}).then(m => {
if (greetTimeout > 0) m.delete(1000*parseInt(greetTimeout));
if (greetTimeout > 0) m.delete(1000*parseInt(greetTimeout)).catch(e => {
member.client.log.error(e.stack);
});
}).catch(e => {
member.client.log.error(e.stack);
});
}
}).catch(e => {
member.client.log.error(e.stack);
});

sql.get(`SELECT log, logChannelID FROM guildSettings WHERE guildID ='${member.guild.id}'`).then(row => {
Expand All @@ -62,6 +68,10 @@ module.exports = member => {
inline: false
}
]
}});
}}).catch(e => {
member.client.log.error(e.stack);
});
}).catch(e => {
member.client.log.error(e.stack);
});
};
14 changes: 12 additions & 2 deletions events/guildMemberRemove.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ module.exports = member => {
title: `Goodbye ${member.displayName}!`,
description: farewellMsg + '\n:wave:'
}}).then(m => {
if (farewellTimeout > 0) m.delete(1000*parseInt(farewellTimeout));
if (farewellTimeout > 0) m.delete(1000*parseInt(farewellTimeout)).catch(e => {
member.client.log.error(e.stack);
});
}).catch(e => {
member.client.log.error(e.stack);
});
}
}).catch(e => {
member.client.log.error(e.stack);
});

sql.get(`SELECT log, logChannelID FROM guildSettings WHERE guildID ='${member.guild.id}'`).then(row => {
Expand All @@ -62,6 +68,10 @@ module.exports = member => {
inline: false
}
]
}});
}}).catch(e => {
member.client.log.error(e.stack);
});
}).catch(e => {
member.client.log.error(e.stack);
});
};
6 changes: 5 additions & 1 deletion events/guildUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ module.exports = (oldGuild, newGuild) => {
inline: true
}
]
}});
}}).catch(e => {
newGuild.client.log.error(e.stack);
});
}).catch(e => {
newGuild.client.log.error(e.stack);
});
};
Loading

0 comments on commit 116b7f5

Please sign in to comment.