mirror of
https://github.com/Technicolor-creamsicle/Osselbot.git
synced 2025-01-17 19:56:23 -05:00
egg
This commit is contained in:
parent
c6fb55a097
commit
8a1bc2137b
14
src/index.js
14
src/index.js
@ -142,9 +142,9 @@ 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 = "";
|
||||||
|
|
||||||
var selector;
|
var selector;
|
||||||
try{
|
try{
|
||||||
selector = args[0].toLowerCase();
|
selector = args[0].toLowerCase();
|
||||||
@ -155,11 +155,13 @@ client.on("message", async message => {
|
|||||||
};
|
};
|
||||||
if(selector === "add") {
|
if(selector === "add") {
|
||||||
args.shift();
|
args.shift();
|
||||||
quoteadd = args;
|
//This does logic to make it from an array to a nice string.
|
||||||
quoteadd = quoteadd.toString();
|
quoteadd = args.join(' ');
|
||||||
quoteadd = quoteadd.replace(/,/g, " ");
|
//quoteadd = quoteadd.toString();
|
||||||
quoteadd = quoteadd.replace(/ /g, ", ");
|
//quoteadd = quoteadd.replace(/,/g, " ");
|
||||||
quotes.quotes.push(quoteadd.toString());
|
//quoteadd = quoteadd.replace(/ /g, ", ");
|
||||||
|
//quotes.quotes.push(quoteadd.toString());
|
||||||
|
quotes.quotes.push(quoteadd)
|
||||||
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`);
|
||||||
|
Loading…
Reference in New Issue
Block a user