Zaack
Zaack
DIAdiscord.js - Imagine an app
Created by Zaack on 1/5/2024 in #djs-voice
Audio file does not play
doesn't seem to work either, I tried logging it, it logs aboie : [object Object]
6 replies
DIAdiscord.js - Imagine an app
Created by Zaack on 1/5/2024 in #djs-voice
Audio file does not play
didn't want to bother you guys with tons of useless lines
6 replies
DIAdiscord.js - Imagine an app
Created by Zaack on 1/5/2024 in #djs-voice
Audio file does not play
yea cause the action is triggered by another api anyway, but it does enter the action's scope, everything's good on that side
6 replies
DIAdiscord.js - Imagine an app
Created by Zaack on 1/5/2024 in #djs-voice
Audio file does not play
so like this ?
const aboie = createAudioResource(
path.resolve(__dirname + '../sounds/aboie.mp3'),
);
const aboie = createAudioResource(
path.resolve(__dirname + '../sounds/aboie.mp3'),
);
6 replies
DIAdiscord.js - Imagine an app
Created by Zaack on 9/30/2023 in #djs-questions
Call client in another file
yea i realised it would be much easier to use the ready event to do what i need afterall, thanks for your help guys !
20 replies
DIAdiscord.js - Imagine an app
Created by Zaack on 9/30/2023 in #djs-questions
Call client in another file
oh
20 replies
DIAdiscord.js - Imagine an app
Created by Zaack on 9/30/2023 in #djs-questions
Call client in another file
looks like i'm accessing it from my other file when importing it, but then how would I create and send a message to a specific channel ? 🤔
20 replies
DIAdiscord.js - Imagine an app
Created by Zaack on 9/30/2023 in #djs-questions
Call client in another file
In this, I could just replace const client... with export const client, then import it ?
20 replies
DIAdiscord.js - Imagine an app
Created by Zaack on 9/30/2023 in #djs-questions
Call client in another file
// Import necessary modules from libraries
import { ActivityType, Client, Collection, GatewayIntentBits } from "discord.js"; // Imports the Client and Collection classes from the "discord.js" library
import { token } from "../config.json"; // Imports the authentication token from the "config.json" file
import { BotEvent, SlashCommand } from "./types"; // Imports custom types "BotEvent" and "SlashCommand" from the "types" folder
import path from "path"; // Imports the "path" module to manage file paths
import fs, { PathLike } from "fs"; // Imports the "fs" module to handle file operations

// Create a new client instance
const client: Client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages],
presence: {
activities: [{
name: 'salu',
type: ActivityType.Streaming,
url: 'https://twitch.tv/zaacklachevre'
}]
}
});

// Create a collection to store slash commands
client.slashCommands = new Collection();

// Set the path to the folder containing commands
const foldersPath: PathLike = path.join(__dirname, 'commands');
// Read the list of folders in the specified path
const commandFolders: string[] = fs.readdirSync(foldersPath);
// Import necessary modules from libraries
import { ActivityType, Client, Collection, GatewayIntentBits } from "discord.js"; // Imports the Client and Collection classes from the "discord.js" library
import { token } from "../config.json"; // Imports the authentication token from the "config.json" file
import { BotEvent, SlashCommand } from "./types"; // Imports custom types "BotEvent" and "SlashCommand" from the "types" folder
import path from "path"; // Imports the "path" module to manage file paths
import fs, { PathLike } from "fs"; // Imports the "fs" module to handle file operations

// Create a new client instance
const client: Client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages],
presence: {
activities: [{
name: 'salu',
type: ActivityType.Streaming,
url: 'https://twitch.tv/zaacklachevre'
}]
}
});

// Create a collection to store slash commands
client.slashCommands = new Collection();

// Set the path to the folder containing commands
const foldersPath: PathLike = path.join(__dirname, 'commands');
// Read the list of folders in the specified path
const commandFolders: string[] = fs.readdirSync(foldersPath);
20 replies
DIAdiscord.js - Imagine an app
Created by Zaack on 9/30/2023 in #djs-questions
Call client in another file
so
20 replies
DIAdiscord.js - Imagine an app
Created by Zaack on 9/30/2023 in #djs-questions
Call client in another file
Oh
20 replies