all repos — simple-discord-music-bot @ 858558392fd3953294b6c45ca9951af53a9f1e27

A Discord bot making use of discord.js and play-yt.

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}