MCPcopy
hub / github.com/eritislami/evobot / makeResource

Method makeResource

structs/Song.ts:63–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61 }
62
63 public async makeResource(): Promise<AudioResource<Song> | void> {
64 let playStream;
65
66 const source = this.url.includes("youtube") ? "youtube" : "soundcloud";
67
68 if (source === "youtube") {
69 playStream = await stream(this.url);
70 }
71
72 if (!stream) return;
73
74 return createAudioResource(playStream.stream, { metadata: this, inputType: playStream.type, inlineVolume: true });
75 }
76
77 public startMessage() {
78 return i18n.__mf("play.startedPlaying", { title: this.title, url: this.url });

Callers 1

processQueueMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected