@spatulox/simplediscordbot 1.0.17 → 1.0.18
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/bot/BotMessage.d.ts
CHANGED
|
@@ -4,17 +4,17 @@ export declare class BotMessage {
|
|
|
4
4
|
/**
|
|
5
5
|
* Send message to any text-based channel
|
|
6
6
|
*/
|
|
7
|
-
static send(channel: TextChannel | DMChannel | ThreadChannel | string, content?: string | null, component?: SendableComponent): Promise<Message |
|
|
8
|
-
static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: SendableComponent): Promise<Message |
|
|
9
|
-
static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: MessageCreateOptions): Promise<Message |
|
|
10
|
-
static sendDM(user: User | GuildMember | string, content?: string, component?: SendableComponent): Promise<Message |
|
|
7
|
+
static send(channel: TextChannel | DMChannel | ThreadChannel | string, content?: string | null, component?: SendableComponent): Promise<Message | null>;
|
|
8
|
+
static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: SendableComponent): Promise<Message | null>;
|
|
9
|
+
static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: MessageCreateOptions): Promise<Message | null>;
|
|
10
|
+
static sendDM(user: User | GuildMember | string, content?: string, component?: SendableComponent): Promise<Message | null>;
|
|
11
11
|
/**
|
|
12
12
|
* Quick success message
|
|
13
13
|
*/
|
|
14
|
-
static success(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message |
|
|
14
|
+
static success(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message | null>;
|
|
15
15
|
/**
|
|
16
16
|
* Quick error message
|
|
17
17
|
*/
|
|
18
|
-
static error(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message |
|
|
18
|
+
static error(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message | null>;
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=BotMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotMessage.d.ts","sourceRoot":"","sources":["../../src/bot/BotMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,SAAS,EACT,aAAa,EACb,OAAO,EACP,IAAI,EACJ,WAAW,EAAE,oBAAoB,EACpC,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAC,iBAAiB,EAA2B,MAAM,6CAA6C,CAAC;AAGxG,qBAAa,UAAU;IACnB;;OAEG;WACU,IAAI,CAAC,OAAO,EAAC,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"BotMessage.d.ts","sourceRoot":"","sources":["../../src/bot/BotMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,SAAS,EACT,aAAa,EACb,OAAO,EACP,IAAI,EACJ,WAAW,EAAE,oBAAoB,EACpC,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAC,iBAAiB,EAA2B,MAAM,6CAA6C,CAAC;AAGxG,qBAAa,UAAU;IACnB;;OAEG;WACU,IAAI,CAAC,OAAO,EAAC,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;WAC/I,IAAI,CAAC,OAAO,EAAC,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;WACnH,IAAI,CAAC,OAAO,EAAC,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;WAuDtH,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IA4BhI;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,IAAI,GAAG,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAQ/H;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,IAAI,GAAG,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;CAOhI"}
|
package/dist/bot/BotMessage.js
CHANGED
|
@@ -11,13 +11,13 @@ class BotMessage {
|
|
|
11
11
|
try {
|
|
12
12
|
if (!channel) {
|
|
13
13
|
Log_1.Log.warn('Cannot send message: invalid channel');
|
|
14
|
-
return
|
|
14
|
+
return null;
|
|
15
15
|
}
|
|
16
16
|
if (typeof channel === "string") {
|
|
17
17
|
const fetchedChannel = Bot_1.Bot.client.channels.cache.get(channel);
|
|
18
18
|
if (!fetchedChannel?.isTextBased()) {
|
|
19
19
|
Log_1.Log.warn(`Invalid channel ID: ${channel}`);
|
|
20
|
-
return
|
|
20
|
+
return null;
|
|
21
21
|
}
|
|
22
22
|
channel = fetchedChannel;
|
|
23
23
|
}
|
|
@@ -54,7 +54,7 @@ class BotMessage {
|
|
|
54
54
|
}
|
|
55
55
|
catch (e) {
|
|
56
56
|
Log_1.Log.error(`Failed to send message : ${e}`);
|
|
57
|
-
return
|
|
57
|
+
return null;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
static async sendDM(user, content, component) {
|
|
@@ -83,7 +83,7 @@ class BotMessage {
|
|
|
83
83
|
}
|
|
84
84
|
catch (error) {
|
|
85
85
|
Log_1.Log.error(`Failed to send message to ${user}: ${error}`);
|
|
86
|
-
return
|
|
86
|
+
return null;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
/**
|