mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
fix: Keep symbols in actions manager (#9293)
fix: keep symbols in actions manager
This commit is contained in:
@@ -19,7 +19,18 @@ async function writeWebsocketHandlerImports() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function writeClientActionImports() {
|
async function writeClientActionImports() {
|
||||||
const lines = ["'use strict';\n", 'class ActionsManager {', ' constructor(client) {', ' this.client = client;\n'];
|
const lines = [
|
||||||
|
"'use strict';\n",
|
||||||
|
'class ActionsManager {',
|
||||||
|
' // These symbols represent fully built data that we inject at times when calling actions manually.',
|
||||||
|
' // Action#getUser, for example, will return the injected data (which is assumed to be a built structure)',
|
||||||
|
' // instead of trying to make it from provided data',
|
||||||
|
" injectedUser = Symbol('djs.actions.injectedUser');",
|
||||||
|
" injectedChannel = Symbol('djs.actions.injectedChannel');",
|
||||||
|
" injectedMessage = Symbol('djs.actions.injectedMessage');\n",
|
||||||
|
' constructor(client) {',
|
||||||
|
' this.client = client;\n',
|
||||||
|
];
|
||||||
|
|
||||||
const actionsDirectory = new URL('../src/client/actions', import.meta.url);
|
const actionsDirectory = new URL('../src/client/actions', import.meta.url);
|
||||||
for (const file of (await readdir(actionsDirectory)).sort()) {
|
for (const file of (await readdir(actionsDirectory)).sort()) {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
class ActionsManager {
|
class ActionsManager {
|
||||||
// These symbols represent fully built data that we inject at times when calling actions manually. Action#getUser,
|
// These symbols represent fully built data that we inject at times when calling actions manually.
|
||||||
// for example, will return the injected data (which is assumed to be a built structure) instead of trying to make it
|
// Action#getUser, for example, will return the injected data (which is assumed to be a built structure)
|
||||||
// from provided data
|
// instead of trying to make it from provided data
|
||||||
injectedUser = Symbol('djs.actions.injectedUser');
|
injectedUser = Symbol('djs.actions.injectedUser');
|
||||||
injectedChannel = Symbol('djs.actions.injectedChannel');
|
injectedChannel = Symbol('djs.actions.injectedChannel');
|
||||||
injectedMessage = Symbol('djs.actions.injectedMessage');
|
injectedMessage = Symbol('djs.actions.injectedMessage');
|
||||||
|
|||||||
Reference in New Issue
Block a user