mirror of
				https://github.com/42wim/matterbridge.git
				synced 2025-10-31 22:07:26 +01:00 
			
		
		
		
	Allow to bridge non-bot Discord users (discord) (#689)
If you prefix a token with `User ` it'll treat is as a user token. Co-Authored-By: zomboy-alfrir <zomboy@dancodes.com.ar>
This commit is contained in:
		
							parent
							
								
									464d27ad7e
								
							
						
					
					
						commit
						62e55214fc
					
				| @ -61,6 +61,11 @@ func (b *Bdiscord) Connect() error { | ||||
| 	if !strings.HasPrefix(b.GetString("Token"), "Bot ") { | ||||
| 		token = "Bot " + b.GetString("Token") | ||||
| 	} | ||||
| 	// if we have a User token, remove the `Bot` prefix | ||||
| 	if strings.HasPrefix(b.GetString("Token"),"User ") { | ||||
| 	   token = strings.Replace(token,"Bot ","",-1) | ||||
| 	} | ||||
| 	 | ||||
| 	b.c, err = discordgo.New(token) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Zomboy Alfrir
						Zomboy Alfrir