mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-11 23:53: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
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue