-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.js
41 lines (30 loc) · 811 Bytes
/
bot.js
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require("dotenv").config()
const axios = require("axios")
const Discord = require("discord.js")
const client = new Discord.Client()
const prefix = "!"
client.on("ready", () => {
console.log("Go!")
})
client.on("message", async msg => {
if (!msg.content.startsWith(prefix)) {
return
}
const args = msg.content
.slice(prefix.length)
.trim()
.split(/ +/g)
const command = args.shift().toLowerCase()
if (command === "pyi") {
msg.react("❤️")
}
if (command === "vibes") {
const getVibes = async () => {
const response = await axios.get('https://www.affirmations.dev/')
return response.data.affirmation;
}
const vibes = await getVibes()
msg.reply(`Here's your affirmation: \n ${vibes} ❤️`)
}
})
client.login(process.env.BOT_TOKEN)