An open API service indexing awesome lists of open source software.

https://github.com/sor4chi/discorder

send discord webhook from cli
https://github.com/sor4chi/discorder

Last synced: about 1 month ago
JSON representation

send discord webhook from cli

Awesome Lists containing this project

README

        

# Discorder

A cli tool for sending text or file to Discord Webhook

```txt
Usage: discorder [OPTIONS]

Options:
-w, --webhook Discord Webhook URL
-t, --text A text to send
-f, --file A file to send
-c, --config Config file path [default: ./discorder.yaml]
-h, --help Print help
-V, --version Print version
```

## Installation

All [releases](
https://github.com/sor4chi/discorder/releases
) are available on GitHub.

### eg. using `wget` and `unzip`

```sh
$ wget
$ unzip
$ sudo install /usr/local/bin
```

## Usage

```sh
# Send a text
$ discorder -w https://discordapp.com/api/webhooks/xxx/yyy -t "Hello, World!"

# Send a file
$ discorder -w https://discordapp.com/api/webhooks/xxx/yyy -f ./hello.txt

# Send a text and a file
$ discorder -w https://discordapp.com/api/webhooks/xxx/yyy -t "Hello, World!" -f ./hello.txt

# Send from stdin
$ echo "Hello, World!" | discorder -w https://discordapp.com/api/webhooks/xxx/yyy
$ cat ./hello.txt | discorder -w https://discordapp.com/api/webhooks/xxx/yyy
```

## Config file

```yaml
webhook: https://discordapp.com/api/webhooks/xxx/yyy
```

Config load order is:

1. `$DISCORDER_CONFIG_PATH` environment variable
2. `--config` option
3. `./discorder.yml`
4. `./discorder.yaml`
5. `~/.config/discorder/discorder.yml`
6. `~/.config/discorder/discorder.yaml`