Skip to content

Commit a6e9826

Browse files
committed
Added further documentation to explain some special fields.
1 parent ab0ee09 commit a6e9826

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

Writerside/topics/Embed-Management.md

+37-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The format that is expected in those arguments looks like this:
1818
"title": "title",
1919
"description": "description",
2020
"url": "url for title",
21-
"timestamp": "timestamp in epoch seconds",
21+
"timestamp": "timestamp in epoch milliseconds",
2222
"color": "color in hex format, with leading #",
2323
"image": "example image url",
2424
"footer": {
@@ -79,3 +79,39 @@ The format that is expected in those arguments looks like this:
7979
}
8080
```
8181
{collapsible="true" default-state="collapsed" collapsed-title="Example Embed"}
82+
83+
### URL format
84+
85+
Some fields in the embed can contain a URL. This URL is often a link to an image that should be used, but it can reference any possible url.
86+
These fields are checked before the embed is sent, and any of the URLs are not valid, an error will be shown.
87+
The URL must contain a valid protocol, meaning it must start with e.g. `http://` or `https://`.
88+
89+
### Message Link
90+
91+
The message link is a link to a message in discord, which can be obtained by right-clicking on a message and selecting `Copy Message Link`.
92+
This link is used to identify the message that should be edited or read from. \
93+
The regex that is used to match the message link is:
94+
```regex
95+
(?x) # enable comment mode
96+
(?i) # ignore case
97+
(?:https?+://)?+ # 'https://' or 'http://' or ''
98+
(?:(?:canary|ptb)\\.)?+ # 'canary.' or 'ptb.'
99+
discord(?:app)?+\\.com/channels/ # 'discord(app).com/channels/'
100+
(?:(?<server>[0-9]++)|@me) # '@me' or the server id as named group
101+
/ # '/'
102+
(?<channel>[0-9]++) # the textchannel id as named group
103+
/ # '/'
104+
(?<message>[0-9]++) # the message id as named group
105+
```
106+
{collapsible="true" default-state="expanded" collapsed-title="Message Link Regex"}
107+
108+
### Timestamp
109+
110+
The `timestamp` field is a unix timestamp in milliseconds. This is used to display a timestamp in the embed. \
111+
You can convert a date to a timestamp and vice versa by using websites like [this](https://www.epochconverter.com/). \
112+
Please make sure that the timestamp is in milliseconds, as the bot will not convert it for you, resulting in incorrect dates being shown.
113+
114+
### Color
115+
116+
The `color` field is a hex color code, with a leading `#`. This color is used to color the left bar of the embed. \
117+
You can use websites like [this](https://www.w3schools.com/colors/colors_picker.asp) or [this](https://www.color-hex.com/) to find a color you like.

Writerside/topics/Server-Property.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Server Property ✏️
1+
# Server Property
22

33
The server property is a way to store and manage server-specific settings that are used across multiple commands.
44
This includes settings like the moderation log channel, the strike log channel, the score management role, and more.

0 commit comments

Comments
 (0)