Skip to content

Commit

Permalink
Minor changes + credit
Browse files Browse the repository at this point in the history
Credit to user rgaida
  • Loading branch information
emilh91 committed Oct 3, 2015
1 parent b06989f commit 80aafc4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function disableSmsMode()
```

### Attachments
When sending messages (bot, direct, or group), you can specify an array of attachments. A factory class exists to easily create attachments: `GroupMeApiClient\AttachmentUtils`.
When sending messages (bot, direct, or group), you can specify an array of attachments. A factory class exists to easily create attachments: `GroupMeApi\AttachmentUtils`.
```php
public static function makeLocationAttachment($lat, $lng, $name='')
public static function makeImageAttachment($image_url)
Expand All @@ -79,9 +79,12 @@ public static function makeEmojiAttachment(array $charmap)
```

### Emojis
Aah, the pinnacle of modern communication... To send emojis in GroupMe, you need to specify a charmap (character map) when creating the attachment. For this purpose, another factory class exists: `GroupMeApiClient\EmojiUtils`.
Aah, the pinnacle of modern communication... To send emojis in GroupMe, you need to specify a charmap (character map) when creating the attachment. For this purpose, another factory class exists: `GroupMeApi\EmojiUtils`.

```php
require 'vendor/autoload.php';
$c = new GroupMeApi\Client('API-KEY');

$raw_text = 'Hello :cool_guy_face::cigar_face:';
$emojification = GroupMeApi\EmojiUtils::extractEmojiNamesFromText($raw_text); // returns an array
$emoji_attachment = GroupMeApi\AttachmentUtils::makeEmojiAttachment($emojification['charmap']);
Expand All @@ -99,3 +102,4 @@ $res = $c->uploadImage('my_image_file.png', 'image/png', 'testpic');

If the upload was successfull, the return variable contains the image url in `$res['payload']['url']` or an error message in `$res['error'][]`.

Thanks to user [rgaida](https://github.com/rgaida) for fixing the image service!

0 comments on commit 80aafc4

Please sign in to comment.