
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@tryforge/forge.music
Advanced tools
An standard music library tailored for ForgeScript.
In your project, navigate to your terminal and write the following command.
npm install @tryforge/forge.music
If you are using another package manager than npm, Google how to install Node.js dependencies.
Now, you must require the ForgeMusic
class in your main file.
const { ForgeMusic } = require("@tryforge/forge.music");
As it is required, now you are allowed to create an instance of it.
const music = new ForgeMusic({
events: []
});
Now, extension is defined and ready to be attached to the client.
const client = new ForgeClient({
extensions: [music],
// ...client options
});
[!CAUTION] Your
ForgeClient
instance requires the following intent in order for ForgeMusic to work: GuildVoiceStates.
ForgeMusic provides a simple interface to declare the events to listen to.
First, we need to require the GuildQueueEvent
enumerator.
const { ForgeMusic, GuildQueueEvent } = require("@tryforge/forge.music");
As it is required, now you must pass an array of values of this enumerator under events
property in ForgeMusic constructor.
const music = new ForgeMusic({
events: [
GuildQueueEvent.PlayerFinish,
GuildQueueEvent.PlayerStart,
GuildQueueEvent.PlayerError,
GuildQueueEvent.Error
]
});
Current setup must look like this.
const { ForgeMusic, GuildQueueEvent } = require("@tryforge/forge.music");
const music = new ForgeMusic({
events: [
GuildQueueEvent.PlayerFinish,
GuildQueueEvent.PlayerStart,
GuildQueueEvent.PlayerError,
GuildQueueEvent.Error
]
});
const client = new ForgeClient({
extensions: [music],
// ...client options
});
The following events are not supported by the extension.
To add event commands, ForgeMusic provides an integrated command manager to take care of this. You must define your commands after your ForgeClient definition to prevent errors.
// Adding directly.
music.commands.add({
name: "commandName",
type: GuildQueueEvent.PlayerStart,
code: "$log[A track started playing.]"
});
// Loading from a path tree.
music.commands.load("./path/to/commands");
In each music event, you can access to that event data using the JSON Dump ($env). The following, is a list of event with its accessible properties.
queue
: GuildQueueoldFilters
: FiltersNamenewFilters
: FiltersNamequeue
: GuildQueuetrack
: Trackqueue
: GuildQueuetrack
: Trackqueue
: GuildQueueoldFilters
: BiquadFiltersnewFilters
: BiquadFiltersqueue
: GuildQueuequeue
: GuildQueuequeue
: GuildQueuequeue
: GuildQueuemessage
: stringqueue
: GuildQueuequeue
: GuildQueueoldFilters
: PCMFilters[]newFilters
: PCMFilters[]queue
: GuildQueuequeue
: GuildQueuequeue
: GuildQueueoldFilters
: EqualizerBand[]newFilters
: EqualizerBand[]queue
: GuildQueueerror
: Errorqueue
: GuildQueueerror
: Errortrack
: Trackqueue
: GuildQueuetrack
: Trackqueue
: GuildQueuequeue
: GuildQueuequeue
: GuildQueuetrack
: Trackreason
: TrackSkipReasondescription
: stringqueue
: GuildQueuetrack
: Trackqueue
: GuildQueuetrack
: Trackreason
: PlayerTriggeredReasonqueue
: GuildQueuequeue
: GuildQueuequeue
: GuildQueueoldVolume
: numbernewVolume
: number{
name: "myCommand",
type: GuildQueueEvent.PlayerStart,
code: "$!sendMessage[$env[queue;metadata;text;id];A track started playing.]"
}
The base framework provides some base music sources you can use. You must load them like follows.
const { DefaultExtractors } = require("@tryforge/forge.music");
const music = new ForgeMusic({
// ...
includeExtractors: DefaultExtractors
});
ForgeMusic by default does not provide support for streaming from YouTube.
You must install discord-player-youtubei
and then require YoutubeiExtractor
from it.
npm install discord-player-youtubei
then, do the following step.
const { DefaultExtractors, ForgeMusic, GuildQueueEvent } = require("@tryforge/forge.music");
const { YoutubeiExtractor } = require("discord-player-youtubei");
const music = new ForgeMusic({
events: [
GuildQueueEvent.AudioTrackAdd,
GuildQueueEvent.Connection,
GuildQueueEvent.PlayerError,
GuildQueueEvent.Error
],
includeExtractors: DefaultExtractors
});
With the previous step done, register the YoutubeiExtractor into the extension registry.
music.player.extractors.register(YoutubeiExtractor, {});
And now, you're ready to use YouTube provider as smooth as possible.
Many thanks for the contributors for making this extension the best choice out there.
FAQs
Extension to add music functionality to your ForgeScript bot.
The npm package @tryforge/forge.music receives a total of 7 weekly downloads. As such, @tryforge/forge.music popularity was classified as not popular.
We found that @tryforge/forge.music demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.