summaryrefslogtreecommitdiff
path: root/server.js
blob: d15192933c0ddd857396eeb11206d67fc682c5af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const axios = require('axios');
const Discord = require('discord.js');
const client = new Discord.Client();

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('message', async (msg) => {

  if (msg.content === "!goodboye") {
    try {
      const res = await axios.get('http://shibe.online/api/shibes');

      await msg.channel.send(undefined, {
          file: res.data[0]
      }); 
      
    } catch (e) {
      console.error(e);
    }
  }
});

client.login(process.env.DISCORD_TOKEN);