-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing features from API #8
Comments
So images are somewhat documented now on the GroupMe public api. Adding and removing users, I'm not so sure about. But mentions are another story. I'm using mentions in another [another hubot project of mine, in which I've implemented an "@ALL" feature for GroupMe that mentions every user in the room. To do this, I use the following code to form the request: robot.hear /(.*)@all(.*)/i, (res) ->
message =
'text': res.match[1],
'bot_id': @bot_id,
'attachments': [
"loci": [],
"type": "mentions",
"user_ids": []
]
i = 0
for user, values of robot.brain.users()
message.attachments[0].loci.push([i, i+1])
message.attachments[0].user_ids.push(user)
i += 1
json = JSON.stringify(message)
options =
agent: false
host: "api.groupme.com"
path: "/v3/bots/post"
port: 443
method: "POST"
headers:
'Content-Length': json.length
'Content-Type': 'application/json'
'X-Access-Token': token
req = https.request options, (response) ->
data = ''
response.on 'data', (chunk) -> data += chunk
response.on 'end', ->
console.log "[GROUPME RESPONSE] #{response.statusCode} #{data}"
req.end(json) You'll notice a few things here: First, mentions are added using an
Examplemessage =
text: "Some long string.",
attachments: [
loci: [
[0, 5]
],
type: "mentions",
user_ids: [
12345678
]
] The previous example will tag the user with the ID Note that I'm currently working to include mention capability in the |
There doesn't seem to be any options for doing user mentions, removing/adding users to groups, and adding images as attachments. Is there any way to put those in?
The text was updated successfully, but these errors were encountered: