Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ikstream/libwebslack
C lib for Slack incoming webhooks
https://github.com/ikstream/libwebslack
c library slack slack-webhook
Last synced: 21 days ago
JSON representation
C lib for Slack incoming webhooks
- Host: GitHub
- URL: https://github.com/ikstream/libwebslack
- Owner: ikstream
- License: gpl-3.0
- Created: 2017-04-27T15:04:17.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-21T17:58:35.000Z (about 7 years ago)
- Last Synced: 2024-11-19T08:50:58.187Z (3 months ago)
- Topics: c, library, slack, slack-webhook
- Language: C
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# __Libwebslack__
libwebslack provides an interface to send messages to slack
via the incomming webhooks system from a C program.#### Depencies
`libcurl`
#### Usage
To send messages you first have to initialize the channel,
the webhook and username.
```
\\create a struct per team you want send messages
struct team_info *ti = malloc(sizeof(*ti));\\set webhook url
if (set_webhook_url(ti, )) {
\\error handling
}\\set the channel you want to post to (max 22 characters)
if (set_channel(ti, "#general")) {
\\error handling
}\\set the username you want to use (max 21 characters)
if (set_username(ti, "libwebslackbot")) {
\\error handling
}\\set emoji for your message (optional)
if (set_emoji(ti, ":ghost:") {
\\error handling
}if (set_message(ti, "your very important message")) {
\\error handling
}if (send_message(ti)) {
\\error handling
}
```
#### Compiler and linker flags
As libwebslack uses libcurl, the compiler needs to know:
`$(pkg-config --libs --cflags libcurl)`#### TODO
libwebslack uses libcurl by now. This __should__ be changed in the
future to be based on standard libs only.