This commit is contained in:
2021-03-04 03:33:54 +03:00
parent 368382f63c
commit 5ac17d713f
67 changed files with 1824 additions and 119 deletions
+34
View File
@@ -0,0 +1,34 @@
import {Command} from "./base/command";
import {sendMessage} from "../base/net";
import {MessageContext} from "../base/base";
export class Ae implements Command {
regexp = /^\/ae\s([^]+)/i
title: '/ae'
description: 'eval'
requireAdmin: true
async execute(context: MessageContext, params: string[]) {
const match = params[1]
try {
let e = eval(match)
e = ((typeof e == 'string') ? e : JSON.stringify(e))
await sendMessage(context, e)
} catch (e) {
const text = e.message.toString()
if (text.includes('is not defined')) {
await sendMessage(context, 'variable is not defined')
return
}
console.error(`${text}
* Stacktrace: ${e.stack}`)
await sendMessage(context, text)
}
}
}