mirror of
https://github.com/Technicolor-creamsicle/Osselbot.git
synced 2025-01-02 12:46:41 -05:00
faufn]
This commit is contained in:
parent
0c14891aba
commit
85398fc4e0
42
src/index.js
42
src/index.js
@ -7,7 +7,7 @@ const prettyMilliseconds = require('pretty-ms');
|
||||
const fs = require('fs');
|
||||
const homedir = require('os').homedir;
|
||||
const info = require("../package.json");
|
||||
const fetch = require('node-fetch');
|
||||
// const fetch = require('node-fetch');
|
||||
//importing files
|
||||
const config = require("./config.json");
|
||||
// This is making clients
|
||||
@ -237,32 +237,32 @@ client.on("message", async message => {
|
||||
//////////////////////////////////////
|
||||
/////////Funny DHS is funny///////////
|
||||
//////////////////////////////////////
|
||||
if (command == "xkcd") {
|
||||
async function getcomic(args) {
|
||||
var comic
|
||||
try {
|
||||
var response = await fetch(`https://xkcd.com/${args[0]}/info.0.json`);
|
||||
comic = await response.text();
|
||||
return comic
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return message.reply("Something went wrong... Check your number and try again later.")
|
||||
}
|
||||
// if (command == "xkcd") {
|
||||
// async function getcomic(args) {
|
||||
// var comic
|
||||
// try {
|
||||
// var response = await fetch(`https://xkcd.com/${args[0]}/info.0.json`);
|
||||
// comic = await response.text();
|
||||
// return comic
|
||||
// } catch (e) {
|
||||
// console.error(e);
|
||||
// return message.reply("Something went wrong... Check your number and try again later.")
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
|
||||
getcomic();
|
||||
// getcomic();
|
||||
|
||||
let embed = new Discord.MessageEmbed()
|
||||
.setTitle(`xkcd #${comic.num}`)
|
||||
.setAuthor("Randel Munroe")
|
||||
.setColor(0xffffff)
|
||||
.image(`${comic.img}`);
|
||||
return message.channel.send(embed);
|
||||
// let embed = new Discord.MessageEmbed()
|
||||
// .setTitle(`xkcd #${comic.num}`)
|
||||
// .setAuthor("Randel Munroe")
|
||||
// .setColor(0xffffff)
|
||||
// .image(`${comic.img}`);
|
||||
// return message.channel.send(embed);
|
||||
|
||||
}
|
||||
// }
|
||||
});
|
||||
|
||||
if(process.argv.slice(2).includes("--TEST")) {
|
||||
|
Loading…
Reference in New Issue
Block a user