Action to keep channel content in-sync with Markdown based templates
This action is tested on every push with a Test Workflow to ensure things function as expected. However it has not been extensively battle-tested with many different inputs and configurations so please report any issues you may find.
- A Discord Bot with
Manage Webhooks
andManage Messages
permissions in the target server(s) - One or more Markdown template documents using the extended syntax (see below)
Name | Type | Required | Default | Description |
---|---|---|---|---|
discord-token |
String | true |
n/a | Discord Bot Login Token |
content |
String | true |
./content |
Path to a directory containing template documents |
Template documents can make use of any Markdown syntax that Discord directly supports, as templates are sent almost verbatim to the target channels. You can also use ---
(horizontal rules) to break up the document into multiple messages, otherwise messages will be split automatically.
If you want to insert a blank line between messages, you can use the ::break
special syntax in a dedicated block. The test data has an example of how to use this syntax.
Images will also be embedded correctly, however images must be in a message of their own to be parsed correctly.
Finally, bulleted lists will be transformed to use the Unicode bullet character.
You can see an example of the syntax here.
All Markdown templates must have YAML frontmatter to denote the channel target and allow you to pass additional per-template configuration.
Name | Type | Required | Default | Description |
---|---|---|---|---|
channel |
String | true |
n/a | Snowflake ID of the target channel |
senderName |
String | false |
Server Name | Name of the user sending the message(s) |
senderImage |
String | false |
Server Icon | Icon for the user sending the message(s) |
name: Update Welcome
on: [push]
jobs:
execute:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Welcome
uses: luludotdev/discord-welcome-action@v1
with:
content: ./content
discord-token: ${{ secrets.DISCORD_TOKEN }}