https://github.com/luludotdev/discord-welcome-action
Action to keep channel content in-sync with Markdown based templates
https://github.com/luludotdev/discord-welcome-action
action channel discord send typescript welcome
Last synced: 5 months ago
JSON representation
Action to keep channel content in-sync with Markdown based templates
- Host: GitHub
- URL: https://github.com/luludotdev/discord-welcome-action
- Owner: luludotdev
- License: apache-2.0
- Created: 2022-04-12T19:33:14.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-11-20T21:43:13.000Z (almost 2 years ago)
- Last Synced: 2025-04-23T12:55:05.148Z (6 months ago)
- Topics: action, channel, discord, send, typescript, welcome
- Language: TypeScript
- Homepage:
- Size: 10.1 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Discord Welcome Action [](https://github.com/luludotdev/discord-welcome-action/actions/workflows/ci.yml) [](https://github.com/luludotdev/discord-welcome-action/actions/workflows/test.yml)
> Action to keep channel content in-sync with Markdown based templates
## Stability
This action is tested on every push with a [Test Workflow](https://github.com/luludotdev/discord-welcome-action/actions/workflows/test.yml) 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.## Prerequisites
- A Discord Bot with `Manage Webhooks` and `Manage Messages` permissions in the target server(s)
- One or more Markdown template documents using the extended syntax (see below)## Usage
### Action Inputs
| 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 |### Markdown Syntax
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](./test-content/welcome.md) 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](https://raw.githubusercontent.com/luludotdev/discord-welcome-action/master/test-content/welcome.md)._
#### Frontmatter
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) |### Example Workflow
```yml
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 }}
```