This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BaseExtractor, ExtractorInfo, ExtractorSearchContext, Playlist, QueryType, SearchQueryType, Track, Util } from 'discord-player'; | |
import SoundCloud from 'soundcloud.ts'; | |
//@ts-ignore Idk why but it doesnt work if I just do `new SoundCloud()` | |
const soundcloud: SoundCloud = new SoundCloud.default(); | |
export class SoundCloudExtractor extends BaseExtractor { | |
public static identifier = 'apiBasedSoundCloudExtractor' as const; | |
public async validate(query: string, type?: SearchQueryType | null | undefined): Promise<boolean> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { randomInt } from 'crypto'; | |
type DeepRequired<T extends object> = Required<{ | |
[P in keyof T]: T[P] extends object | undefined ? DeepRequired<Required<T[P]>> : T[P]; | |
}>; | |
enum CardSuit { | |
hearts = '♥', | |
diamonds = '♦', | |
clubs = '♣', |