Skip to content

Commit

Permalink
chore: Update search method parameters in Player and TrackUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
EvarinDev committed Jul 23, 2024
1 parent 9b5ff2a commit 0471843
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/structures/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ export class Player {
* @param requester
*/
public search(query: string | SearchQuery, requester?: User | ClientUser): Promise<SearchResult> {
return this.manager.search(query, requester);
return this.manager.search({
query: query as string,
requester: requester,
});
}

/** Connect to the voice channel. */
Expand Down
5 changes: 4 additions & 1 deletion src/structures/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ export abstract class TrackUtils {
if (!TrackUtils.isUnresolvedTrack(unresolvedTrack)) throw new RangeError("Provided track is not a UnresolvedTrack.");

const query = unresolvedTrack.uri ? unresolvedTrack.uri : [unresolvedTrack.author, unresolvedTrack.title].filter(Boolean).join(" - ");
const res = await TrackUtils.manager.search(query, unresolvedTrack.requester);
const res = await TrackUtils.manager.search({
query,
requester: unresolvedTrack.requester,
});

if (unresolvedTrack.author) {
const channelNames = [unresolvedTrack.author, `${unresolvedTrack.author} - Topic`];
Expand Down

0 comments on commit 0471843

Please sign in to comment.