{"_id":"@eliyya/yasha","_rev":"2-7a354ee4ccc5ac3f773845149f9ea761","name":"@eliyya/yasha","dist-tags":{"latest":"3.2.0"},"versions":{"3.2.0":{"name":"@eliyya/yasha","version":"3.2.0","author":{"url":"https://github.com/davidzeng0","name":"David Zeng"},"license":"MIT","_id":"@eliyya/yasha@3.2.0","maintainers":[{"name":"eliyya","email":"elimacmun@gmail.com"}],"contributors":[{"url":"https://github.com/eliyya","name":"Eli Maciel"},{"url":"https://github.com/rodrago3490","name":"Rodrigo Ortiz"},{"url":"https://github.com/davidzeng0","name":"David Zeng"}],"homepage":"https://github.com/Node-Estudios/ts-yasha#readme","bugs":{"url":"https://github.com/Node-Estudios/ts-yasha/issues"},"dist":{"shasum":"7d2ae276f4303282bf67176861dc05bbe92f3381","tarball":"https://registry.npmjs.org/@eliyya/yasha/-/yasha-3.2.0.tgz","fileCount":45,"integrity":"sha512-Rs2fpYTVpg87ja+7pn8Ukv9qFkSXvV0z0mWmcFXZmAnfjLxuoA/nnuRkjcm1nES7TeIy45a8fdtGrXBLgcHK+A==","signatures":[{"sig":"MEUCIQDhL89jDpHjI1w5e6ab613PYtAKDB4tcjXymYMAWdN7YwIgUBhCmB6qOouK2WhsfdOUkYTLKBBHQZu1XhWMhnlnTO4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":402236},"main":"index.js","types":"index.d.ts","engines":{"node":">=22.0.0"},"gitHead":"d475d9e7b4fa05025dfedb262236330132b805ff","scripts":{"build":"npm run proto && npx tsc","proto":"mkdir -p proto/build; protoc --proto_path=proto --ts_out=proto/build --ts_opt=explicit_override,target=node youtube.proto","prepare":"npm run build","git-publish":"git-publish -b dist"},"_npmUser":{"name":"eliyya","email":"elimacmun@gmail.com"},"repository":{"url":"git+https://github.com/Node-Estudios/ts-yasha.git","type":"git"},"_npmVersion":"10.9.3","description":"Audio Player interface for Discord.js","directories":{},"_nodeVersion":"22.18.0","dependencies":{"youtubei.js":"15.0.1","@eliyya/sange":"1.2.0","@eliyya/sodium":"1.1.0","google-protobuf":"3.21.4"},"eslintConfig":{"rules":{"no-return-assign":"off","@typescript-eslint/indent":["error",4],"@typescript-eslint/comma-dangle":["error","always-multiline"],"@typescript-eslint/restrict-plus-operands":"off","@typescript-eslint/strict-boolean-expressions":"off","@typescript-eslint/explicit-function-return-type":"off","@typescript-eslint/restrict-template-expressions":"off"},"extends":"./node_modules/ts-standard/eslintrc.json","parserOptions":{"project":"./tsconfig.json"},"ignorePatterns":["proto/build","*.js"]},"_hasShrinkwrap":false,"devDependencies":{"discord.js":"14.21.0","typescript":"5.9.2","@types/node":"24.2.0","git-publish":"2.2.0","ts-standard":"12.0.2","@discordjs/voice":"0.18.0","@types/google-protobuf":"3.15.12"},"peerDependencies":{"discord.js":"^14.21.0"},"_npmOperationalInternal":{"tmp":"tmp/yasha_3.2.0_1754618730562_0.03750525747994926","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-08-08T02:05:30.482Z","modified":"2025-08-26T17:43:44.008Z","3.2.0":"2025-08-08T02:05:30.770Z"},"bugs":{"url":"https://github.com/Node-Estudios/ts-yasha/issues"},"author":{"url":"https://github.com/davidzeng0","name":"David Zeng"},"license":"MIT","homepage":"https://github.com/Node-Estudios/ts-yasha#readme","repository":{"url":"git+https://github.com/Node-Estudios/ts-yasha.git","type":"git"},"description":"Audio Player interface for Discord.js","contributors":[{"url":"https://github.com/eliyya","name":"Eli Maciel"},{"url":"https://github.com/rodrago3490","name":"Rodrigo Ortiz"},{"url":"https://github.com/davidzeng0","name":"David Zeng"}],"maintainers":[{"email":"elimacmun@gmail.com","name":"eliyya"},{"email":"rodrigoorfi@gmail.com","name":"rodrago3490"}],"readme":"# yasha\nAudio Player interface for Discord.js\n\n*Sange and Yasha, when attuned by the moonlight and used together, become a very powerful combination.*\n\n### Prerequisites\nOnly compiles on Linux or WSL2+.\n\n1. Install [sange](https://github.com/Node-Estudios/sange) dependencies\n2. libsodium\n3. protoc-gen-ts\n\n### Install\n```bash\n# Debian dependencies\napt install libsodium-dev\n\n# Arch dependencies\nyay -Sy cmake\nnpm i -g protoc-gen-ts\n\n# install\nnpm i @eliyya/yasha\n```\n\nExample usage\n\n```js\n// designed to work with discord.js v13+ and uses discordjs/voice internally for voice connections\n\nvar connection = await VoiceConnection.connect(voiceChannel); // see docs/VoiceConnection.md\nvar player = new TrackPlayer(); // see docs/TrackPlayer.md\n\nvar track = await Source.resolve('https://www.youtube.com/watch?v=dQw4w9WgXcQ'); // see docs/Source.md\n\nconnection.subscribe(player);\nplayer.play(track);\nplayer.start();\n```\n\nSample code\n```js\nconst Discord = require('discord.js');\nconst client = new Discord.Client({\n\tintents: [\n\t\tDiscord.GatewayIntentBits.Guilds,\n\t\tDiscord.GatewayIntentBits.GuildMessages,\n\t\tDiscord.GatewayIntentBits.GuildVoiceStates,\n\t\tDiscord.GatewayIntentBits.MessageContent\n\t]\n});\n\nconst {Source, TrackPlayer, VoiceConnection} = require('@eliyya/yasha');\n\nclient.on('ready', () => {\n\tconsole.log('Ready!');\n});\n\nclient.on('messageCreate', async (message) => {\n\tif(message.content == 'play a song!'){\n\t\t// see docs/VoiceConnection.md\n\t\tvar connection = await VoiceConnection.connect(message.member.voice.channel);\n\n\t\t// see docs/TrackPlayer.md\n\t\tvar player = new TrackPlayer();\n\n\t\t// see docs/Source.md\n\t\tvar track = await Source.resolve('https://www.youtube.com/watch?v=dQw4w9WgXcQ');\n\n\t\tconnection.subscribe(player);\n\t\tplayer.play(track);\n\t\tplayer.start();\n\n\t\tawait message.channel.send('Now playing: **' + track.title.replaceAll('**', '\\\\*\\\\*') + '**');\n\t}\n});\n\nclient.login('your token here');\n```\n","readmeFilename":"README.md"}