bakit 2.2.0 → 2.2.2
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/dist/cli.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -1
- package/package.json +4 -4
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { REST, RESTEndpoint, RESTEvents, RESTMethod, RESTOptions, createREST } f
|
|
|
3
3
|
import { EventBus } from '@bakit/utils';
|
|
4
4
|
export { Awaitable, Collection, EventBus, EventMap, FunctionLike, Promisify, PromisifyValue, Queue, QueueOptions, ReadonlyCollection, RejectFn, ResolveFn, attachEventBus, capitalize, createEventBus, createQueue, isPlainObject, isPromiseLike, promisify, sleep } from '@bakit/utils';
|
|
5
5
|
import { APIUser, APIMessage, ChannelType, Snowflake, APIChannel, APIChannelBase, APIGuildTextChannel, APIDMChannel, APIPublicThreadChannel, APIPrivateThreadChannel, APITextBasedChannel, TextChannelType, APIGuildChannel, GuildTextChannelType, APIThreadChannel, MessageFlags, GatewayReceivePayload } from 'discord-api-types/v10';
|
|
6
|
+
import { GatewayMessageCreateDispatchData } from 'discord-api-types/v9';
|
|
6
7
|
import * as discord_api_types_globals from 'discord-api-types/globals';
|
|
7
8
|
export { DEFAULT_GATEWAY_MANAGER_OPTIONS, DEFAULT_WORKER_PATH, GatewayManager, GatewayManagerEvents, GatewayManagerOptions, GatewayWorker, GatewayWorkerEvents, GatewayWorkerOptions, GatewayWorkerState, createGatewayManager, createWorker } from '@bakit/gateway';
|
|
8
9
|
export { RPCError, RPCErrorPayload, RPCHandler, RPCRequestMessage, RPCResponseMessage, Serializable, Service, ServiceFunction, ServiceOptions, TransportClient, TransportClientOptions, TransportDriver, TransportServer, TransportServerOptions, createIPCClient, createIPCServer, createService, createTransportClient, createTransportServer, deserializeRPCError, getIPCPath, serializeRPCError } from '@bakit/service';
|
|
@@ -31,6 +32,7 @@ interface Message {
|
|
|
31
32
|
readonly client: Client;
|
|
32
33
|
readonly id: string;
|
|
33
34
|
readonly channelId: string;
|
|
35
|
+
readonly guildId?: string;
|
|
34
36
|
readonly author: User;
|
|
35
37
|
readonly content: string;
|
|
36
38
|
readonly timestamp: string;
|
|
@@ -48,7 +50,7 @@ interface Message {
|
|
|
48
50
|
readonly referencedMessage?: Message;
|
|
49
51
|
readonly position?: number;
|
|
50
52
|
}
|
|
51
|
-
declare function createMessage(client: Client, data: APIMessage): Message;
|
|
53
|
+
declare function createMessage(client: Client, data: APIMessage | GatewayMessageCreateDispatchData): Message;
|
|
52
54
|
|
|
53
55
|
interface TextBasedChannelSingleton {
|
|
54
56
|
lastMessageId?: Snowflake;
|
package/dist/index.js
CHANGED
|
@@ -74,6 +74,10 @@ function createMessage(client, data) {
|
|
|
74
74
|
get channelId() {
|
|
75
75
|
return data.channel_id;
|
|
76
76
|
},
|
|
77
|
+
get guildId() {
|
|
78
|
+
if ("guild_id" in data)
|
|
79
|
+
return data.guild_id;
|
|
80
|
+
},
|
|
77
81
|
get author() {
|
|
78
82
|
return author || (author = createUser(client, data.author)), author;
|
|
79
83
|
},
|
|
@@ -348,7 +352,7 @@ function createClient(rest) {
|
|
|
348
352
|
rest,
|
|
349
353
|
helpers: void 0
|
|
350
354
|
});
|
|
351
|
-
return Object.assign(self, createHelpers(self)), self.on("raw", (payload) => {
|
|
355
|
+
return Object.assign(self, { helpers: createHelpers(self) }), self.on("raw", (payload) => {
|
|
352
356
|
switch (payload.t) {
|
|
353
357
|
case GatewayDispatchEvents.MessageCreate:
|
|
354
358
|
self.emit("messageCreate", createMessage(self, payload.d));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bakit",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "A framework for discordeno",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"tiny-glob": "^0.2.9",
|
|
42
42
|
"type-fest": "^4.41.0",
|
|
43
43
|
"@bakit/rest": "^2.1.0",
|
|
44
|
-
"@bakit/
|
|
45
|
-
"@bakit/
|
|
46
|
-
"@bakit/
|
|
44
|
+
"@bakit/utils": "^2.0.0",
|
|
45
|
+
"@bakit/gateway": "^2.1.7",
|
|
46
|
+
"@bakit/service": "^3.2.1"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsup",
|