Slack bot open message with groupSlack: Retrieve all messagesHow to join a Slack channel as a Real Time Messaging bot user?slack bot respond to messages with a mentionCan a slack bot message another bot?Slack Bot Interactive MessagesHow can a Slack bot detect a direct message vs a message in a channel?Sending direct message to a bot in slack and get the responseSlack scopes and bot usersSlack bot permission to delete a message

Is there a standard definition of the "stall" phenomena?

Array or vector? Two dimensional array or matrix?

Taking advantage when HR forgets to communicate the rules

Advice for making/keeping shredded chicken moist?

Why does "sattsehen" take accusative "mich", not dative "mir"? Even though it is not "me" that I'm looking at?

How to supply water to a coastal desert town with no rain and no freshwater aquifers?

My professor has told me he will be the corresponding author. Will it hurt my future career?

Why did Super-VGA offer the 5:4 1280*1024 resolution?

Is there an upper limit on the number of cards a character can declare to draw from the Deck of Many Things?

Is conquering your neighbors to fight a greater enemy a valid strategy?

How do I talk to my wife about unrealistic expectations?

Does the Milky Way orbit around anything?

What is the meaning of "prairie-dog" in this sentence?

Why was no first prize awarded at a competition?

Will Jimmy fall off his platform?

What's the big deal about the Nazgûl losing their horses?

Chilling juice in copper vessel

Do Goblin tokens count as Goblins?

Why does this function pointer assignment work when assigned directly but not with the conditional operator?

Are "confidant" and "confident" homophones?

Initializing variables in an "if" statement

How to play a D major chord lower than the open E major chord on guitar?

What is the fundamental difference between catching whales and hunting other animals?

Options for quick email reply to the effect of "I've just done it" or "I've taken care of it"



Slack bot open message with group


Slack: Retrieve all messagesHow to join a Slack channel as a Real Time Messaging bot user?slack bot respond to messages with a mentionCan a slack bot message another bot?Slack Bot Interactive MessagesHow can a Slack bot detect a direct message vs a message in a channel?Sending direct message to a bot in slack and get the responseSlack scopes and bot usersSlack bot permission to delete a message






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















Currently I use the webhook method for my "bot" to send messages to team members.



This is great so far:



$curl = curl_init('https://hooks.slack.com/services/XXX/YYY/ZZZ');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($message));
$json_response = curl_exec($curl);


The messages are encoded as JSON as per https://api.slack.com/docs/message-attachments



We use this to send exception reports to individuals. Some exception reports require my project administrator to follow up. (An exception might be "you didn't fill in your calendar for next week.")



I believe it could improve accountability if rather than a robot sending messages directly to a team member, the robot could send the message to the team member and the project administrator.



For direct message we can use



'channel' => '@' . $row['responsible_person'],


but the obvious



'channel' => '@' . $row['responsible_person'] . ',@projectadmin',


does not work.



Is this possible?










share|improve this question






















  • As far as I am aware, it is not possible to send a single message to two different users. A thought though -- what about sending the same message to the two different users independently?

    – Obsidian Age
    Mar 25 at 20:41











  • Yes, you can send messages to a group of people. Its called Group DM. See my answer below for details.

    – Erik Kalkoken
    Mar 25 at 23:37

















1















Currently I use the webhook method for my "bot" to send messages to team members.



This is great so far:



$curl = curl_init('https://hooks.slack.com/services/XXX/YYY/ZZZ');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($message));
$json_response = curl_exec($curl);


The messages are encoded as JSON as per https://api.slack.com/docs/message-attachments



We use this to send exception reports to individuals. Some exception reports require my project administrator to follow up. (An exception might be "you didn't fill in your calendar for next week.")



I believe it could improve accountability if rather than a robot sending messages directly to a team member, the robot could send the message to the team member and the project administrator.



For direct message we can use



'channel' => '@' . $row['responsible_person'],


but the obvious



'channel' => '@' . $row['responsible_person'] . ',@projectadmin',


does not work.



Is this possible?










share|improve this question






















  • As far as I am aware, it is not possible to send a single message to two different users. A thought though -- what about sending the same message to the two different users independently?

    – Obsidian Age
    Mar 25 at 20:41











  • Yes, you can send messages to a group of people. Its called Group DM. See my answer below for details.

    – Erik Kalkoken
    Mar 25 at 23:37













1












1








1








Currently I use the webhook method for my "bot" to send messages to team members.



This is great so far:



$curl = curl_init('https://hooks.slack.com/services/XXX/YYY/ZZZ');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($message));
$json_response = curl_exec($curl);


The messages are encoded as JSON as per https://api.slack.com/docs/message-attachments



We use this to send exception reports to individuals. Some exception reports require my project administrator to follow up. (An exception might be "you didn't fill in your calendar for next week.")



I believe it could improve accountability if rather than a robot sending messages directly to a team member, the robot could send the message to the team member and the project administrator.



For direct message we can use



'channel' => '@' . $row['responsible_person'],


but the obvious



'channel' => '@' . $row['responsible_person'] . ',@projectadmin',


does not work.



Is this possible?










share|improve this question














Currently I use the webhook method for my "bot" to send messages to team members.



This is great so far:



$curl = curl_init('https://hooks.slack.com/services/XXX/YYY/ZZZ');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($message));
$json_response = curl_exec($curl);


The messages are encoded as JSON as per https://api.slack.com/docs/message-attachments



We use this to send exception reports to individuals. Some exception reports require my project administrator to follow up. (An exception might be "you didn't fill in your calendar for next week.")



I believe it could improve accountability if rather than a robot sending messages directly to a team member, the robot could send the message to the team member and the project administrator.



For direct message we can use



'channel' => '@' . $row['responsible_person'],


but the obvious



'channel' => '@' . $row['responsible_person'] . ',@projectadmin',


does not work.



Is this possible?







slack-api






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 20:30









William EntrikenWilliam Entriken

21.2k12 gold badges95 silver badges148 bronze badges




21.2k12 gold badges95 silver badges148 bronze badges












  • As far as I am aware, it is not possible to send a single message to two different users. A thought though -- what about sending the same message to the two different users independently?

    – Obsidian Age
    Mar 25 at 20:41











  • Yes, you can send messages to a group of people. Its called Group DM. See my answer below for details.

    – Erik Kalkoken
    Mar 25 at 23:37

















  • As far as I am aware, it is not possible to send a single message to two different users. A thought though -- what about sending the same message to the two different users independently?

    – Obsidian Age
    Mar 25 at 20:41











  • Yes, you can send messages to a group of people. Its called Group DM. See my answer below for details.

    – Erik Kalkoken
    Mar 25 at 23:37
















As far as I am aware, it is not possible to send a single message to two different users. A thought though -- what about sending the same message to the two different users independently?

– Obsidian Age
Mar 25 at 20:41





As far as I am aware, it is not possible to send a single message to two different users. A thought though -- what about sending the same message to the two different users independently?

– Obsidian Age
Mar 25 at 20:41













Yes, you can send messages to a group of people. Its called Group DM. See my answer below for details.

– Erik Kalkoken
Mar 25 at 23:37





Yes, you can send messages to a group of people. Its called Group DM. See my answer below for details.

– Erik Kalkoken
Mar 25 at 23:37












1 Answer
1






active

oldest

votes


















0














Yes, you can send a message to several users at once with Slack. Its calls "multi-person direct message" or Group DM or MPIM and here is how it works:



  1. Open the new MPIM channel with conversations.open and provide the user IDs with the users property. This will return the ID of the MPIM channel and also create the channel if needed.

  2. Use the channel ID to post your messages as you would with any other channel.

Note that this channel will consist of the members you invited and your bot user.



See also here for an overview of all channel types in Slack.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55345943%2fslack-bot-open-message-with-group%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Yes, you can send a message to several users at once with Slack. Its calls "multi-person direct message" or Group DM or MPIM and here is how it works:



    1. Open the new MPIM channel with conversations.open and provide the user IDs with the users property. This will return the ID of the MPIM channel and also create the channel if needed.

    2. Use the channel ID to post your messages as you would with any other channel.

    Note that this channel will consist of the members you invited and your bot user.



    See also here for an overview of all channel types in Slack.






    share|improve this answer



























      0














      Yes, you can send a message to several users at once with Slack. Its calls "multi-person direct message" or Group DM or MPIM and here is how it works:



      1. Open the new MPIM channel with conversations.open and provide the user IDs with the users property. This will return the ID of the MPIM channel and also create the channel if needed.

      2. Use the channel ID to post your messages as you would with any other channel.

      Note that this channel will consist of the members you invited and your bot user.



      See also here for an overview of all channel types in Slack.






      share|improve this answer

























        0












        0








        0







        Yes, you can send a message to several users at once with Slack. Its calls "multi-person direct message" or Group DM or MPIM and here is how it works:



        1. Open the new MPIM channel with conversations.open and provide the user IDs with the users property. This will return the ID of the MPIM channel and also create the channel if needed.

        2. Use the channel ID to post your messages as you would with any other channel.

        Note that this channel will consist of the members you invited and your bot user.



        See also here for an overview of all channel types in Slack.






        share|improve this answer













        Yes, you can send a message to several users at once with Slack. Its calls "multi-person direct message" or Group DM or MPIM and here is how it works:



        1. Open the new MPIM channel with conversations.open and provide the user IDs with the users property. This will return the ID of the MPIM channel and also create the channel if needed.

        2. Use the channel ID to post your messages as you would with any other channel.

        Note that this channel will consist of the members you invited and your bot user.



        See also here for an overview of all channel types in Slack.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 25 at 23:36









        Erik KalkokenErik Kalkoken

        15.6k3 gold badges29 silver badges54 bronze badges




        15.6k3 gold badges29 silver badges54 bronze badges


















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55345943%2fslack-bot-open-message-with-group%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript