chapterjs 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cli/build.js +14 -1
- package/dist/cli/dev.js +29 -1
- package/dist/cli/env.d.ts +5 -0
- package/dist/cli/env.js +39 -3
- package/dist/cli/project.d.ts +30 -7
- package/dist/cli/project.js +85 -11
- package/dist/cli/redis.d.ts +23 -0
- package/dist/cli/redis.js +57 -0
- package/dist/cli/start.js +43 -17
- package/dist/cli/test.js +4 -2
- package/dist/events/registry.d.ts +252 -239
- package/dist/events/registry.js +125 -100
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -0
- package/dist/ranking/declaration.d.ts +12 -0
- package/dist/ranking/declaration.js +48 -0
- package/dist/ranking/ranking.d.ts +102 -0
- package/dist/ranking/ranking.js +129 -0
- package/dist/redis/client.d.ts +36 -0
- package/dist/redis/client.js +252 -0
- package/dist/redis/protocol.d.ts +22 -0
- package/dist/redis/protocol.js +99 -0
- package/dist/redis/url.d.ts +24 -0
- package/dist/redis/url.js +50 -0
- package/dist/store/backend.d.ts +49 -4
- package/dist/store/backend.js +66 -11
- package/dist/store/declaration.d.ts +3 -0
- package/dist/store/declaration.js +8 -3
- package/dist/store/file-backend.d.ts +3 -1
- package/dist/store/file-backend.js +29 -0
- package/dist/store/ipc-backend.d.ts +24 -1
- package/dist/store/ipc-backend.js +49 -0
- package/dist/store/memory-backend.d.ts +4 -2
- package/dist/store/memory-backend.js +27 -1
- package/dist/store/ranking-backend.d.ts +45 -0
- package/dist/store/ranking-backend.js +82 -0
- package/dist/store/redis-backend.d.ts +38 -0
- package/dist/store/redis-backend.js +245 -0
- package/dist/store/redis-ranking.d.ts +15 -0
- package/dist/store/redis-ranking.js +69 -0
- package/dist/store/scope.d.ts +11 -0
- package/dist/store/scope.js +23 -0
- package/dist/store/store.d.ts +39 -5
- package/dist/store/store.js +79 -32
- package/dist/structures/invite.d.ts +6 -0
- package/dist/structures/invite.js +11 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Snowflake } from '../discord/types/common.js';
|
|
2
2
|
import type { RawInvite, RawInviteMetadata } from '../discord/types/invite.js';
|
|
3
3
|
import { Structure } from './base.js';
|
|
4
|
+
import type { GuildChannel } from './channel.js';
|
|
4
5
|
import type { Context } from './context.js';
|
|
5
6
|
import type { User } from './user.js';
|
|
6
7
|
export type InviteData = Omit<RawInvite, 'inviter'> & Partial<RawInviteMetadata>;
|
|
@@ -20,6 +21,11 @@ export declare class Invite extends Structure<InviteData> {
|
|
|
20
21
|
get guildId(): Snowflake | null;
|
|
21
22
|
/** The id of the channel the invite leads to. */
|
|
22
23
|
get channelId(): Snowflake | null;
|
|
24
|
+
/**
|
|
25
|
+
* The channel the invite leads to, when the bot knows it. It never sends
|
|
26
|
+
* a request.
|
|
27
|
+
*/
|
|
28
|
+
get channel(): GuildChannel | null;
|
|
23
29
|
/** When the invite stops working; `null` when it never does. */
|
|
24
30
|
get expiresAt(): Date | null;
|
|
25
31
|
/** How many times the invite was used, when Discord says it. */
|
|
@@ -27,6 +27,17 @@ export class Invite extends Structure {
|
|
|
27
27
|
get channelId() {
|
|
28
28
|
return dataOf(this).channel?.id ?? null;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* The channel the invite leads to, when the bot knows it. It never sends
|
|
32
|
+
* a request.
|
|
33
|
+
*/
|
|
34
|
+
get channel() {
|
|
35
|
+
const id = this.channelId;
|
|
36
|
+
const found = id ? ctxOf(this).cache.channels.get(id) : undefined;
|
|
37
|
+
return found && found.guildId !== null && !found.isThread()
|
|
38
|
+
? found
|
|
39
|
+
: null;
|
|
40
|
+
}
|
|
30
41
|
/** When the invite stops working; `null` when it never does. */
|
|
31
42
|
get expiresAt() {
|
|
32
43
|
return toDate(dataOf(this).expires_at);
|
package/package.json
CHANGED