mirror of
https://github.com/Technicolor-creamsicle/Osselbot.git
synced 2024-06-13 00:10:41 +00:00
ah
This commit is contained in:
parent
007e46b135
commit
fdb14602c3
20
src/index.js
20
src/index.js
|
@ -138,24 +138,24 @@ client.on("message", async message => {
|
||||||
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);
|
||||||
}
|
};
|
||||||
else {
|
|
||||||
return message.channel.send("Im sorry but we cant have nice things...")
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
if(command === "quote") {
|
if(command === "quote") {
|
||||||
const quotes = require(`${homedir}/quotes.json`);
|
let quotes = require(`${homedir}/quotes.json`);
|
||||||
const quoteadd = "";
|
var quoteadd = "";
|
||||||
if(args[0].toLowerCase() === "add") {
|
let selector = args[0].toLowerCase()
|
||||||
|
if(selector === "add") {
|
||||||
quoteadd = args.shift();
|
quoteadd = args.shift();
|
||||||
quotes.quotes.push(quoteadd);
|
quotes.quotes.push(quoteadd);
|
||||||
JSON.stringify(quotes);
|
JSON.stringify(quotes);
|
||||||
fs.createWriteStream(`${homedir}/quotes.json`, quotes, {emitClose: "true"});
|
fs.writeFile(`${homedir}/quotes.json`, JSON.stringify(quotes), (err) => {
|
||||||
client.channels.get('712084662033580064').send(`${message.member} has submitted ${quoteadd} to the quote repository`);
|
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");
|
return message.reply("Quote added to repository");
|
||||||
};
|
};
|
||||||
const number = quotes.quotes.length() + 1;
|
var number = quotes.quotes.length() + 1;
|
||||||
let quotesend = Math.floor(Math.random() * (number - 0) + 0);
|
let quotesend = Math.floor(Math.random() * (number - 0) + 0);
|
||||||
return message.send(`\`\`\`${quotes.quotes[quotesend]}\`\`\``);
|
return message.send(`\`\`\`${quotes.quotes[quotesend]}\`\`\``);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user