Giter Club home page Giter Club logo

slackr's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slackr's Issues

icon_emoji bug?

Hello, can anyone please help me figure out how to use icon_emoji?

slackrSetup(channel = "@petr", username = "happy-data", icon_emoji = ":bar_chart:", api_token = "xxx")
slackr("test", channel = "@petr")

Still results in using the default icon. Username works though. Thanks!

slackr_upload fails with .gif

I'm on slackr 1.4.2 and am attempting to upload a .gif file to a channel, but it's not working. I used:

httr::with_verbose(slackr_upload(gif_path))

And got:

<- HTTP/1.1 504 Gateway Time-out
<- Content-Type: text/html
<- Transfer-Encoding: chunked
<- Connection: close
<- Date: Mon, 06 Nov 2017 10:49:10 GMT
<- Last-Modified: Fri, 05 Feb 2016 23:46:05 GMT
<- Server: AmazonS3
<- Content-Encoding: gzip
<- Vary: Accept-Encoding
<- Age: 12974
<- X-Cache: Error from cloudfront
<- Via: 1.1 ac094a1c1bf8cbfbb98e93fa2b2431c0.cloudfront.net (CloudFront)
<- X-Amz-Cf-Id: lscQ-wJV7XPrivGJzsUsxX9LhoVEG-_zCjt127SB5ko--INRxNBXQA==

I have successfully used slackr() to post to the channel and am able to successfully post a .png file to the channel. I have also tried adding channel explicitly and it doesn't work. Finally, I have also confirmed that the gif exists at the path supplied.

Only slackr_bot is working

I used the fix offered by @dyerlab and can send messages using slackr_bot(). However when I try slackr() and every other command it appears to work in RStudio but then never shows up in Slack.

slackr() not sending messages to groups

Hello

Since this week, I can't send messages to slack group, only to private users.
Any one else encounter this problem?
I am using the lated slackr version (1.4.2)

Thanks
Tomer

pass graphics devices as parameter to dev.slackr

Pass the dev as a parameter to the function dev.slackr thus be possible to generate plots without depending on X11, for example setting the dev as a png. Simplifying the execution of scripts when executed via terminal (through Rscripts)

slackrUpload command does not upload png file

I started using slackr and it works fine for sending messages. However, when I try to upload a file such as an image, nothing happens. The command seems to run and I don't get any error messages, but nothing happens on the slack channel. Here is my code and I am attaching the verbose log file from the slackrUpload command:

library(slackr)
slackr_setup(channel="#alerts", username="Mark Davis",
incoming_webhook_url = "",
api_token = "
", echo = F)
image_png <- "c:/mark/consulting/dreamcloud/alert_picture.png"
httr::with_verbose(slackrUpload(filename = image_png))

slackr not sending output to private groups

Hello,

I have been trying to send messages to a private group using slackr.
I failed to do so even though I had given write permission to private channels (groups:write).
I was successful in sending text messages to the private channel though using text_slackr

However, as I dig deeper I found out that the slackr calls slackr_chtrans which calls slackr_channels. The issue was in the latter as it uses the API method channels.list which according to the documentation does not return private channels.

At first glance, in order to counter the issue the groups.list method should be used instead.

slackr_upload() not working?

i try to upload my csv like this

slackr_upload("zips.csv")

nothing happens. no error, and no file on slack.

been able to use the functions like slackr() and slackr_users just fine. am I doing something wrong?

tried cran and dev version.

korean encoding problem

Hello,
Could you look into encoding problem with Korean character? It's working fine when all characters are in English yet not with Korean.

For example, the followings are what I've been trying to write through slackr. Krx.Table is data.frame with two columns (shcode and hname).
shcode hname
329 방송 서비스
026 서 비 스 업
308 유 통
312 통 신/방 송
328 통신 서비스
510 KRX미디어통신

When attempting to pass this data.frame using slackr() function, I get the following broken result in slack channel.

shcode hname
1 329 9f<[ <-:q=:
2 26 <- :q =: >w
3 308 @/ Ek
4 312 Ek =E/9f <[
5 328 Ek=E <-:q=:
6 510 KRX9L5p>nEk=E

Difference betwen slackr() and slackrBot()

Apart from using the API token vs a webhook, is there a difference between using slackr() and slackrBot()? Apart from different default emoji, they both look to appear in Slack the same way. If the only difference is the credentials required, might refactoring to have a unified post to slack interface be acceptable?

slackr-not-working-from-within-function

http://stackoverflow.com/questions/31703569/slackr-not-working-from-within-function?noredirect=1

I am using the slackr package to post messages to Slack. I have the following code that works when outside a function (i.e. posts two messages, twice, to Slack), but when used within a function, uses the variable values from outside the function, not as set within the function.

An example will help illustrate.

> n = 2
> 
> # Run a loop, send to slack.  Display content.
> aMsg <- NULL
> for ( i in 1:n ) {
+   msg <- NULL
+   msg <- paste0("Completed ", i, " iteration from loop @ ", Sys.time())
+   aMsg <- c(aMsg, msg)
+   slackr(paste(msg))
+ }
> slackr(aMsg[1], aMsg[2])
> 
> aMsg
[1] "Completed 1 iteration from loop @ 2015-07-29 10:12:45"
[2] "Completed 2 iteration from loop @ 2015-07-29 10:12:46"
> SendToSlack <- function(n) {
+   
+   slackr("Now post to Slack from function")
+   aMsg <- NULL
+   for ( i in 1:n ) {
+     msg <- NULL
+     msg <- paste0("Completed ", i, " iteration from function @ ", Sys.time())
+     aMsg <- c(aMsg, msg)
+     slackr(paste(msg))
+   }
+   slackr(aMsg[1], aMsg[2])
+   return (aMsg)
+   
+ }
> 
> output <- SendToSlack(n)
> output
[1] "Completed 1 iteration from function @ 2015-07-29 10:13:04"
[2] "Completed 2 iteration from function @ 2015-07-29 10:13:04"
> 

From the above snippet, I would expect two messages from the loop outside of the function, then two messages from the call to slackr() after the loop. The min:seconds in the output would be 12:45, 12:46 then 12:45, 12:46 again.

From the call to the function, I would again expect two messages from the loop within the function, then the same two messages from the call to slackr() after the loop. The min:seconds should be 13:04, 13:04 then 13:04, 13:04.

The attached image is the output I actually get in Slack. The loop works as expected, but the call to slackr() from the function for some reason uses the variable values as they were before the function was called (i.e. msg and aMsg are not changed by the function at all). However, slackr does post the string 'Now post to Slack from function' up to Slack from the function.

Anyone have any idea what is going on here? Something to do with global environments? Very odd!

Slack Output

dev.slackr not working

Hi,

Thank you for this wonderfull package!

I think I figure out how to configure the package: slackr(), slackrChannels(), and slackrUsers() are working perfectly.

But graphic related functions give:

dev.slackr("#general")
Erreur dans [.data.table(groups, , 1:2, with = FALSE) : j out of bounds
ggslackr(qplot(mpg, wt, data=mtcars))
Erreur dans [.data.table(groups, , 1:2, with = FALSE) : j out of bounds

Did I miss something?

Again, thank you very much.

Ability to listen to messages sent from slack

I'm assuming this is wishful thinking, but can you add support for the rtm?

Sending stuff from R to slack is cool 'n all, but kicking off a script or something from inside slack and have the result posted to a channel? That would be fancy.

slackr_channel_history problem

we can't get slackr_channel_history to work

> history <- slackr_channel_history(test_token,"C0285CSUF",earliest_date, latest_date, 99L)
Channel C0285CSUF does not exist.
Channel C0285CSUF has no new messages.

seems like the code is not exposing the actual error message:

error = function(e) {
    message(paste("Channel", channel, "does not exist."))
  })

might be good to display the e.message - we know our channel exists and the token is correct - other functions like slackr channels are working ...

Not all parameters being passed to slacker POST

I think this might be related to issue 31.

I noticed that sometimes my settings for username and icon_emoji work (e.g when I use text_slacker) and sometimes they do not, like with dev.slacker. I checked out the code for three of them and they seem to differ:

  • text_slacker.r at line 53 passes everything and it works when I specify username and icon_emoji.

  • dev.slacker.r at line 46 doesn't pass nearly as much. Always posts as me, regardless.

  • slackr.r at line 107 seems to have as_user=TRUE hard-coded so it doesn't matter if you set username and emoji. Always posts as me, regardless.

simple way to add team members to app

is there a way from w/in slackr to make a function that returns the direct web link needed to redirect team members to install the app needed to post to team/channel?

(I am having a bear of a time installing the app to connect to slackr for other users in my team, and they really want to use it!)

Same error for a number of functions

Hi,

I've just started playing around with slackr. I can use the slackr(), slackrUsers() function to post messages, but other functions I try give me errors. e.g.

slackrUpload(filename=fName, title="Test Title", initial_comment="test comment")
Error in [.data.table(groups, , 1:2, with = FALSE) : j out of bounds

dev.slackr("#general")
Error in [.data.table(groups, , 1:2, with = FALSE) : j out of bounds

slackrGroups()
Null data.table (0 rows and 0 cols)

I've seen in another issue that private groups need to be set up for some functions to work, and I'm also not sure if I've set up a full API - it's a little unclear to me on the Slack website what that is. I do have a Web API (https://api.slack.com/web) and a webhook URL.

Any help appreciated!

Can't post to channel with period contained in name

Appears to be an issue using slackr_upload to post to slack channels that contain a period (i.e. assumed as posting to other channels works fine, this is only link to issue that I can think of).

For example:

slackr_upload(filename = "{file_location}", channel = "#sam.gilbert")

I've tried escaping the period but no joy...

(using version 1.4.2)

Error using slack or slack_msg

Hi guys,

i have encountered an issue:

script:

library("slackr", lib.loc="~/R/win-library/3.3")
config= "~/R/config_file.dcf"
slackr_setup(config_file = config, echo = T)
slackr_msg(txt ="hello")

output of slackr_setup:

{
 "SLACK_CHANNEL": ["#general"],
  "SLACK_USERNAME": ["incoming-webhook"],
  "SLACK_ICON_EMOJI": [":ghost:"],
  "SLACK_INCOMING_URL_PREFIX": ["https://hooks.slack.com/services/XXXX/XXXX/XXXX"],
  "SLACK_API_TOKEN": ["XXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXXXXXXXX"]
} 

Error Message:

Error in eval(substitute(expr), envir, enclos) :
'id' column not found in lhs, cannot join

Thanks!

can slackr fail noisily if Slack responds with FALSE ok status?

I was getting errors like 'id' column not found in lhsand also cases where slackr would succeed but no messages would appear on Slack. To find the issue I ended up having to run debug(slackr) and stepping through the function until

resp <- POST(url = "https://slack.com/api/chat.postMessage", 
    body = list(token = api_token, channel = slackr_chtrans(channel), 
        username = username, icon_emoji = icon_emoji, as_user = TRUE, 
        text = sprintf("```%s```", output), link_names = 1))

and executing jsonlite::fromJSON(httr::content(resp, as="text")) while in debug mode. This would reveal the actual error such as:

$ok
[1] FALSE

$error
[1] "missing_scope"

$needed
[1] "chat:write:user"

$provided
[1] "identify,incoming-webhook,channels:read,groups:read,im:read,users:read,chat:write:bot,files:write:user"

It'd be great if slackr could fail loudly when jsonlite::fromJSON(...)$ok==FALSE and return Slack's error message.

Thanks!

dev_slackr into a private channel

Hi,

I can post a graph into a public channel or to a specific person.
I can post to a private channel via slackrBot but I can't post a graph into a private channel.

This works:

library(slackr)
slackr_setup()
dev_slackr(channels = "#PublingChannel123")
dev_slackr(channels = "@Person123")
print("test") %>% 
slackrBot(channel ="#PrivateChannel123",username = "BotName")

This does not work

dev_slackr(channels = "#PrivateChannel123")

Response [https://slack.com/api/files.upload]
Date: 2016-11-25 21:15
Status: 200
Content-Type: application/json; charset=utf-8
Size: 53 B

But the graph is never posted.

Publish latest version to CRAN?

Hi,

I find this package very helpful and use it in a series of weekly analytics scripts. Recently, I encountered a bug that had been fixed on the GitHub version but not yet pushed to CRAN.

For some reason, our internal toolchain is unable to install the version from GitHub (something to do with the inner dependencies, it's not entirely clear to me), so we are not able to use this library anymore.

That said, the version of this package on CRAN is nearly two years old. Would it be possible to publish a new version?

Thanks for developing & maintaining.

`slackr_chtrans` does not find private channels if they start with `#`

If I have a room called private_channel, then slackr_chtrans('private_channel') will return the channel ID but slackr_chtrans('#private_channel') does not.

I think this is because when the Slack API returns private groups, it does not return the channel name with a # in front of it (similar to when the API returns public channels).

slackr_chtrans adds the # at the start of public channels, but does not do so for the private channels.

It's a little more annoying to implement for private channels than public channels because that API call returns both channels and (group) direct messages. But all of the direct messages are prefixed by mpdm-, so it's pretty easy to subset.

cannot post to private channels

So, it seems that

ggslackr(qplot(mpg, wt, data = mtcars), channels = "@private_slackr_test")

successfully sends the ggplot object to slack; however, it doesn't appear in the channel:
screenshot from 2015-07-07 15 47 31

Whereas, if I try sending the plot to a public channel:

ggslackr(qplot(mpg, wt, data = mtcars), channels = "#public_slackr_test")

there are no issues:
screenshot from 2015-07-07 15 48 57

My ~/.slackr looks like

channel: @slackbot
username: slackr
incoming_webhook_url: https://my_slack_team.slack.com/services/hooks/incoming-webhook?
api_token: MY_ISSUED_API_TOKEN

Is this an issue, or something done on purpose?

Error in UseMethod("tbl_vars")

slackr::slackr (and slackr_msg) has recently been working but now producing the following error.

> slackr("test")
Error in UseMethod("tbl_vars") : 
  no applicable method for 'tbl_vars' applied to an object of class "NULL"

> session_info()
Session info --------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.5.0 (2018-04-23)
 system   x86_64, darwin15.6.0        
 ui       RStudio (1.1.442)           
 language (EN)                        
 collate  en_CA.UTF-8                 
 tz       America/Costa_Rica          
 date     2018-06-27                  

Packages ------------------------------------------------------------------------------------------------------------------------
 package    * version    date       source                            
 assertthat   0.2.0      2017-04-11 CRAN (R 3.5.0)                    
 base       * 3.5.0      2018-04-24 local                             
 bindr        0.1.1      2018-03-13 CRAN (R 3.5.0)                    
 bindrcpp     0.2.2      2018-03-29 CRAN (R 3.5.0)                    
 bit          1.1-14     2018-05-29 CRAN (R 3.5.0)                    
 bit64        0.9-7      2017-05-08 CRAN (R 3.5.0)                    
 blob         1.1.1      2018-06-25 Github (tidyverse/blob@77ba6bc)   
 colorspace   1.3-2      2016-12-14 CRAN (R 3.5.0)                    
 compiler     3.5.0      2018-04-24 local                             
 datasets   * 3.5.0      2018-04-24 local                             
 DBI          1.0.0      2018-05-02 CRAN (R 3.5.0)                    
 devtools   * 1.13.5     2018-02-18 CRAN (R 3.5.0)                    
 digest       0.6.15     2018-01-28 CRAN (R 3.5.0)                    
 dplyr        0.7.5      2018-05-19 CRAN (R 3.5.0)                    
 drat       * 0.1.4      2017-12-16 CRAN (R 3.5.0)                    
 ggplot2      2.2.1.9000 2018-06-27 Github (tidyverse/ggplot2@348b26f)
 glue         1.2.0      2017-10-29 CRAN (R 3.5.0)                    
 graphics   * 3.5.0      2018-04-24 local                             
 grDevices  * 3.5.0      2018-04-24 local                             
 grid         3.5.0      2018-04-24 local                             
 gtable       0.2.0      2016-02-26 CRAN (R 3.5.0)                    
 httr         1.3.1      2017-08-20 CRAN (R 3.5.0)                    
 jsonlite     1.5        2017-06-01 CRAN (R 3.5.0)                    
 lazyeval     0.2.1      2017-10-29 CRAN (R 3.5.0)                    
 magrittr     1.5        2014-11-22 CRAN (R 3.5.0)                    
 memoise      1.1.0      2017-04-21 CRAN (R 3.5.0)                    
 methods    * 3.5.0      2018-04-24 local                             
 munsell      0.5.0      2018-06-12 CRAN (R 3.5.0)                    
 pillar       1.2.3      2018-05-25 CRAN (R 3.5.0)                    
 pkgconfig    2.0.1      2017-03-21 CRAN (R 3.5.0)                    
 plyr         1.8.4      2016-06-08 CRAN (R 3.5.0)                    
 purrr        0.2.5      2018-05-29 CRAN (R 3.5.0)                    
 R6           2.2.2      2017-06-17 CRAN (R 3.5.0)                    
 Rcpp         0.12.17    2018-05-18 CRAN (R 3.5.0)                    
 rlang        0.2.1      2018-05-30 CRAN (R 3.5.0)                    
 RSQLite    * 2.1.1      2018-05-06 CRAN (R 3.5.0)                    
 scales       0.5.0      2017-08-24 CRAN (R 3.5.0)                    
 slackr     * 1.4.2      2016-07-20 CRAN (R 3.5.0)                    
 stats      * 3.5.0      2018-04-24 local                             
 testthat   * 2.0.0      2017-12-13 CRAN (R 3.5.0)                    
 tibble       1.4.2      2018-01-22 CRAN (R 3.5.0)                    
 tidyselect   0.2.4      2018-02-26 CRAN (R 3.5.0)                    
 tools        3.5.0      2018-04-24 local                             
 utils      * 3.5.0      2018-04-24 local                             
 withr        2.1.2      2018-03-15 CRAN (R 3.5.0)                    
 yaml         2.1.19     2018-05-01 CRAN (R 3.5.0)  

latex equation

This is more a feature request but it would be nice to be able to parse some latex equation.
Slack does not have an easy way to read latex and I feel like this would be a perfect match.

gglackr does not work

Hi!
thanks a lot for your package. unfortunately I have several troubles with the ggslackr function.
first, this function changes the locale language settings (thanks to Sys.setlocale("LC_ALL", "C") expression). I think it would be great to use the on.exit for restoring locale settings.

and second, this function does not work, as far as I see:

> ggslackr(pic, channels = "upravitelev")
Response [https://slack.com/api/files.upload]
  Date: 2015-12-01 15:32
  Status: 200
  Content-Type: application/json; charset=utf-8
  Size: 53 B

??????????????:
1: Removed 34 rows containing missing values (stat_smooth). 
2: Removed 54 rows containing missing values (stat_smooth). 
3: Removed 88 rows containing missing values (geom_path). 
4: Removed 2 rows containing missing values (geom_path). 
5: Removed 3 rows containing missing values (geom_path). 
6: Removed 3 rows containing missing values (geom_path).

and nothing appears in my slackbot (pic is the ggplot-object)
could you help me with it?

SlackrUpload not including all contents from CSV file

For some reason, the SlackrUpload function is not pushing each line of a csv file to the file uploaded to a designated Slack channel. The csv file created from a dataframe in R contains 60 email addresses, is written to disk, then uploaded to Slack. The csv that gets pushed to Slack then only has 48 email addresses.

I tried using the httr::verbose function around the SlackUpload function and indeed it looks like the upload is parsing the csv first and excluding lines. I am confused why this is the case and why the logic to do so versus just uploading the entire file as is.

I would include the files, but they have PII not appropriate for Github.

Require dplyr ?

Really enjoying slackr 1.3, @hrbrmstr. I tried running the example code (see below) after installing the latest version from GitHub. Unless I'm missing something, with version 1.3.1.9000, the dplyr package isn't being automatically loaded when slackr loads.

> library(slackr)
> packageVersion("slackr")
[1] ‘1.3.1.9000> slackrSetup()
> slackr( str(isis) )
Error in str(isis) : object 'isis' not found
> slackr( str(mtcars) )
> library(ggplot2)
> ggslackr(qplot(mpg, wt, data=mtcars))
Error in slackrChTrans(channels) : could not find function "bind_rows"

> library(dplyr)
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
    filter, lag
The following objects are masked from 'package:base':
    intersect, setdiff, setequal, union

> ggslackr(qplot(mpg, wt, data=mtcars))
Response [https://slack.com/api/files.upload]
  Date: 2015-07-30 19:03
  Status: 200
  Content-Type: application/json; charset=utf-8
  Size: 2.14 kB

slackr_bot() not working from within function

Using slackr_bot(), Incoming web-hook without API token.

slackr_bot() will not pass the correct value when used inside the function. Variable will be evaluate "as constant" not as "variable".

slackr_setup()
a <- function(x) slackr_bot(x)
a(3)

image

Related issue: #18

Error: no token specified on Ubuntu 16.04

Doesn't appear to work on Ubuntu 16.04. I am getting the Error: No toek specified. I tried it both with the Cran version and with the latest github version. Slack no longer requires a token, so this appears to be a bug.

Thanks would love to sue this would make things a lot easier.

Support for new Slack webhook format

Slack has changed the format of their webhook URLs and no longer provides a static base with a single token parameter. Opening a place holder issue until I get a chance to hack in support for URLs in the format of https://hooks.slack.com/services/XXXXX/XXXXX/XXXXX.

bug in ggslackr/dev.slackr ?

I get the following errors when running the ggslackr / dev.slackr examples from the manual:

ggslackr(qplot(mpg, wt, data=mtcars)) Error in rbindlist(l, use.names, fill) : Item 2 has 2 columns, inconsistent with item 1 which has 3 columns. If instead you need to fill missing columns, use set argument 'fill' to TRUE.

I get the same error message with any other ggplot code I run. i.e.

ggslackr(ggplot(iris, aes(x = Species, y = Sepal.Width, fill = Species)) + geom_bar(stat="identity"))

and yes, I created a private group in Slack. The plots in R are created as expected without errors.
I can send messages using slackr just fine. A full api-token is in the config-file.
I am using R 3.1.1 and installed the latest slackr-package from github.

Did I miss something?

Images not posting to slack

Using the new build highlighted here (#18)

I now receive the following error:

slackrUpload(fName, initial_comment=sec, channels=Sys.getenv("SLACK_CHANNEL"))
Error in slackrChTrans(channels) : could not find function "bind_rows"

API_TOKEN appears to be required in addition to webhook

Under v1.1.1, slackr() for the DDSecBlog sample code only posts to my channel when I have API_TOKEN set. Using a config file with only TOKEN doesn't appear to work. Haven't tested previous versions so I'm unclear if this is a regression (or a lack of clue-fullness on my part for that matter).

asynchronous slackr requests

A very nice feature would be to enable asynchronous slackr() calls. At the moment, using slackr for messaging purposes to for instance keep a log of a remotely running service simply slows down the application too much.

dplyr error

Hi all,

Getting the following error with slackr after the update that uses dplyr (perhaps due to dplyr version mismatch?). Any ideas?

> library(slackr)
> slackrSetup()
> plot(1:10, 1:10)
> dev.slackr()
Error: data_frames can only contain 1d atomic vectors and lists
> packageVersion('dplyr')
[1] '0.4.3'
> packageVersion('slackr')
[1] '1.3.1.9001'

slackr_bot can not handle " " inside expressions

Demonstration:

a <- function(x) x
slackr_bot(a(3)) # Works
slackr_bot(a("test")) # Fails

slackr_bot("test") # Works (fixed by https://github.com/hrbrmstr/slackr/pull/37)
slackr_bot(paste("test")) # Fails

Fail generated is Bad Request (HTTP 400).

This is related to 'side fix' of #37. There, I have fixed error when eval(expr) returns with " ". But here the expr itself contains " "

Not resolved - "icon_emoji bug?" (in closed)

I think you are misunderstanding the problem. People here are not talking about adding an emoticon to some text BUT posting "some text" and using an emoticon as the ICON displayed next to their username...

you need to change this in your slackr and slackr_msg functions:
According to the slack api documentation (https://api.slack.com/methods/chat.postMessage), icon_emoji and username parameters are ignored if as_user is TRUE. You simply need to change

resp <- POST(url="https://slack.com/api/chat.postMessage",
body=list(token=api_token,
channel=slackr_chtrans(channel),
username=username,
icon_emoji=icon_emoji,
text=output,
as_user=TRUE,
link_names=1,
...))

to:
resp <- POST(url="https://slack.com/api/chat.postMessage",
body=list(token=api_token,
channel=slackr_chtrans(channel),
username=username,
icon_emoji=icon_emoji,
text=output,
as_user=FALSE,
link_names=1,
...))

and these functions will actually change icon_emoji and username as expected

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.