dschook 1.0.0 → 1.0.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/package.json +1 -1
- package/readme.md +27 -2
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -15,7 +15,7 @@ pnpm install dschook # or npm, bun, ...
|
|
|
15
15
|
Use:
|
|
16
16
|
|
|
17
17
|
```js
|
|
18
|
-
import { Webhook } from "
|
|
18
|
+
import { Webhook } from "dschook";
|
|
19
19
|
const hook = new Webhook("https://discord.com/api/webhooks/...");
|
|
20
20
|
```
|
|
21
21
|
|
|
@@ -73,8 +73,33 @@ hook.send({
|
|
|
73
73
|
});
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
### Message modifiers
|
|
77
|
+
|
|
78
|
+
Sending messages as a user:
|
|
79
|
+
|
|
80
|
+
```js
|
|
81
|
+
hook.as_user("Charles", /* optional */ "avatarURL").sendText("My name is Charles");
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Sending messages in a thread (the webhook must be in a forum to work):
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
hook.in_thread("Good morning thread").sendComponents(
|
|
88
|
+
text("Good morning!")
|
|
89
|
+
);
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Sending messages with text-to-speech:
|
|
93
|
+
|
|
94
|
+
```js
|
|
95
|
+
hook.with_tts().send_text("boo!");
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
These modifiers can be stacked.
|
|
99
|
+
|
|
100
|
+
|
|
76
101
|
## Currently unsupported
|
|
77
102
|
|
|
78
103
|
PRs welcome!
|
|
79
104
|
- Uploading attachments and/or files
|
|
80
|
-
- Editing and deleting uploaded webhooks
|
|
105
|
+
- Editing and deleting uploaded webhooks
|