feat: eval command

This commit is contained in:
DaInfLoop 2024-06-19 21:49:07 +01:00
parent b91faa3e18
commit 8187a01b43

View file

@ -184,6 +184,26 @@ app.view("chooseopponent-BEGINNER", async (ctx) => {
})
})
app.command('/bm-eval', async (ctx) => {
await ctx.ack();
const resp = require('util').inspect(await eval(ctx.body.text), undefined, 1)
ctx.respond({
text: resp,
response_type: 'ephemeral',
blocks: [
{
type: 'section',
text: {
type: 'mrkdwn',
text: "```" + resp + "```"
}
}
]
})
})
app.command('/viewopponents', async (ctx) => {
await ctx.ack();