0

I'm building a Bot Framework bot which is connected to the GroupMe channel. According to the (non Bot Framework specific) GroupMe Bot tutorial, GroupMe supports bots sending Image or Location attachments, by sending a message with the following syntax:

{
  "bot_id"  : "j5abcdefg",
  "text"    : "Hello world",
  "attachments" : [
    {
      "type"  : "image",
      "url"   : "https://i.groupme.com/somethingsomething.large"
    }
  ]
}

Or:

{
  "bot_id"  : "j5abcdefg",
  "text"    : "Hello world",
  "attachments" : [
    {
      "type"  : "location",
      "lng"   : "40.000",
      "lat"   : "70.000",
      "name"  : "GroupMe HQ"
    }
  ]
}

I'm trying to figure out how to send a message from the Bot Framework which will map to this attachment format on the GroupMe end, after processing by the Bot Connector. I've tried the following code:

var attachment = new Attachment();
attachment.Content = new
{
    type = "location",
    lng = 70.000,
    lat = 40.000,
    name = "GroupMe HQ"
};

await turnContext.SendActivityAsync(MessageFactory.Attachment(attachment, "Here's the location:"));

However, the attachment does not appear to be present when the message is received in the GroupMe chat. Is there any supported way to send these attachments from the Bot Framework SDK?

Sam Hanley
  • 4,707
  • 7
  • 35
  • 63
  • What error are you getting when you are trying to send the attachment? – ranusharao Aug 05 '19 at 21:36
  • When I send the attachment this way, I don't get any error, but it's also not present when GroupMe receives the message - it seems to be being lost when it's processed by the channel connector. I've also tried using ChannelData, as documented [in the bug report I submitted on GitHub](http://github.com/microsoft/BotFramework-Services/issues/101), in which case I get a status code 500. – Sam Hanley Aug 06 '19 at 01:04

0 Answers0