mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-12 16:13:05 -04:00
🥺🥺🥺
This commit is contained in:
parent
11aaed9867
commit
dc1fb53896
2 changed files with 33 additions and 0 deletions
32
commands/interaction/context/bottom.js
Normal file
32
commands/interaction/context/bottom.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
const { Constants } = require('detritus-client');
|
||||
const { InteractionCallbackTypes, ApplicationCommandTypes, MessageFlags } = Constants;
|
||||
|
||||
const { createEmbed } = require('../../../labscore/utils/embed');
|
||||
const { codeblock } = require('../../../labscore/utils/markdown');
|
||||
|
||||
const { decode } = require('bottomify')
|
||||
|
||||
module.exports = {
|
||||
name: 'Decode Bottom',
|
||||
type: ApplicationCommandTypes.MESSAGE,
|
||||
run: async (context, args) => {
|
||||
try{
|
||||
const { message } = args;
|
||||
|
||||
let decodedMessage = decode(message.content)
|
||||
|
||||
await context.respond({data: { flags: MessageFlags.EPHEMERAL, embeds: [
|
||||
createEmbed("default", context, {
|
||||
description: codeblock("py", [decodedMessage])
|
||||
})
|
||||
] }, type: InteractionCallbackTypes.CHANNEL_MESSAGE_WITH_SOURCE})
|
||||
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
await context.editOrRespond({
|
||||
embeds: [createEmbed("error", context, "Unable to decode message.")],
|
||||
flags: MessageFlags.EPHEMERAL
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
|
@ -11,6 +11,7 @@
|
|||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"bottomify": "^0.3.0",
|
||||
"detritus-client": "^0.17.0-beta.16",
|
||||
"dotenv": "^16.0.1",
|
||||
"emoji-aware": "^3.1.0",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue