README.md in slack_messaging-3.2.3 vs README.md in slack_messaging-3.3.0

- old
+ new

@@ -20,45 +20,49 @@ ```bash gem install slack_messaging ``` -## Usage +## Setup This project requires a config file that should look like this: ```yml +discord: + avatar_url: <PUBLIC URL OF AN IMAGE> + username: <AWESOME USER NAME> + webhook_url: <DISCORD WEBHOOK URL> slack: channel: <AWESOME CHANNEL NAME> username: <AWESOME USER NAME> webhook_url: <SLACK WEBHOOK URL> icon_emoji: ':<SOME EMOJI>:' ``` -To generate this file at `~/.slack_messaging.yml`, please run this command: +A config file can have both Discord and Slack settings, or just one or the other. To easily generate this file at `~/.slack_messaging.yml`, please run this command once for each setting type: ```bash slack-messaging setup ``` -To obtain the webhook URL, go to [this link](https://api.slack.com/messaging/webhooks). +To obtain a Slack webhook URL, follow [these instructions](https://slack.com/help/articles/115005265063-Incoming-webhooks-for-Slack). To obtain a Discord webhook URL, follow [these instructions](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks). If you'd like to create the config file at a different directory, I recommend using the `setup` command, and then manually moving the file to your desired location: ```bash slack-messaging setup # Walk through the prompts to create the file mv ~/.slack_messaging.yml /PATH/TO/FILE/config.yml ``` -And then you can pass in that specific file location like this: +And then you can pass in that specific file location using the global `-c`/`--config` flag: ```bash slack-messaging --config="/PATH/TO/FILE/config.yml" send ``` -Once the config file is set up, the project is ready to go! +## Usage To print a friendly message to Slack, run: ```bash slack-messaging send @@ -76,12 +80,32 @@ ```bash slack-messaging send 'MESSAGE 1' 'MESSAGE 2' 'MESSAGE 3' ... 'MESSAGE N' ``` -The output of slack_messaging will look something like this: +> When using special characters in your custom messages, use single quotes instead of double quotes -<img src="https://github.com/emmahsax/slack_messaging/blob/main/QuoteExample.png" width="500"> +If your config file contains both Slack and Discord settings, then running a basic `send` command (either passing in a message or not), will notify both Slack and Discord. To specify which service to send a message to, you can pass in a `-s`/`--service` flag: + +```bash +slack-messaging send --service slack +# OR +slack-messaging send --service discord +``` + +To specify a service _and_ send a customized message, you can pass both at once: + +```bash +slack-messaging send -s slack 'MESSAGE 1' +``` + +The output of a Slack message will look something like this: + +<img src="https://github.com/emmahsax/slack_messaging/blob/main/message_slack.png" width="500"> + +The output of a Discord message will look something like this: + +<img src="https://github.com/emmahsax/slack_messaging/blob/main/message_discord.png" width="500"> I hope you enjoy printing fun and specialized messages to Slack! ## Tests