-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathdisgo.go
More file actions
51 lines (44 loc) · 1.04 KB
/
Copy pathdisgo.go
File metadata and controls
51 lines (44 loc) · 1.04 KB
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
// Package disgo is a collection of packages for interaction with the Discord Bot and OAuth2 API.
package disgo
import (
"runtime"
"runtime/debug"
"github.com/disgoorg/disgo/bot"
"github.com/disgoorg/disgo/bot/handlers"
)
const (
// Name is the library name
Name = "disgo"
// Module is the library module name
Module = "github.com/disgoorg/disgo"
// GitHub is a link to the libraries GitHub repository
GitHub = "https://github.com/disgoorg/disgo"
)
var (
// Version is the currently used version of DisGo
Version = getVersion()
SemVersion = "semver:" + Version
)
func getVersion() string {
bi, ok := debug.ReadBuildInfo()
if ok {
for _, dep := range bi.Deps {
if dep.Path == Module {
return dep.Version
}
}
}
return "unknown"
}
// New creates a new bot.Client with the provided token & bot.ConfigOpt(s)
func New(token string, opts ...bot.ConfigOpt) (*bot.Client, error) {
return bot.BuildClient(token,
opts,
handlers.GetGatewayHandlers(),
handlers.GetHTTPServerHandler(),
runtime.GOOS,
Name,
GitHub,
Version,
)
}