-
-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathloading.js
More file actions
44 lines (39 loc) · 1.43 KB
/
Copy pathloading.js
File metadata and controls
44 lines (39 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/** @typedef {import('discord.js').TextChannel} TextChannel */
/**
* Indicates Aquarius is loading something by using the Typing indicator
* @param {TextChannel} channel - The Text Channel to start the typing indicator
*/
export function startLoading(channel) {
return channel.startTyping();
}
/**
* Indicates Aquarius has finished loading something by using the Typing indicator
* @param {TextChannel} channel - The Text Channel to stop the typing indicator
*/
export function stopLoading(channel) {
return channel.stopTyping();
}
/**
* Determines if the client is currently loading in a channel by using the Typing indicator
* @param {TextChannel} channel - The Text Channel to determine typing status in
* @returns {boolean} If the client is currently typing in the channel
*/
export function isLoading(channel) {
return channel.typing;
}
/**
* Determines how many loading operations the client is currently performing in a channel by using the Typing indicator
* @param {TextChannel} channel - The Text Channel to determine typing count in
* @returns {number} The typing count for the client
*/
export function getLoadingCount(channel) {
return channel.typingCount;
}
/**
* Checks to see if a function is async or not.
* @param {function} handler - Command handler function
* @returns {boolean} Whether the command is async or not
*/
export function isAsyncCommand(handler) {
return handler.constructor.name === 'AsyncFunction';
}