File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ You have to provide this API permissions: `Chat.ReadWrite`
172
172
getJoinedTeams(): array|GraphResponse|mixed
173
173
getChannels(team): array|GraphResponse|mixed
174
174
getChats(): array|GraphResponse|mixed
175
+ getChat(id): array|GraphResponse|mixed
175
176
getMembersInChat(chat): array|GraphResponse|mixed
176
177
send(teamOrChat, message): array|GraphResponse|mixed
177
178
```
@@ -200,6 +201,12 @@ Get all the chats for a user ( additional permissions needed: `Chat.Read.All` )
200
201
201
202
``` php
202
203
$chats = $teamsClass->getChats();
204
+
205
+ ```
206
+ Get a chat by a given id ( additional permissions needed: ` Chat.Read.All ` )
207
+
208
+ ``` php
209
+ $chats = $teamsClass->getChat('your-chat-id');
203
210
```
204
211
205
212
Get all the members in a channel ( additional permissions needed: ` ChannelMessage.Read.All ` )
Original file line number Diff line number Diff line change 4
4
5
5
use LLoadout \Microsoftgraph \Traits \Authenticate ;
6
6
use LLoadout \Microsoftgraph \Traits \Connect ;
7
+ use Microsoft \Graph \Http \GraphResponse ;
7
8
use Microsoft \Graph \Model \Channel ;
8
9
use Microsoft \Graph \Model \Chat ;
9
10
use Microsoft \Graph \Model \ConversationMember ;
@@ -30,6 +31,14 @@ public function getChats(): array
30
31
return $ this ->get ('/me/chats ' , returns: Chat::class);
31
32
}
32
33
34
+ /**
35
+ * Get a specific chat by id
36
+ */
37
+ public function getChat (string $ id ): Chat
38
+ {
39
+ return $ this ->get ('/me/chats/ ' .$ id , returns: Chat::class);
40
+ }
41
+
33
42
/**
34
43
* Get all the members in a chat
35
44
*/
@@ -49,7 +58,7 @@ public function getChannels(Team $team): array
49
58
/**
50
59
* Send a message to a chat
51
60
*/
52
- public function send (Chat |Channel $ chat , string $ message ): array
61
+ public function send (Chat |Channel $ chat , string $ message ): GraphResponse
53
62
{
54
63
55
64
$ data = json_decode ('{"body": {"contentType": "html"}} ' );
You can’t perform that action at this time.
0 commit comments