Send messages to a Mattermost channel from the command line.
curljq
This script authenticates with your Mattermost username and password.
- Your username is shown under your profile picture in the top-left corner of Mattermost, or in Profile → Username.
- Your password is the one you use to log in to
https://mattermost.ufal.mff.cuni.cz.
MM_USERNAME=XXX MM_PASSWORD=YYY ./ping_message.sh "This comes from a bot ran by $USER"By default the message is sent to #mattermost-bot-demo. To send to a different channel, pass the channel name (without #) as a second argument:
MM_USERNAME=XXX MM_PASSWORD=YYY ./ping_message.sh "Hello!" mattermost-bot-demoTo avoid typing credentials every time, export them in your shell:
export MM_USERNAME=XXX
export MM_PASSWORD=YYY
./ping_message.sh "This comes from a bot ran by $USER"@channel— notifies everyone in the channel@here— notifies online members@username— notifies a specific user
MM_USERNAME=XXX MM_PASSWORD=YYY ./ping_message.sh "@channel Job finished by $USER, it costed a ton but it was worth it 🚀."