You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-8Lines changed: 13 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,18 @@
1
1
# DiscordWebhookUnity
2
2
DiscordWebhookUnity is a Unity Tool that allows you to send Discord webhook messages directly from your Unity projects. This package supports sending messages with content, embeds, and attachments such as images and text files.
3
3
4
+

5
+
4
6
## Features
5
7
6
8
- Send Discord webhook messages with content, embeds, and attachments.
7
9
- Support for image and text file attachments.
8
10
- Support for sending multiple embeds and attachments in a single message.
9
11
- Easy-to-use API for creating and sending webhook messages.
10
-
- Callback support for handling webhook responses.
12
+
- Callback support for handling webhook responses.
13
+
- Progress callback when processing requests.
14
+
- Discord timestamp conversion utility function.
15
+
- Example code and scenes.
11
16
12
17
13
18
## Installation
@@ -19,7 +24,7 @@ DiscordWebhookUnity is a Unity Tool that allows you to send Discord webhook mess
19
24
20
25
### Simple Webhook
21
26
22
-
Easy way to send a webhook message using method chaining:
27
+
Easy way to send a webhook message using helpful methods:
@@ -67,9 +72,10 @@ Construct a `Webhook` instance and have more control over its properties:
67
72
webhook.SendWebhook(myWebhookURl);
68
73
```
69
74
70
-
### Sending Attachments
75
+
### Adding Attachments
71
76
72
-
You can also send attachments with your webhook messages:
77
+
To include attachments in your webhook simply use the `AddAttachment` or `AddImgAttachmentRes` or `AddTextAttachmentRes` methods.
78
+
also note when adding Attachment, you need to provide a `referencekey` to identify the attachment and helps with referencing the attachment in the embed Thumbnail or Image fields.
73
79
74
80
```csharp
75
81
varwebhook=newWebhook()
@@ -81,10 +87,9 @@ You can also send attachments with your webhook messages:
81
87
webhook.SendWebhook(myWebhookURl);
82
88
```
83
89
84
-
when adding Attachment, you need to provide a `referencekey` to identify the attachment and helps with referencing the attachment in the embed Thumbnail or Image fields.
85
90
86
91
87
-
### Sending Embeds
92
+
### Adding Embeds
88
93
89
94
To include embeds in your webhook messages:
90
95
@@ -121,9 +126,9 @@ providing an external URL to the image will work as well.
121
126
122
127
-`CreateEmbed(string title, string description, Color color)`: Creates a new embed.
123
128
-`CreateNewField(string name, string value, bool inline)`: Adds a new field to the embed.
124
-
-`SetImage(string url)`: Sets the image of the embed.
129
+
-`SetImage(string url)`: Sets the image of the embed. use the `referencekey` to reference the attachment previously added with the same reference key or Direct URL.
125
130
-`SetFooter(string text, string icon_url)`: Sets the footer of the embed.
126
-
-`SetThumbnail(string url)`: Sets the thumbnail of the embed.
131
+
-`SetThumbnail(string url)`: Sets the thumbnail of the embed. use the `referencekey` to reference the attachment previously added with the same reference key or Direct URL.
127
132
128
133
### Attachment Types
129
134
-`Attachment`: Used to load file attachment directly from a file path. e.g. `"c:/path/to/file.txt"`.
0 commit comments