fixes #3
This commit is contained in:
		@@ -189,7 +189,7 @@ func (c *Client) Auth() error {
 | 
				
			|||||||
		return fmt.Errorf("can't auth user (not a self-bot.)")
 | 
							return fmt.Errorf("can't auth user (not a self-bot.)")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	resp, err := c.Request("POST", "/auth/login", []byte("{\"email\":\""+c.SelfBot.Email+"\",\"password\":\""+c.SelfBot.Password+"\",\"captcha\": \"\"}"))
 | 
						resp, err := c.Request("POST", "/auth/session/login", []byte("{\"email\":\""+c.SelfBot.Email+"\",\"password\":\""+c.SelfBot.Password+"\",\"name\":\"Revoltgo\"}"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								http.go
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								http.go
									
									
									
									
									
								
							@@ -23,7 +23,6 @@ func (c Client) Request(method, path string, data []byte) ([]byte, error) {
 | 
				
			|||||||
	if c.SelfBot == nil {
 | 
						if c.SelfBot == nil {
 | 
				
			||||||
		req.Header.Set("x-bot-token", c.Token)
 | 
							req.Header.Set("x-bot-token", c.Token)
 | 
				
			||||||
	} else if c.SelfBot.SessionToken != "" && c.SelfBot.UserId != "" {
 | 
						} else if c.SelfBot.SessionToken != "" && c.SelfBot.UserId != "" {
 | 
				
			||||||
		req.Header.Set("x-user-id", c.SelfBot.UserId)
 | 
					 | 
				
			||||||
		req.Header.Set("x-session-token", c.SelfBot.SessionToken)
 | 
							req.Header.Set("x-session-token", c.SelfBot.SessionToken)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,7 +54,7 @@ func (c *Client) handleWebsocketAuth() {
 | 
				
			|||||||
	if c.SelfBot == nil {
 | 
						if c.SelfBot == nil {
 | 
				
			||||||
		c.Socket.SendText(fmt.Sprintf("{\"type\":\"Authenticate\",\"token\":\"%s\"}", c.Token))
 | 
							c.Socket.SendText(fmt.Sprintf("{\"type\":\"Authenticate\",\"token\":\"%s\"}", c.Token))
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		c.Socket.SendText(fmt.Sprintf("{\"type\":\"Authenticate\",\"id\":\"%s\",\"session_token\":\"%s\",\"user_id\":\"%s\"}", c.SelfBot.Id, c.SelfBot.SessionToken, c.SelfBot.UserId))
 | 
							c.Socket.SendText(fmt.Sprintf("{\"type\":\"Authenticate\",\"result\":\"Success\",\"_id\":\"%s\",\"token\":\"%s\",\"user_id\":\"%s\",\"name\":\"Revoltgo\"}", c.SelfBot.Id, c.SelfBot.SessionToken, c.SelfBot.UserId))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user