all repos — simple-discord-music-bot @ 4025dc44c0749f0952822a9facce3b32010871a9

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}