cleaned up anagram.js, combined module exports.

This commit is contained in:
2019-03-18 06:23:27 +11:00
parent 7d11f13e30
commit 467dc136ff
22 changed files with 513 additions and 496 deletions

View File

@@ -1,29 +1,30 @@
var request = require('request');
var url = "https://www.reddit.com/r/mlem/hot/.json?limit=100";
exports.name = 'Mlem'
exports.alias = ['mlem']
exports.helptext = 'Inserts good boye from reddit/r/mlem'
exports.helphide = false
exports.permissions = ['READ_MESSAGES']
exports.category = 'general'
exports.command = (client, msg) => {
request({
url: url,
json: true
}, function (error, response, body) {
if (!error && response.statusCode === 200) {
var sent = false;
while (!sent) {
var jokenumber = getRandomInt(1, 25);
if (body.data.children[jokenumber].data.url.endsWith(".jpg"))
{
msg.channel.send({file:body.data.children[jokenumber].data.url});
sent = true;
module.exports = {
name = 'Mlem',
alias =['mlem'],
helptext = 'Inserts good boye from reddit/r/mlem',
helphide = false,
permissions =['READ_MESSAGES'],
category = 'general',
command = (client, msg) => {
request({
url: url,
json: true
}, function (error, response, body) {
if (!error && response.statusCode === 200) {
var sent = false;
while (!sent) {
var jokenumber = getRandomInt(1, 25);
if (body.data.children[jokenumber].data.url.endsWith(".jpg")) {
msg.channel.send({ file: body.data.children[jokenumber].data.url });
sent = true;
}
}
}
}
});
});
}
}
function getRandomInt(min, max) {