You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# == My code start ==SlackBotServer::Service.start!(team)client.token=rc['access_token']information=client.auth_test({token: rc['access_token']})client2=Slack::Web::Client.new(token: token)# always try to create new DMnew_dm=client2.im_open(user: information[:user_id])channel_id=new_dm.channel.id# send messageclient2.chat_postMessage(channel: channel_id,text: "Hello <@#{information[:user_id]}>. Nice to meet you! Type 'help'",as_user: true)client2=nil# == My code end ==
Is there right way, to send message to user immediately after he install the bot? Can you give me advice on how to do better, or leave like that?
thanks
The text was updated successfully, but these errors were encountered:
I don't think there's a "right" way at this point. You probably want to do this in a callback after a connection has been established the first time on start, to avoid re-creating a connection twice, then remember that you sent a welcome message. But this works too.
I need to send initial message to the user after adding my application to his team.
I solve this problem with is monkey patching of the file https://github.com/dblock/slack-bot-server/blob/22a215eec2/slack-bot-server/api/endpoints/teams_endpoint.rb after team activating
Is there right way, to send message to user immediately after he install the bot? Can you give me advice on how to do better, or leave like that?
thanks
The text was updated successfully, but these errors were encountered: