mirror of
https://github.com/Technicolor-creamsicle/Osselbot.git
synced 2025-02-21 05:07:16 -05:00
Im done for right now
This commit is contained in:
parent
7af1e4b483
commit
d82de68c70
@ -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": {
|
||||
|
16
src/index.js
16
src/index.js
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user