mirror of
				https://github.com/matrix-org/gomatrix
				synced 2025-11-03 22:08:04 +00:00 
			
		
		
		
	Add Event
This commit is contained in:
		
							parent
							
								
									e5578b12c7
								
							
						
					
					
						commit
						015e6dc5a1
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
					@ -615,6 +615,15 @@ func (cli *Client) UserTyping(roomID string, typing bool, timeout int64) (resp *
 | 
				
			||||||
	return
 | 
						return
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Event gets a single event in a room. It will attempt to JSON unmarshal into the given "outContent" struct with
 | 
				
			||||||
 | 
					// the HTTP response body, or return an error.
 | 
				
			||||||
 | 
					// See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-state-eventtype-statekey
 | 
				
			||||||
 | 
					func (cli *Client) Event(roomID, eventID string, outContent interface{}) (err error) {
 | 
				
			||||||
 | 
						u := cli.BuildURL("rooms", roomID, "event", eventID)
 | 
				
			||||||
 | 
						err = cli.MakeRequest("GET", u, nil, outContent)
 | 
				
			||||||
 | 
						return
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// StateEvent gets a single state event in a room. It will attempt to JSON unmarshal into the given "outContent" struct with
 | 
					// StateEvent gets a single state event in a room. It will attempt to JSON unmarshal into the given "outContent" struct with
 | 
				
			||||||
// the HTTP response body, or return an error.
 | 
					// the HTTP response body, or return an error.
 | 
				
			||||||
// See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-state-eventtype-statekey
 | 
					// See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-state-eventtype-statekey
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue