feat: eval command
This commit is contained in:
parent
b91faa3e18
commit
8187a01b43
20
index.js
20
index.js
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue