• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xxczaki / discord-bot / 21689294588

04 Feb 2026 09:35PM UTC coverage: 93.613% (-0.09%) from 93.701%
21689294588

push

github

xxczaki
fix

972 of 1091 branches covered (89.09%)

Branch coverage included in aggregate %.

2135 of 2228 relevant lines covered (95.83%)

11.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/src/utils/useQueueWithValidation.ts
1
import type { ChatInputCommandInteraction } from 'discord.js';
2
import { useQueue } from 'discord-player';
3
import reportError from './reportError';
4

5
type Options = {
6
        message?: string;
7
        deferred?: boolean;
8
};
9

10
export default function useQueueWithValidation(
11
        interaction: ChatInputCommandInteraction,
12
        options?: Options,
13
) {
14
        const queue = useQueue();
129✔
15

16
        if (!queue) {
129✔
17
                const message = options?.message ?? 'No music is currently playing.';
20✔
18

19
                if (options?.deferred) {
20✔
20
                        interaction.editReply(message).catch((error) => {
2✔
21
                                reportError(error, 'Failed to send queue validation error message');
×
22
                        });
23
                } else {
24
                        interaction
18✔
25
                                .reply({
26
                                        content: message,
27
                                        flags: ['Ephemeral'],
28
                                })
29
                                .catch((error) => {
30
                                        reportError(error, 'Failed to send queue validation error message');
×
31
                                });
32
                }
33

34
                return null;
20✔
35
        }
36

37
        return queue;
109✔
38
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc