Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1001889 // Try posting in Slack chat as "botstuff"

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (293L/3K/8K).

!752

static S token;
static S channelID = "C0FH9PY8J"; // #talkingbots
static S text = "Bot test";
static S username = "botstuff";

p {
  token = loadSecretTextFileMandatory("relp-slack-botstuff-token").trim();
  S url = "https://slack.com/api/chat.postMessage";
  S postData = "token=" + urlencode(token) + "&channel=" + urlencode(channelID) + "&text=" + urlencode(text)
    + "&username=" + urlencode(username);
  S data = doPost(postData, url);
  print(data);
}

Author comment

Began life as a copy of #1001888

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt

Comments [hide]

ID Author/Program Comment Date
1186 stefan Works :) 2015-12-05 00:57:18

add comment

Snippet ID: #1001889
Snippet name: Try posting in Slack chat as "botstuff"
Eternal ID of this version: #1001889/1
Text MD5: 266a457fa347f693f10eaec68a1b2c2f
Transpilation MD5: 4c6741eb22b13fd530c352db75e030c1
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-06 18:29:07
Source code size: 481 bytes / 15 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 966 / 2427
Referenced in: #1001904 - Try finding bot responses in Slack channel
#1001905 - Another Slack posting test
#1001907 - slackReadTalkingBots
#1001915 - Slack Bot! (not used anymore. relp.slack.com, #talkingbots, can be redirected to other channel)
#1001916 - Try getting Slack user names
#1001938 - Test querying Slack reactions
#1001979 - Old Slack Slurper (sucks Slack channels & stores them)
#1002121 - Get member counts of all channels (relp.slack.com)
#1002172 - loadRelpToken
#1002193 - devChannelToken
#1002647 - Slack Bot Include (dynamic channels, dev.)
#3000202 - Answer for stefanreich (>> T conversion bot)
#3000238 - Answer for stefanreich (>> t power bot)
#3000382 - Answer for ferdie (>> t = 1, f = 0)