mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 22:23:03 -04:00
otter command!!
This commit is contained in:
parent
bc4dedb51f
commit
41317a0e87
2 changed files with 40 additions and 1 deletions
40
commands/message/fun/otter.js
Normal file
40
commands/message/fun/otter.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
const { createEmbed } = require('../../../labscore/utils/embed')
|
||||
const { editOrReply } = require('../../../labscore/utils/message')
|
||||
|
||||
const superagent = require('superagent');
|
||||
|
||||
module.exports = {
|
||||
name: 'otter',
|
||||
metadata: {
|
||||
description: 'random otter!!',
|
||||
examples: ['otter'],
|
||||
category: 'fun',
|
||||
usage: `otter`
|
||||
},
|
||||
run: async (context, args) => {
|
||||
await context.triggerTyping();
|
||||
try{
|
||||
let res = await superagent.get(`https://otter.bruhmomentlol.repl.co/random`)
|
||||
.set("User-Agent","labscore/2.0")
|
||||
|
||||
await editOrReply(context, {
|
||||
embeds: [
|
||||
createEmbed("default", context, {
|
||||
image: {
|
||||
url: `attachment://otter.${res.headers["x-file-ext"]}`
|
||||
}
|
||||
})
|
||||
],
|
||||
files: [
|
||||
{
|
||||
filename: `otter.${res.headers["x-file-ext"]}`,
|
||||
value: res.body
|
||||
}
|
||||
]
|
||||
})
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
return editOrReply(context, {embeds:[createEmbed("error", context, `Unable to fetch otter.`)]})
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue