Ypsilon
Ypsilon
DIAdiscord.js - Imagine an app
Created by Ypsilon on 10/7/2023 in #djs-questions
Embed Thumbnail not showing
I have tried other links just from google and such haven't gottin it to work but I kind of gave up tbh. Srry didn't i was tagged
9 replies
DIAdiscord.js - Imagine an app
Created by Ypsilon on 8/28/2022 in #djs-questions
Import all commands from folder with ES modules
Thank you @qjuh How I have it now and working
import path from 'path';
import { readdirSync } from 'fs';

const cmdList = [];
const cmdFiles = readdirSync(path.resolve('./discord/commands'));

for (const file of cmdFiles) {
const cmd = (await import(`../discord/commands/${file}`)).default
cmdList.push(cmd)
}

console.log(cmdList);
import path from 'path';
import { readdirSync } from 'fs';

const cmdList = [];
const cmdFiles = readdirSync(path.resolve('./discord/commands'));

for (const file of cmdFiles) {
const cmd = (await import(`../discord/commands/${file}`)).default
cmdList.push(cmd)
}

console.log(cmdList);
Again my apologies.
17 replies
DIAdiscord.js - Imagine an app
Created by Ypsilon on 8/28/2022 in #djs-questions
Import all commands from folder with ES modules
Sorry
17 replies
DIAdiscord.js - Imagine an app
Created by Ypsilon on 8/28/2022 in #djs-questions
Import all commands from folder with ES modules
My apologies I saw it wrong i get what you are saying now thank you.
17 replies
DIAdiscord.js - Imagine an app
Created by Ypsilon on 8/28/2022 in #djs-questions
Import all commands from folder with ES modules
import { readdirSync } from 'fs'

const commands = readdirSync('../discord/commands')
console.log(commands);
import { readdirSync } from 'fs'

const commands = readdirSync('../discord/commands')
console.log(commands);
doesnt even work in ES6 😦
17 replies
DIAdiscord.js - Imagine an app
Created by Ypsilon on 8/28/2022 in #djs-questions
Import all commands from folder with ES modules
If only you could just import a folder... 😦 but I just read in the nodejs docs its not possible Sadge
17 replies
DIAdiscord.js - Imagine an app
Created by Ypsilon on 8/28/2022 in #djs-questions
Import all commands from folder with ES modules
17 replies
DIAdiscord.js - Imagine an app
Created by Ypsilon on 8/28/2022 in #djs-questions
Import all commands from folder with ES modules
yes but
17 replies
DIAdiscord.js - Imagine an app
Created by Ypsilon on 8/28/2022 in #djs-questions
Import all commands from folder with ES modules
for (const fileSlash of slashCommandFiles) {
import command from `../discord/commands/${fileSlash}`
commandsList.push(commandSlash.commands)
}
for (const fileSlash of slashCommandFiles) {
import command from `../discord/commands/${fileSlash}`
commandsList.push(commandSlash.commands)
}
import like this just wont work or am I just doing something wrong. But can't an import just be used at the beginning ?
17 replies
DIAdiscord.js - Imagine an app
Created by Ypsilon on 8/22/2022 in #djs-questions
Can't get permissions on interaction command working
Ok that seems to work now thank you very much @jiralite
4 replies
DIAdiscord.js - Imagine an app
Created by Ypsilon on 8/22/2022 in #djs-questions
Can't get permissions on interaction command working
Ouch, ok and type is string but do i use just Administrator then or the 0x0000000000000008 as a string
4 replies