Compare commits

...

2 Commits

Author SHA1 Message Date
semantic-release-bot
f6d2e25130 chore(release): 1.0.0-dev.32 [skip ci]
# @revanced/discord-bot [1.0.0-dev.32](https://github.com/revanced/revanced-helper/compare/@revanced/discord-bot@1.0.0-dev.31...@revanced/discord-bot@1.0.0-dev.32) (2024-09-25)

### Bug Fixes

* **bots/discord:** contextify object before sandboxing ([062735f](062735f6d5))
2024-09-25 05:50:49 +00:00
PalmDevs
062735f6d5 fix(bots/discord): contextify object before sandboxing 2024-09-25 12:49:29 +07:00
3 changed files with 11 additions and 4 deletions

View File

@@ -1,3 +1,10 @@
# @revanced/discord-bot [1.0.0-dev.32](https://github.com/revanced/revanced-helper/compare/@revanced/discord-bot@1.0.0-dev.31...@revanced/discord-bot@1.0.0-dev.32) (2024-09-25)
### Bug Fixes
* **bots/discord:** contextify object before sandboxing ([062735f](https://github.com/revanced/revanced-helper/commit/062735f6d552890404d6192244c51a11b0709580))
# @revanced/discord-bot [1.0.0-dev.31](https://github.com/revanced/revanced-helper/compare/@revanced/discord-bot@1.0.0-dev.30...@revanced/discord-bot@1.0.0-dev.31) (2024-09-25)

View File

@@ -2,7 +2,7 @@
"name": "@revanced/discord-bot",
"type": "module",
"private": true,
"version": "1.0.0-dev.31",
"version": "1.0.0-dev.32",
"description": "🤖 Discord bot assisting ReVanced",
"main": "src/index.ts",
"scripts": {

View File

@@ -1,7 +1,7 @@
import { unlinkSync, writeFileSync } from 'fs'
import { join } from 'path'
import { inspect } from 'util'
import { runInContext } from 'vm'
import { createContext, runInContext } from 'vm'
import { ApplicationCommandOptionType } from 'discord.js'
import { AdminCommand } from '$/classes/Command'
@@ -43,10 +43,10 @@ export default new AdminCommand({
// to the bot while the bot is running, minus malicious actors getting the token to perform malicious actions
const output = await runInContext(
code,
{
createContext({
...globalThis,
context,
},
}),
{
timeout: parseDuration(timeout ?? '10s'),
filename: 'eval',