-
Notifications
You must be signed in to change notification settings - Fork 38
/
main.go
48 lines (42 loc) · 926 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"fmt"
"time"
"github.com/hugolgst/rich-go/client"
)
func main() {
err := client.Login("DISCORD_APP_ID")
if err != nil {
panic(err)
}
now := time.Now()
err = client.SetActivity(client.Activity{
State: "Heyy!!!",
Details: "I'm running on rich-go :)",
LargeImage: "largeimageid",
LargeText: "This is the large image :D",
SmallImage: "smallimageid",
SmallText: "And this is the small image",
Party: &client.Party{
ID: "-1",
Players: 15,
MaxPlayers: 24,
},
Timestamps: &client.Timestamps{
Start: &now,
},
Buttons: []*client.Button{
&client.Button{
Label: "GitHub",
Url: "https://github.com/hugolgst/rich-go",
},
},
})
if err != nil {
panic(err)
}
// Discord will only show the presence if the app is running
// Sleep for a few seconds to see the update
fmt.Println("Sleeping...")
time.Sleep(time.Second * 10)
}