slack-api

How do I receive only the messages that are direct messages to my bot user?

ε祈祈猫儿з 提交于 2019-12-12 06:47:07
问题 I have successfully setup my slack bot app, have enabled events etc. I want to receive any direct messages that the members of my slack team send to my bot. For this, I have only enabled Bot Events and No Team Events like below However, I do not get any event on my webhook on this setting. If I enable message.im event under Team Events, then I start getting events. But then, I get every message that the user (who has installed the app) sends to any other user in the team. How do I get only

Creating a channel in Slack using Ruby [closed]

痴心易碎 提交于 2019-12-12 06:42:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I'm trying to create a channel using the https://github.com/dblock/slack-ruby-client gem. But it keeps on coming up with an error ":Name missing" Can anyone give me a code snippet for creating channels with Slack please. Dave 回答1: Just looking at the source, you would do: client = Slack::Web::Client.new(token:

Call to undefined method from composer added package

試著忘記壹切 提交于 2019-12-12 03:47:46
问题 I'm trying to use SlackBot class with my Laravel 5 app. But I'm getting this error: Call to undefined method Mpociot\SlackBot\Facades\SlackBot::initialize() This is my controller: use SlackBot; public function slack_bot() { $slackbot = new SlackBot(); $slackbot->initialize('xoxb-XXX'); } I tried to debug which methods are available with this: $methods = get_class_methods($slackbot); print_r($methods); and I got this: Array ( [0] => swap [1] => shouldReceive [2] => getFacadeRoot [3] =>

slack doesn't recognize github webhook payload format

∥☆過路亽.° 提交于 2019-12-12 03:33:34
问题 I'm trying to create a slack app that uses incoming webhooks. I want my github repository to post to slack whenever the wiki is updated. I believe I've set up the webhook on github just fine, because I can see that it is attempting a delivery whenever I update the wiki. However, there's always the error, "no_text". I think this error means slack is expecting an item named "text," but the payload from github provides none. I verified this by trying two curl commands from the command prompt (I

Slack Login does't work. Swift 3.0

放肆的年华 提交于 2019-12-12 03:09:27
问题 I develop iOS app with Slack integration using Swift 3.0. How I pass login process: func loginToSlackWithSafariBrowser() { let scope = "channels%3Awrite+users%3Aread" let clientId = "...myClientId" let redirect_uri = "myAppDeepLink://" let authURL = NSURL(string: "https://slack.com/oauth/authorize?client_id=\(clientId)&scope=\(scope)&redirect_uri=\(redirect_uri)") guard let url = authURL else { return } UIApplication.shared.openURL(url as URL) } Then Safari app opens, I enter credential, tap

How to make slackbot reply if the message starts only with a tag

淺唱寂寞╮ 提交于 2019-12-11 23:22:12
问题 so I'm finishing programming a cool slackbot with Nodejs. But i would like the bot to answer only if the command begins with a tag followed by the botname, for example: @joe greet me At the moment i have something like this: if (msg.toLowerCase() == "greet me") bot.postMessageToChannel('general',"wazzup"); The problem is that it only replies if the message is exactly "greet me". I'm not looking for include() function. I just want the bot to answer when tagged and followed by a specific

How to combine slash commands, buttons and dialogs for a menu?

梦想与她 提交于 2019-12-11 18:57:25
问题 My Slack app is started with a slash command, which then posts an ephemeral menu message to the user. That menu has some information and three message buttons. Example: First button allows the user to close the menu Second button allows the user to start an action Third button allows the user to open a dialog for changing options. After the user submits the dialog I want to update the menu message to reflect the changes made in the dialog. However, after the user submits the dialog I can no

Slack Upload : Error while trying to upload using Curl

眉间皱痕 提交于 2019-12-11 17:18:22
问题 I am trying to upload a local file using curl command which I got to know about from here but while trying to run the command, It is not working and throwing error: {"ok":false,"error":"not_authed"} Command I am running is: curl -F file=testsend.txt -F channels=#channel -F token='token' -F filetype=post https://slack.com/api/files.upload 回答1: According to the error message you got, the access token you are using does not seam to be valid. Please double-check that you are using a valid access

How to wrap these decorated functions into a class?

。_饼干妹妹 提交于 2019-12-11 17:03:20
问题 I am attempting to wrap V2 of the Slack API into a class so that I can keep information about my bot encapsulated. Here is one of their example snippets: import slack slack_token = os.environ["SLACK_API_TOKEN"] rtmclient = slack.RTMClient(token=slack_token) @slack.RTMClient.run_on(event='message') def say_hello(**payload): data = payload['data'] if 'Hello' in data['text']: channel_id = data['channel'] thread_ts = data['ts'] user = data['user'] webclient = payload['web_client'] webclient.chat

How to filter bot users belong to my app when I listen to member_joined_channel event

拜拜、爱过 提交于 2019-12-11 15:54:49
问题 I want to know when bot user (belongs to my app) is added to private channel , I know member_joined_channel event will fired for all invites in the private channel but I am interested in the event only when my bot user is added to private channel and ignore other invites. Is there any way I can filter? My app is installed in different workspaces . Bot user id of same app is different for different workspace so I cannot filter by bot user id. 回答1: Every time your app is installed into a new