updating exit logic
This commit is contained in:
@@ -12,7 +12,9 @@ module.exports = {
|
|||||||
var title = args[0];
|
var title = args[0];
|
||||||
var link = args[1];
|
var link = args[1];
|
||||||
|
|
||||||
libFlayer.addSource(title,link);
|
libFlayer.addSource(title,link);
|
||||||
|
message.reply(
|
||||||
|
`Adding ${title} to the list of RSS sources`);
|
||||||
libFlayer.loadFeeds();
|
libFlayer.loadFeeds();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,10 +3,11 @@ var libFlayer = require("../libFlayer.js");
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'exit',
|
name: 'exit',
|
||||||
description: 'Exit',
|
description: 'Exit',
|
||||||
execute(message) {
|
async execute(message) {
|
||||||
message.reply(
|
message.reply(
|
||||||
`!Goodbye world - someone respawn my process`
|
`Goodbye world - Disconnection imminent.`
|
||||||
);
|
);
|
||||||
|
await libFlayer.sleep(5000);
|
||||||
await new Promise(resolve => setTimeout(process.exit(), 5000));
|
await new Promise(resolve => setTimeout(process.exit(), 5000));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -15,6 +15,8 @@ exports.addSource = function(title,source){
|
|||||||
feeds.push(linkData);
|
feeds.push(linkData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.sleep = (ms) => new Promise((resolve) => { setTimeout(resolve, ms); })
|
||||||
|
|
||||||
exports.loadFeeds = function() {
|
exports.loadFeeds = function() {
|
||||||
linkFlayerMap = [];
|
linkFlayerMap = [];
|
||||||
feeds.forEach(feedBlock => {
|
feeds.forEach(feedBlock => {
|
||||||
@@ -30,10 +32,7 @@ exports.loadFeeds = function() {
|
|||||||
}
|
}
|
||||||
linkFlayerMap.push(linkData);
|
linkFlayerMap.push(linkData);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})().then();
|
})().then();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -41,12 +40,10 @@ exports.loadFeeds = function() {
|
|||||||
|
|
||||||
exports.getFeeds = function () {
|
exports.getFeeds = function () {
|
||||||
return linkFlayerMap;
|
return linkFlayerMap;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.getSources = function () {
|
exports.getSources = function () {
|
||||||
return feeds;
|
return feeds;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.getQuotes = function () {
|
exports.getQuotes = function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user