mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-17 16:23:58 +00:00
fix(bots/discord): persist changes in context for eval command
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { unlinkSync, writeFileSync } from 'fs'
|
import { unlinkSync, writeFileSync } from 'fs'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { inspect } from 'util'
|
import { inspect } from 'util'
|
||||||
import { runInNewContext } from 'vm'
|
import { runInContext } from 'vm'
|
||||||
import { ApplicationCommandOptionType } from 'discord.js'
|
import { ApplicationCommandOptionType } from 'discord.js'
|
||||||
|
|
||||||
import { AdminCommand } from '$/classes/Command'
|
import { AdminCommand } from '$/classes/Command'
|
||||||
@@ -41,7 +41,7 @@ export default new AdminCommand({
|
|||||||
|
|
||||||
// This allows developers to access and modify the context object to apply changes
|
// This allows developers to access and modify the context object to apply changes
|
||||||
// to the bot while the bot is running, minus malicious actors getting the token to perform malicious actions
|
// to the bot while the bot is running, minus malicious actors getting the token to perform malicious actions
|
||||||
const output = await runInNewContext(
|
const output = await runInContext(
|
||||||
code,
|
code,
|
||||||
{
|
{
|
||||||
...globalThis,
|
...globalThis,
|
||||||
|
|||||||
Reference in New Issue
Block a user