Skip to content

Commit a81e7e4

Browse files
Add Webhook Documentation
Added documentation for Webhook Support in README.md.
1 parent 46eba1f commit a81e7e4

1 file changed

Lines changed: 41 additions & 1 deletion

File tree

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,44 @@ You can use placeholderAPI placeholders in the messages in the config by doing:
5050

5151
> Note: This only works in the `config.yml`
5252
>
53-
> This will not work for messages in the `locale.yml`
53+
> This will not work for messages in the `locale.yml`
54+
55+
### Webhook Support
56+
57+
Using v2.5.0 or higher, you can use Webhooks as a way to log messages sent via SimplePMs. Previously you may have used DiscordSRV to log SimplePM messages to Discord.
58+
59+
By default the `config.yml` offers these options:
60+
61+
```yml
62+
###
63+
# This adds Webhook Support focused for Discord
64+
###
65+
webhook:
66+
enabled: false
67+
url: ""
68+
# This is the JSON Body to send to the webhook.
69+
# The default value is modeled after https://docs.discord.com/developers/resources/webhook#execute-webhook
70+
# These are the placeholders that can be used:
71+
# <sender>: Sender's Username
72+
# <sender_display_name>: Sender's Display Name (Nickname), Non-players will have the same name as <sender>
73+
# <sender_uuid>: Sender's UUID, formatted as xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, this is blank for non-players.
74+
# <recipient>: Recipient's Username
75+
# <recipient_display_name>: Recipient's Display Name (Nickname), Non-players will have the same name as <recipient>
76+
# <recipient_uuid>: Recipient's UUID, formatted as xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, this is blank for non-players.
77+
# <message>: The message sent through SimplePMs.
78+
# <timestamp>: Unix Timestamp (https://www.unixtimestamp.com/)
79+
json-body: |
80+
{
81+
"content": "{message}\n-# {sender_display_name} ({sender}) sent {recipient_display_name} ({recipient}) this on <t:{timestamp}>",
82+
"avatar_url": "https://mc-heads.net/avatar/{sender_uuid}",
83+
"username": "{sender} > {recipient}"
84+
}
85+
```
86+
87+
- **Enabled**: Whether or not webhooks are enabled.
88+
- **URL**: URL of the webhook.
89+
- **JSON Body**: JSON formatted string intended to be sent as the body in a POST request. Placeholders exist for use as well.
90+
91+
If you are using this for Discord,
92+
- The documentation for the JSON body can be found here: https://docs.discord.com/developers/resources/webhook#create-webhook
93+
- Creating a webhook for Discord can be found here: https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks

0 commit comments

Comments
 (0)