src/functions/music.ts (view raw)
1import { YouTubeVideo } from 'play-dl';
2import MyQueue from './myqueue';
3
4const queues = new Map<string, MyQueue>();
5
6export function getQueue(server: string): MyQueue {
7 if (queues.has(server))
8 return queues.get(server);
9
10 const q = new MyQueue();
11 queues.set(server, q);
12 return q;
13}
14
15export function formatTitle(video: YouTubeVideo): string {
16 return `**${video.title}** (\`${video.durationRaw}\`)`;
17}