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