-
Notifications
You must be signed in to change notification settings - Fork 2
/
dgate.go
35 lines (27 loc) · 797 Bytes
/
dgate.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
package dgate
import (
"github.com/luminaldev/dgate/discord"
"github.com/luminaldev/dgate/types"
)
type Client struct {
Selfbot *discord.Selfbot
Gateway *discord.Gateway
Config *types.Config
}
func NewClient(token string, config *types.Config) *Client {
selfbot := discord.Selfbot{Token: token}
gateway := discord.CreateGateway(&selfbot, config)
return &Client{&selfbot, gateway, config}
}
func (client *Client) Connect() error {
return client.Gateway.Connect()
}
func (client *Client) AddHandler(event string, function any) error {
return client.Gateway.Handlers.Add(event, function)
}
func (client *Client) GetMembers(guildId string, memberIds []string) error {
return client.Gateway.GetMembers(guildId, memberIds)
}
func (client *Client) Close() {
client.Gateway.Close()
}