-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
80 lines (66 loc) · 2.01 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package main
import (
"github.com/switchupcb/disgo"
"github.com/valyala/fasthttp"
)
func main() {
// set the bot's configuration during the instantiation of a Client.
bot := &disgo.Client{
ApplicationID: "",
// Used for basic Authentication.
Authentication: &disgo.Authentication{
Token: "",
TokenType: "",
Header: "",
},
// Used for OAuth2 Authorization.
Authorization: &disgo.Authorization{
ClientID: "",
ClientSecret: "",
RedirectURI: "",
State: "",
Prompt: "",
Scopes: []string{},
},
// Used to configure HTTP Request and WebSocket Connection parameters.
Config: &disgo.Config{
Request: disgo.Request{
// RateLimiter is an interface defined in ./wrapper/ratelimiter.go
RateLimiter: new(disgo.RateLimit),
// see https://pkg.go.dev/github.com/valyala/fasthttp#Client
Client: &fasthttp.Client{},
Timeout: 0,
Retries: 0,
RetryShared: false,
},
Gateway: disgo.Gateway{
// ShardManager is an interface defined in ./wrapper/shard.go
ShardManager: nil,
// RateLimiter is an interface defined in ./wrapper/ratelimiter.go
RateLimiter: new(disgo.RateLimit),
GatewayPresenceUpdate: &disgo.GatewayPresenceUpdate{
Since: nil,
Status: "",
Game: []*disgo.Activity{},
AFK: false,
},
// It's not recommended to modify these fields directly.
//
// Instead, use Automatic Gateway Intents, EnableIntent, or DisableIntent
// described in ./_contribution/EVENTS.md
IntentSet: make(map[disgo.BitFlag]bool, 0),
Intents: 0,
},
},
// Handlers controls the bot's event handlers.
//
// It's recommended to manage event handlers using Handle() and Remove()
// described in ./_contribution/REQUESTS.md
Handlers: new(disgo.Handlers),
// Sessions controls the bot's WebSocket Sessions (Gateway, Voice)
// when a shard manager is used.
Sessions: disgo.NewSessionManager(),
}
// set a configuration option during runtime.
bot.ApplicationID = ""
}