blob: 49e011c3f3bb77bf0d630bf52d5654cb2311395c (
plain) (
blame)
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
|
import axios from 'axios'
import { Command, CommandoMessage } from 'discord.js-commando';
import emoji from 'emoji-random';
module.exports = class AdviceFun extends Command {
constructor(client) {
super(client, {
name: 'advice',
group: 'fun',
memberName: 'advice',
description: 'Gives you a random piece of advice.',
throttling: {
usages: 5,
duration: 30
},
examples: [
'uwu!advice'
],
userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
});
}
async run(msg: CommandoMessage) {
let res = await axios.get('http://api.adviceslip.com/advice')
msg.reply(res.data.slip.advice + ' ' + emoji.random())
}
};
|