Skip to content

Instantly share code, notes, and snippets.

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> {
@Sans3108
Sans3108 / cards.ts
Created April 14, 2024 15:48
Cards
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 = '♣',