all: init v2 and delete old bridge

This commit is contained in:
Tulir Asokan
2024-08-15 16:43:13 +03:00
parent 64c92ca783
commit 0a7b8bf41b
87 changed files with 458 additions and 13224 deletions

54
pkg/remoteauth/README.md Normal file
View File

@@ -0,0 +1,54 @@
# Discord Remote Authentication
This library implements the desktop side of Discord's remote authentication
protocol.
It is completely based off of the
[Unofficial Discord API Documentation](https://luna.gitlab.io/discord-unofficial-docs/desktop_remote_auth.html).
## Example
```go
package main
import (
"context"
"fmt"
"github.com/skip2/go-qrcode"
)
func main() {
client, err := New()
if err != nil {
fmt.Printf("error: %v\n", err)
return
}
ctx := context.Background()
qrChan := make(chan *qrcode.QRCode)
go func() {
qrCode := <-qrChan
fmt.Println(qrCode.ToSmallString(true))
}()
doneChan := make(chan struct{})
if err := client.Dial(ctx, qrChan, doneChan); err != nil {
close(qrChan)
close(doneChan)
fmt.Printf("dial error: %v\n", err)
return
}
<-doneChan
user, err := client.Result()
fmt.Printf("user: %q\n", user)
fmt.Printf("err: %v\n", err)
}
```