mirror of
https://github.com/Technicolor-creamsicle/Osselbot.git
synced 2024-06-04 21:20:42 +00:00
fuck tgis
This commit is contained in:
parent
4a7e7ea431
commit
c15ddaa8ed
11
src/index.js
11
src/index.js
|
@ -144,21 +144,20 @@ client.on("message", async message => {
|
||||||
if(command === "quote") {
|
if(command === "quote") {
|
||||||
let quotes = require(`${homedir}/quotes.json`);
|
let quotes = require(`${homedir}/quotes.json`);
|
||||||
var quoteadd = "";
|
var quoteadd = "";
|
||||||
try{
|
//try{
|
||||||
let selector = args[0].toLowerCase();
|
let selector = args[0].toLowerCase();
|
||||||
if(selector === "add") {
|
if(selector === "add") {
|
||||||
args.shift();
|
args.shift();
|
||||||
quoteadd = args;
|
quotes.quotes.push(args.toString());
|
||||||
quotes.quotes.push(quoteadd.tostring());
|
|
||||||
fs.writeFile(`${homedir}/quotes.json`, JSON.stringify(quotes), (err) => {
|
fs.writeFile(`${homedir}/quotes.json`, JSON.stringify(quotes), (err) => {
|
||||||
if (err) return message.reply("Something went wrong");
|
if (err) return message.reply("Something went wrong");
|
||||||
client.channels.cache.get('712084662033580064').send(`${message.member} has submitted ${quoteadd} to the quote repository`);
|
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");
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
} catch (err) {};
|
//} catch (err) {};
|
||||||
var 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));
|
||||||
return message.channel.send(`${quotes.quotes[quotesend]}`);
|
return message.channel.send(`${quotes.quotes[quotesend]}`);
|
||||||
};
|
};
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue
Block a user