Im done for right now

This commit is contained in:
Alex 2020-06-18 03:45:40 -05:00
parent 7af1e4b483
commit d82de68c70
2 changed files with 15 additions and 2 deletions

View File

@ -6,6 +6,7 @@
"dependencies": {
"discord.js": "^12.1.1",
"n": "^6.4.0",
"node-fetch": "^2.6.0",
"pretty-ms": "^6.0.1"
},
"publishConfig": {

View File

@ -6,7 +6,8 @@ const Discord = require("discord.js");
const prettyMilliseconds = require('pretty-ms');
const fs = require('fs');
const homedir = require('os').homedir;
const info = require("../package.json")
const info = require("../package.json");
const fetch = require('node-fetch');
//importing files
const config = require("./config.json");
// This is making clients
@ -238,7 +239,18 @@ client.on("message", async message => {
//////////////////////////////////////
if (command == "xkcd") {
if (!isNaN(args[0])) {
return
fetch(`https://xkcd.com/${args[0]}/info.0.json`)
.then(res => res.json())
.then(json => let comic = json)
.catch(err => message.reply("Something went wrong... Check your number and try again later."));
let embed = new Discord.MessageEmbed()
.setTitle(`xkcd #${arg[0]}`)
.setAuthor("Randel Munroe")
.setColor(0xffffff)
.setDescription(``);
return message.channel.send(embed);
}
}
}