seyfert 2.2.1-dev-13338418043.0 → 2.2.1-dev-13340711253.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ApplicationEmojiStructure, type EntitlementStructure } from '../../client';
|
|
1
|
+
import { type ApplicationEmojiStructure, type ApplicationStructure, type EntitlementStructure } from '../../client';
|
|
2
2
|
import type { RESTGetAPIEntitlementsQuery, RESTPatchAPIApplicationEmojiJSONBody, RESTPatchCurrentApplicationJSONBody, RESTPostAPIEntitlementBody } from '../../types';
|
|
3
3
|
import type { ApplicationEmojiResolvable } from '../types/resolvables';
|
|
4
4
|
import { BaseShorter } from './base';
|
|
@@ -20,14 +20,14 @@ export declare class ApplicationShorter extends BaseShorter {
|
|
|
20
20
|
* @param body.image The [image data string](https://discord.com/developers/docs/reference#image-data) of the emoji.
|
|
21
21
|
* @returns The created emoji.
|
|
22
22
|
*/
|
|
23
|
-
createEmoji(raw: ApplicationEmojiResolvable): Promise<
|
|
23
|
+
createEmoji(raw: ApplicationEmojiResolvable): Promise<ApplicationEmojiStructure>;
|
|
24
24
|
/**
|
|
25
25
|
* Edits an emoji for the application.
|
|
26
26
|
* @param emojiId The ID of the emoji.
|
|
27
27
|
* @param body.name The new name of the emoji.
|
|
28
28
|
* @returns The edited emoji.
|
|
29
29
|
*/
|
|
30
|
-
editEmoji(emojiId: string, body: RESTPatchAPIApplicationEmojiJSONBody): Promise<
|
|
30
|
+
editEmoji(emojiId: string, body: RESTPatchAPIApplicationEmojiJSONBody): Promise<ApplicationEmojiStructure>;
|
|
31
31
|
/**
|
|
32
32
|
* Deletes an emoji for the application.
|
|
33
33
|
* @param emojiId The ID of the emoji.
|
|
@@ -58,7 +58,7 @@ export declare class ApplicationShorter extends BaseShorter {
|
|
|
58
58
|
* @returns The SKUs.
|
|
59
59
|
*/
|
|
60
60
|
listSKUs(): Promise<import("../../types").RESTGetAPISKUsResult>;
|
|
61
|
-
fetch(): Promise<
|
|
62
|
-
edit(body: RESTPatchCurrentApplicationJSONBody): Promise<
|
|
61
|
+
fetch(): Promise<ApplicationStructure>;
|
|
62
|
+
edit(body: RESTPatchCurrentApplicationJSONBody): Promise<ApplicationStructure>;
|
|
63
63
|
getActivityInstance(instanceId: string): Promise<import("../../types").RestGetAPIApplicationActivityInstanceResult>;
|
|
64
64
|
}
|
|
@@ -16,7 +16,7 @@ class ApplicationShorter extends base_1.BaseShorter {
|
|
|
16
16
|
return cached;
|
|
17
17
|
}
|
|
18
18
|
const data = await this.client.proxy.applications(this.client.applicationId).emojis.get();
|
|
19
|
-
this.client.cache.emojis?.set(__1.CacheFrom.Rest, data.items.map(e => [e.id, e]), this.client.applicationId);
|
|
19
|
+
await this.client.cache.emojis?.set(__1.CacheFrom.Rest, data.items.map(e => [e.id, e]), this.client.applicationId);
|
|
20
20
|
return data.items.map(e => client_1.Transformers.ApplicationEmoji(this.client, e));
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -31,7 +31,7 @@ class ApplicationShorter extends base_1.BaseShorter {
|
|
|
31
31
|
return cached;
|
|
32
32
|
}
|
|
33
33
|
const data = await this.client.proxy.applications(this.client.applicationId).emojis(emojiId).get();
|
|
34
|
-
this.client.cache.emojis?.set(__1.CacheFrom.Rest, data.id, this.client.applicationId, data);
|
|
34
|
+
await this.client.cache.emojis?.set(__1.CacheFrom.Rest, data.id, this.client.applicationId, data);
|
|
35
35
|
return client_1.Transformers.ApplicationEmoji(this.client, data);
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
@@ -44,7 +44,7 @@ class ApplicationShorter extends base_1.BaseShorter {
|
|
|
44
44
|
const data = await this.client.proxy
|
|
45
45
|
.applications(this.client.applicationId)
|
|
46
46
|
.emojis.post({ body: { ...raw, image: await (0, __1.resolveImage)(raw.image) } });
|
|
47
|
-
this.client.cache.emojis?.set(__1.CacheFrom.Rest, data.id, this.client.applicationId, data);
|
|
47
|
+
await this.client.cache.emojis?.set(__1.CacheFrom.Rest, data.id, this.client.applicationId, data);
|
|
48
48
|
return client_1.Transformers.ApplicationEmoji(this.client, data);
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
@@ -55,7 +55,7 @@ class ApplicationShorter extends base_1.BaseShorter {
|
|
|
55
55
|
*/
|
|
56
56
|
async editEmoji(emojiId, body) {
|
|
57
57
|
const data = await this.client.proxy.applications(this.client.applicationId).emojis(emojiId).patch({ body });
|
|
58
|
-
this.client.cache.emojis?.patch(__1.CacheFrom.Rest, emojiId, this.client.applicationId, data);
|
|
58
|
+
await this.client.cache.emojis?.patch(__1.CacheFrom.Rest, emojiId, this.client.applicationId, data);
|
|
59
59
|
return client_1.Transformers.ApplicationEmoji(this.client, data);
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
@@ -21,8 +21,8 @@ class ChannelShorter extends base_1.BaseShorter {
|
|
|
21
21
|
async raw(id, force) {
|
|
22
22
|
if (!force) {
|
|
23
23
|
const channel = await this.client.cache.channels?.raw(id);
|
|
24
|
-
const overwrites = await this.client.cache.overwrites?.raw(id);
|
|
25
24
|
if (channel) {
|
|
25
|
+
const overwrites = await this.client.cache.overwrites?.raw(id);
|
|
26
26
|
if (overwrites)
|
|
27
27
|
channel.permission_overwrites = overwrites;
|
|
28
28
|
return channel;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { UsingClient } from '..';
|
|
2
|
+
import type { ApplicationEmojiStructure, ApplicationStructure } from '../client';
|
|
2
3
|
import type { ApplicationEmojiResolvable, ObjectToLower } from '../common';
|
|
3
4
|
import type { APIApplication, RESTPatchAPIApplicationEmojiJSONBody, RESTPatchCurrentApplicationJSONBody } from '../types';
|
|
4
5
|
import { DiscordBase } from './extra/DiscordBase';
|
|
@@ -12,11 +13,11 @@ export declare class Application extends DiscordBase<APIApplication> {
|
|
|
12
13
|
/**
|
|
13
14
|
* Fetch the current application.
|
|
14
15
|
*/
|
|
15
|
-
fetch(): Promise<
|
|
16
|
+
fetch(): Promise<ApplicationStructure>;
|
|
16
17
|
/**
|
|
17
18
|
* Edit the current application.
|
|
18
19
|
*/
|
|
19
|
-
edit(data: RESTPatchCurrentApplicationJSONBody): Promise<
|
|
20
|
+
edit(data: RESTPatchCurrentApplicationJSONBody): Promise<ApplicationStructure>;
|
|
20
21
|
/**
|
|
21
22
|
* Get an activity instance.
|
|
22
23
|
*/
|
|
@@ -25,18 +26,18 @@ export declare class Application extends DiscordBase<APIApplication> {
|
|
|
25
26
|
/**
|
|
26
27
|
* Get an application emoji.
|
|
27
28
|
*/
|
|
28
|
-
fetch: (id: string) => Promise<
|
|
29
|
+
fetch: (id: string) => Promise<ApplicationEmojiStructure>;
|
|
29
30
|
/**
|
|
30
31
|
* Get the application emojis.
|
|
31
32
|
*/
|
|
32
|
-
list: () => Promise<
|
|
33
|
+
list: () => Promise<ApplicationEmojiStructure[]>;
|
|
33
34
|
/**
|
|
34
35
|
* Create an application emoji.
|
|
35
36
|
*/
|
|
36
|
-
create: (data: ApplicationEmojiResolvable) => Promise<
|
|
37
|
+
create: (data: ApplicationEmojiResolvable) => Promise<ApplicationEmojiStructure>;
|
|
37
38
|
/**
|
|
38
39
|
* Edit an application emoji.
|
|
39
40
|
*/
|
|
40
|
-
edit: (emojiId: string, body: RESTPatchAPIApplicationEmojiJSONBody) => Promise<
|
|
41
|
+
edit: (emojiId: string, body: RESTPatchAPIApplicationEmojiJSONBody) => Promise<ApplicationEmojiStructure>;
|
|
41
42
|
};
|
|
42
43
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { BaseCDNUrlOptions } from '../api';
|
|
2
2
|
import type { ReturnCache } from '../cache';
|
|
3
|
-
import type
|
|
3
|
+
import { type ApplicationEmojiStructure, type GuildEmojiStructure, type GuildStructure, type UserStructure } from '../client';
|
|
4
4
|
import type { UsingClient } from '../commands';
|
|
5
5
|
import { type EmojiShorter, type MethodContext, type ObjectToLower, type When } from '../common';
|
|
6
6
|
import type { APIApplicationEmoji, APIEmoji, RESTPatchAPIApplicationEmojiJSONBody, RESTPatchAPIGuildEmojiJSONBody } from '../types';
|
|
7
|
-
import { User } from './User';
|
|
8
7
|
import { DiscordBase } from './extra/DiscordBase';
|
|
9
8
|
export interface Emoji extends DiscordBase, ObjectToLower<Omit<APIEmoji, 'id' | 'user'>> {
|
|
10
9
|
}
|
|
11
10
|
export declare class Emoji<T extends boolean = false> extends DiscordBase {
|
|
12
|
-
user: When<T,
|
|
11
|
+
user: When<T, UserStructure>;
|
|
13
12
|
constructor(client: UsingClient, data: APIEmoji);
|
|
14
13
|
url(options?: BaseCDNUrlOptions): string;
|
|
15
14
|
toString(): string;
|
|
@@ -40,7 +39,7 @@ export declare class GuildEmoji extends Emoji {
|
|
|
40
39
|
}
|
|
41
40
|
export declare class ApplicationEmoji extends Emoji<true> {
|
|
42
41
|
constructor(client: UsingClient, data: APIApplicationEmoji);
|
|
43
|
-
fetch(): Promise<
|
|
44
|
-
edit(body: RESTPatchAPIApplicationEmojiJSONBody): Promise<
|
|
42
|
+
fetch(): Promise<ApplicationEmojiStructure>;
|
|
43
|
+
edit(body: RESTPatchAPIApplicationEmojiJSONBody): Promise<ApplicationEmojiStructure>;
|
|
45
44
|
delete(): Promise<never>;
|
|
46
45
|
}
|
package/lib/structures/Emoji.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ApplicationEmoji = exports.GuildEmoji = exports.Emoji = void 0;
|
|
4
|
+
const client_1 = require("../client");
|
|
4
5
|
const common_1 = require("../common");
|
|
5
|
-
const User_1 = require("./User");
|
|
6
6
|
const DiscordBase_1 = require("./extra/DiscordBase");
|
|
7
7
|
class Emoji extends DiscordBase_1.DiscordBase {
|
|
8
8
|
user;
|
|
9
9
|
constructor(client, data) {
|
|
10
10
|
super(client, { ...data, id: data.id });
|
|
11
|
-
this.user = (data.user &&
|
|
11
|
+
this.user = (data.user && client_1.Transformers.User(client, data.user));
|
|
12
12
|
}
|
|
13
13
|
url(options) {
|
|
14
14
|
return this.rest.cdn.emojis(this.id).get(options);
|