Skip to main content

ruvyrias

Installation

// Just import the class from Ruvyrias
const { AppleMusic } = require('ruvyrias');

Example usage basic bot

const { Client, GatewayIntentBits } = require('discord.js');
const { AppleMusic } = require('ruvyrias');
const applemusic = new AppleMusic({
countryCode: 'us',
apiKey: 'your-api-key'
});

const RuvyriasOptions = {
library: 'discord.js',
defaultPlatform: 'amsearch',
plugins: [applemusic],
};

const nodes = [
{
name: 'local-node',
host: 'localhost',
port: 2333,
password: 'youshallnotpass',
},
];

// The entire code of a bot can be found at the main page, i'll not repeat all things here
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.MessageContent,
],
});

client.ruvyrias = new Ruvyrias(client, nodes, RuvyriasOptions);

/**
* You can use the source property to search by name or it will use the defaultPlatform to search by name
* Links will work directly, and it serves to any platform, but plugins has to be loaded before (unless you have lavaSrc)
*/
const res = await client.ruvyrias.resolve({ query: 'alan walker alone', source: 'amsearch', requester: message.author });

ruvyrias / AppleMusic

Class: AppleMusic

Defined in: plugins/applemusic/AppleMusic.ts:86

Represents the Apple Music class, extending the base Plugin class.

Extends

Constructors

Constructor

new AppleMusic(options): AppleMusic

Defined in: plugins/applemusic/AppleMusic.ts:90

Parameters

options

Omit<AppleMusicOptions, "fetchURL" | "token">

Returns

AppleMusic

Overrides

Plugin.constructor

Properties

name

readonly name: string

Defined in: src/Plugin.ts:8

The name of the plugin.

Inherited from

Plugin.name

Methods

load()

load(ruvyrias): Promise<void>

Defined in: plugins/applemusic/AppleMusic.ts:109

Overrides the load method of the Plugin class, enabling the Apple Music plugin to interact with the Ruvyrias instance.

Parameters

ruvyrias

Ruvyrias

The Ruvyrias instance.

Returns

Promise<void>

Overrides

Plugin.load