mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 06:33:05 -04:00
inspire
This commit is contained in:
parent
9e84ba161d
commit
03af849964
2 changed files with 45 additions and 0 deletions
35
commands/message/fun/inspire.js
Normal file
35
commands/message/fun/inspire.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
const { createEmbed } = require('../../../labscore/utils/embed')
|
||||
const { editOrReply } = require('../../../labscore/utils/message')
|
||||
|
||||
const superagent = require('superagent');
|
||||
const { STATICS } = require('../../../labscore/utils/statics');
|
||||
|
||||
module.exports = {
|
||||
name: 'inspire',
|
||||
metadata: {
|
||||
description: 'Generates a random inspirational quote.',
|
||||
description_short: 'Inspirational Quotes',
|
||||
examples: ['inspire'],
|
||||
category: 'fun',
|
||||
usage: `inspire`
|
||||
},
|
||||
run: async (context) => {
|
||||
await context.triggerTyping();
|
||||
try{
|
||||
let res = await superagent.get(`https://inspirobot.me/api?generate=true`)
|
||||
.set("User-Agent","labscore/2.0")
|
||||
|
||||
return await editOrReply(context, {
|
||||
embeds: [ createEmbed("image", context, {
|
||||
url: res.text,
|
||||
provider: {
|
||||
icon: STATICS.inspirobot,
|
||||
text: "Inspirobot"
|
||||
}
|
||||
})]
|
||||
})
|
||||
}catch(e){
|
||||
return editOrReply(context, {embeds:[createEmbed("error", context, `Unable to fetch inspirational quote.`)]})
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue