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.

21 lines
706 B

  1. const xkcd = require('xkcd-api');
  2. module.exports = {
  3. name: 'hail_mary',
  4. description: 'Fuck everyone\'s chat up by sneding a random number of comics between 0-3.',
  5. roles: ['732345527143759943'],
  6. execute(message) {
  7. var message = message;
  8. message.channel.send("Initiating comic hail mary!")
  9. for(i = 0; i < Math.floor(Math.random() * (30 - 0) + 0); i++){
  10. xkcd.random(function(error, response) {
  11. if (error) {
  12. console.error(error);
  13. } else {
  14. message.channel.send(`**${response.safe_title}**\n*${response.alt}*`, {files: [response.img]})
  15. }
  16. });
  17. }
  18. },
  19. };