aboutsummaryrefslogtreecommitdiff
path: root/bot.js
diff options
context:
space:
mode:
authorUnknown <Alee14498@gmail.com>2017-10-28 20:01:09 -0400
committerUnknown <Alee14498@gmail.com>2017-10-28 20:01:09 -0400
commitf7b7246eec5570021c81fbabf50f3bd5e0522567 (patch)
tree91084d6082b13a11868d60c7e6f3514cb8d9de21 /bot.js
parent1de9ec0e31e840bcb7dae817a1dbb9a3c3feabc0 (diff)
downloadAstralQuote-ATC-f7b7246eec5570021c81fbabf50f3bd5e0522567.tar.gz
AstralQuote-ATC-f7b7246eec5570021c81fbabf50f3bd5e0522567.tar.bz2
AstralQuote-ATC-f7b7246eec5570021c81fbabf50f3bd5e0522567.zip
Changed prefix, added new commands and quotes
Diffstat (limited to 'bot.js')
-rw-r--r--bot.js91
1 files changed, 65 insertions, 26 deletions
diff --git a/bot.js b/bot.js
index fb7176c..5cc5cc9 100644
--- a/bot.js
+++ b/bot.js
@@ -1,7 +1,23 @@
const Discord = require('discord.js');
const client = new Discord.Client();
const config = require('./config.json');
+const aqVersion = "1.0.1";
+const SuggestQuoteStartMessage = "**Quote Suggestion**\n" +
+ "Welcome to the quote suggestion process! Please read this before you continue.\n" +
+ "Here's how this will work.\n\n" +
+ "- I'll walk you through the process of creating a suggestion on the suggestions channel.\n" +
+ "- Just respond to my prompts by typing a message in this DM and sending it.\n" +
+ "- At any time, simply respond with `q` to cancel the suggestion.\n\n" +
+ "However, please be aware of the following:\n" +
+ "- Your Discord Username will be recorded and sent along with the suggestion.\n" +
+ "- Your suggestion will be publicly visible.\n" +
+ "- Any misuse of this command, including (but not limited to) spam will lead to appropriate discipline from staff.\n\n" +
+ "**Here are some things not to suggest because they will be immediately declined.** This counts as misuse of the suggest command, so hit `q` now if you were going to suggest one of these.\n" +
+ "- New text/voice channels.\n" +
+ "- New bots.\n\n" +
+ "Wait 30 seconds, and then respond with `y` if you understood the above.\n" +
+ "Please note this feature doesn't work **yet**"
var QuoteOfTheDay;
var QuoteOfTheDayExpiry = 0;
var QuoteOfTheDayStartTime;
@@ -26,7 +42,7 @@ function GetQuoteOfTheDay(quoteNum = -1) {
var url;
if (quoteNum == -1) {
- quoteNum = Math.floor(Math.random() * 1000) % 25;
+ quoteNum = Math.floor(Math.random() * 1000) % 27;
}
@@ -205,6 +221,20 @@ function GetQuoteOfTheDay(quoteNum = -1) {
year = "2017";
url = "https://www.example.com/"; //TODO: Find a URL
break;
+ case 25:
+ author = "Steve Jobs";
+ authorImage = "http://media.syracuse.com/news/photo/2011/01/9177328-large.jpg";
+ quote = "It's really hard to design products by focus groups. A lot of times, people don't know what they want until you show it to them.";
+ year = "1998";
+ url = "https://www.huffingtonpost.com/gregory-ciotti/why-steve-jobs-didnt-list_b_5628355.html";
+ break;
+ case 26:
+ author = "arencllc";
+ authorImage = "https://cdn.discordapp.com/avatars/191290329985581069/faf1a210c222d18fb30fcd9ec1082e7f.png?size=2048";
+ quote = "Coding for uwp is as hard as using a UWP program."
+ year = "2017"
+ url = "https://www.example.com/" //TODO: Find a URL
+ break;
}
QuoteOfTheDay.setAuthor(author, authorImage);
@@ -224,7 +254,7 @@ client.on('ready', () => {
console.log('[>] ARE YA READY KIDS? AYE AYE CAPTAIN!');
client.user.setPresence({
game: {
- name: "for help: !help",
+ name: "for help: aq:help",
type: 0
}
});
@@ -232,22 +262,22 @@ client.on('ready', () => {
client.on('message', message => {
- if (message.content === '!ping') {
+ if (message.content === 'aq:ping') {
message.channel.send('<:vtBoshyTime:280178631886635008> PONG! I want to play pong... :\'(');
- } else if (message.content === '!pong') {
+ } else if (message.content === 'aq:pong') {
message.channel.send('<:vtBoshyTime:280178631886635008> PING!');
- } else if (message.content === '!isthisthingon') {
+ } else if (message.content === 'aq:isthisthingon') {
message.channel.send('no 💤');
- } else if (message.content === '!quoteoftheday') {
+ } else if (message.content === 'aq:quoteoftheday') {
var quoteofday = GetQuoteOfTheDay();
message.channel.send("Here's the quote of the day (as of " + QuoteOfTheDayStartTime.toUTCString() + ")");
message.channel.sendEmbed(quoteofday);
- } else if (message.content === "!forcequote") {
+ } else if (message.content === "aq:forcequote") {
QuoteOfTheDayExpiry = 0;
var quoteofday = GetQuoteOfTheDay();
message.channel.send("New quote of the day!");
message.channel.sendEmbed(quoteofday);
- } else if (message.content === '!reboot') {
+ } else if (message.content === 'aq:reboot') {
/*
message.channel.send("Goodbye! We'll be back in a moment!").then(messageDeleteTimer);
console.log('[?] Reboot Requested. Rebooting...');
@@ -256,7 +286,7 @@ client.on('message', message => {
client.login('MjgwMjQ1MDAwMDI0MDk2NzY4.C4K8Nw.InlnQvRmbvfJG0nv13FXtoVzXwc');
*/
message.channel.send("Good try... But we're not letting anyone reboot me yet!");
- } else if (message.content === '!poweroff') {
+ } else if (message.content === 'aq:poweroff') {
/*
console.log(message.guild.roles);
if (message.guild.roles.get('Moderator').members.keyArray().includes(message.author.username)) {
@@ -266,38 +296,38 @@ client.on('message', message => {
}*/
message.channel.send("Well... vicr123 tried to code this... but it kept crashing... Ironic isn't it? :(");
- } else if (message.content === '!help') {
+ } else if (message.content === 'aq:help') {
// This is the new help
const embed = new Discord.RichEmbed()
.setTitle("AstrelQuact Commands")
- .setDescription('Every command that you input in this bot you must use the following prefix `!`.')
+ .setDescription('Every command that you input in this bot you must use the following prefix `aq:`.')
.setThumbnail('https://cdn.discordapp.com/avatars/373224323529310208/10311b6f6bb439681480b0ced7efaf66.png?size=2048')
.setColor("#BF6FDB")
- .addField("- General Commands", "ping\npong\ninvitebot\ncontribute\nreboot\npoweroff", true)
+ .addField("- General Commands", "ping\npong\ninvitebot\ncontribute\ninformation\nreboot\npoweroff", true)
.addField("- Quote Commands", "quoteoftheday\nforcequote\nsuggestaquote", true)
.setFooter("AstrelQuact Copyright 2017. This was made by TheRandomMelon and vicr123 and modified by Alee14.")
message.channel.send(embed);
- } else if (message.content === '!oldhelp') {
+ } else if (message.content === 'aq:oldhelp') {
message.channel.send("Available commands:\n```\n" +
- "!ping, !pong Requests AstrelQuact to reply with a message\n" +
- "!quoteoftheday Requests AstrelQuact for the quote of the day\n" +
- "!forcequote Requests AstrelQuact to reset the quote of the day\n" +
- "!reboot Requests AstrelQuact to reboot\n" +
- "!poweroff Tells AstrelQuact to leave\n```"
+ "aq:ping, aq:pong Requests AstrelQuact to reply with a message\n" +
+ "aq:quoteoftheday Requests AstrelQuact for the quote of the day\n" +
+ "aq:forcequote Requests AstrelQuact to reset the quote of the day\n" +
+ "aq:reboot Requests AstrelQuact to reboot\n" +
+ "aq:poweroff Tells AstrelQuact to leave\n```"
);
- } else if (message.content === '!easteregg') {
+ } else if (message.content === 'aq:easteregg') {
message.channel.send("```cpp\n" +
"There are no easter eggs to be found here. Begone!" +
"\n```");
- } else if (message.content === '!easterwgg') {
+ } else if (message.content === 'aq:easterwgg') {
message.channel.send("```cpp\n" +
"Ha, you found an easter egg! Take that, !easteregg!" +
"\n```");
- } else if (message.content === '!about') {
+ } else if (message.content === 'aq:about') {
message.channel.send("Made in Node.js by TheRandomMelon and vicr123. Crafted for the AstrelTaser Cantral Discord server. And this was modified by Alee14.");
- } else if (message.content === '!contribute') {
+ } else if (message.content === 'aq:contribute') {
message.reply("I can see you want to help AQ? Welp here's the link: https://github.com/FakeDiscordServersBots/AstralQuote");
- } else if (message.content === '!uptime') {
+ } else if (message.content === 'aq:uptime') {
var timeString; // What we'll eventually put into the message
var uptime = parseInt(client.uptime); // Get uptime in ms
uptime = Math.floor(uptime / 1000); // Convert from ms to s
@@ -318,7 +348,7 @@ client.on('message', message => {
message.reply(":clock1: AstrelQuact has been up for " + timeString + " hours.");
console.log("[!] Someone just typed in the uptime command! Here's how long i've been up for: " + timeString + " hours.")
- } else if (message.content === '!invitebot') {
+ } else if (message.content === 'aq:invitebot') {
var embed = new Discord.RichEmbed();
embed.setAuthor("AstrelQuact", "https://cdn.discordapp.com/avatars/373224323529310208/10311b6f6bb439681480b0ced7efaf66.png?size=2048");
@@ -327,7 +357,7 @@ client.on('message', message => {
embed.setURL("https://discordapp.com/oauth2/authorize?client_id=373224323529310208&scope=bot&permissions=314368");
message.channel.send(embed)
- } else if (message.content === "!suggestaquote") {
+ } else if (message.content === "aq:suggestaquote") {
var embed = new Discord.RichEmbed();
embed.setAuthor("AstrelQuact", "https://cdn.discordapp.com/avatars/373224323529310208/10311b6f6bb439681480b0ced7efaf66.png?size=2048");
@@ -335,7 +365,16 @@ client.on('message', message => {
embed.setDescription("This feature is coming soon!");
message.channel.send(embed)
- } else if (message.content.startsWith("!")) {
+ message.author.sendMessage(SuggestQuoteStartMessage);
+ } else if (message.content === "aq:information"){
+ var embed = new Discord.RichEmbed();
+
+ embed.setAuthor("AstrelQuact", "https://cdn.discordapp.com/avatars/373224323529310208/10311b6f6bb439681480b0ced7efaf66.png?size=2048");
+ embed.setColor("#BF6FDB");
+ embed.setDescription("AstrelQuact Version: " + aqVersion + "\n");
+
+ message.channel.send(embed)
+ } else if (message.content.startsWith("aq:")) {
deleteOriginalMessage = false;
console.log("[X] " + message.content + " [Unrecognised command]");