You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
439 B

  1. const xkcd = require('xkcd-api');
  2. module.exports = {
  3. name: 'comic',
  4. description: 'Send a random xkcd comic.',
  5. execute(message) {
  6. var message = message;
  7. xkcd.random(function(error, response) {
  8. if (error) {
  9. console.error(error);
  10. } else {
  11. message.channel.send(`**${response.safe_title}**\n*${response.alt}*`, {files: [response.img]})
  12. }
  13. });
  14. },
  15. };