summaryrefslogtreecommitdiff
path: root/server/src/utils/Utils.ts
blob: e7972c2c8c89c5ea93f7ae4ef907c15d8a3b9bc7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
export default class Util {
    static shorten(text: string, maxLen = 2000) {
        return text.length > maxLen ? `${text.substr(0, maxLen - 3)}...` : text;
    }
    
    static canModifyQueue(member) {
        const { channel } = member.voice;
        const botChannel = member.guild.me.voice.channel;
        
        if (channel !== botChannel) {
            member.send('You need to join the voice channel first!'); // error
            return false;
        }
        
        return false;
    }
}