This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/hex" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"io/ioutil" | |
"net" | |
"os" | |
"strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$message = "Hello this is a test!"; // The message you would like to send | |
$parameters = array( | |
'channel' => 'testing', // Simply type your channel name, make sure your bot is invited | |
'text' => html_entity_decode($message), // Good idea to decode | |
'as_user' => 'true'); | |
// Use groups.list if you run into channel_not_found issues with private channels, make sure your bot is invited | |
$url = "https://slack.com/api/"."chat.postMessage"; // chat.postMessage is the method | |
$parameters['token'] = "MY-API-TOKEN"; // replace MY-API-TOKEN with the API Token for your bot |