@satorijs/adapter-discord 3.7.0 → 3.7.1
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/lib/bot.d.ts +2 -1
- package/lib/index.js +6 -0
- package/lib/index.js.map +2 -2
- package/lib/types/channel.d.ts +2 -2
- package/package.json +1 -1
package/lib/bot.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bot, Context, Fragment, Quester, Schema, Universal } from '@satorijs/satori';
|
|
1
|
+
import { Bot, Context, Fragment, Quester, Schema, SendOptions, Universal } from '@satorijs/satori';
|
|
2
2
|
import { DiscordMessageEncoder } from './message';
|
|
3
3
|
import { Internal, Webhook } from './types';
|
|
4
4
|
import { WsClient } from './ws';
|
|
@@ -41,6 +41,7 @@ export declare class DiscordBot extends Bot<DiscordBot.Config> {
|
|
|
41
41
|
createGuildRole(guildId: string, data: Partial<Universal.Role>): Promise<Universal.Role>;
|
|
42
42
|
modifyGuildRole(guildId: string, roleId: string, data: Partial<Universal.Role>): Promise<void>;
|
|
43
43
|
deleteGuildRole(guildId: string, roleId: string): Promise<void>;
|
|
44
|
+
sendPrivateMessage(userId: string, content: Fragment, options?: SendOptions): Promise<string[]>;
|
|
44
45
|
}
|
|
45
46
|
export declare namespace DiscordBot {
|
|
46
47
|
interface Config extends Bot.Config, Quester.Config, DiscordMessageEncoder.Config, WsClient.Config {
|
package/lib/index.js
CHANGED
|
@@ -1859,6 +1859,12 @@ var DiscordBot = class extends import_satori5.Bot {
|
|
|
1859
1859
|
deleteGuildRole(guildId, roleId) {
|
|
1860
1860
|
return this.internal.deleteGuildRole(guildId, roleId);
|
|
1861
1861
|
}
|
|
1862
|
+
async sendPrivateMessage(userId, content, options) {
|
|
1863
|
+
const channel = await this.internal.createDM({
|
|
1864
|
+
recipient_id: userId
|
|
1865
|
+
});
|
|
1866
|
+
return this.sendMessage(channel.id, content, null, options);
|
|
1867
|
+
}
|
|
1862
1868
|
};
|
|
1863
1869
|
__name(DiscordBot, "DiscordBot");
|
|
1864
1870
|
DiscordBot.MessageEncoder = DiscordMessageEncoder;
|