Music made stronger with Lavalink for ForgeScript.
- Simple and easy-to-use ForgeScript functions
- Support for multiple event listeners
- Support for different audio providers
- Playlist & queue management
- Lavalink v4 ready
Install via npm, yarn, pnpm etc:
npm install @tryforge/forge.linkedFirst, import ForgeClient and ForgeLinked in your main file:
const{ ForgeClient }=require('@tryforge/forgescript')const{ ForgeLinked }=require('@tryforge/forge.linked')import*asdotenvfrom'dotenv'dotenv.config()constlavalink=newForgeLinked({nodes: [{id: "Public Lavalink Server",host: "lavalink.zack911.xyz",// or your VPS IP/domainport: 443,authorization: "ZackIsSoCool",// ✅ must be 'authorization'secure: true}],playerOptions: {defaultSearchPlatform: "youtube"},events: ['linkedPlayerCreate','linkedPlayerDestroy']})constclient=newForgeClient({intents: ['Guilds','GuildMessages','MessageContent','GuildVoiceStates'],events: ['messageCreate'],extensions: [lavalink],prefixes: ['.']})client.commands.add({name: 'e',type: 'messageCreate',code: '$onlyForUsers[Not for you!;$botOwnerID] $eval[$message]'})client.login(process.env.BOT_TOKEN)Provide Lavalink server details inside nodes:
constlavalink=newForgeLinked({nodes: [{id: "Main Node",host: "lavalink.example.com",port: 2333,authorization: "youshallnotpass",secure: false}]})🔑 You can find public Lavalink nodes online or host your own.
Set a default search engine in playerOptions:
constlavalink=newForgeLinked({playerOptions: {defaultSearchPlatform: 'youtube'}})Available:
youtubeyoutube musicsoundcloudspotify(if enabled)
ForgeLinked v2 is licensed under the GPL-3 License. See LICENSE for more info.