Commit f85f12c 1 parent bde8f23 commit f85f12c Copy full SHA for f85f12c
File tree 4 files changed +40
-1
lines changed
4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -107,4 +107,8 @@ const (
107
107
// Permissions
108
108
GuildApplicationCommandsPermissionsFmt = GuildApplicationsFmt + "/permissions"
109
109
GuildApplicationCommandPermissionsFmt = GuildApplicationsFmt + "/%d/permissions"
110
+
111
+ // Gateway
112
+ GatewayFmt = BaseURL + "/gateway"
113
+ GatewayBotFmt = GatewayFmt + "/bot"
110
114
)
Original file line number Diff line number Diff line change
1
+ package rest
2
+
3
+ import (
4
+ "net/http"
5
+
6
+ "github.com/Postcord/objects"
7
+ )
8
+
9
+ func (c * Client ) Gateway () (* objects.Gateway , error ) {
10
+ var gateway objects.Gateway
11
+ err := NewRequest ().
12
+ Method (http .MethodGet ).
13
+ Path (GatewayFmt ).
14
+ ContentType (JsonContentType ).
15
+ Expect (http .StatusOK ).
16
+ Bind (& gateway ).
17
+ Send (c )
18
+
19
+ return & gateway , err
20
+ }
21
+
22
+ func (c * Client ) GatewayBot () (* objects.Gateway , error ) {
23
+ var gateway objects.Gateway
24
+ err := NewRequest ().
25
+ Method (http .MethodGet ).
26
+ Path (GatewayBotFmt ).
27
+ ContentType (JsonContentType ).
28
+ Expect (http .StatusOK ).
29
+ Bind (& gateway ).
30
+ Send (c )
31
+
32
+ return & gateway , err
33
+ }
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/Postcord/rest
3
3
go 1.14
4
4
5
5
require (
6
- github.com/Postcord/objects v0.0.17
6
+ github.com/Postcord/objects v0.0.18
7
7
github.com/go-redis/redis/v8 v8.11.4
8
8
github.com/go-redsync/redsync/v4 v4.4.2
9
9
github.com/google/go-querystring v1.1.0
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ github.com/Postcord/objects v0.0.16 h1:rPIPg+gKw1TxPkvY/7iBRH89+Ei5o3M/Da+sKdUF9
2
2
github.com/Postcord/objects v0.0.16 /go.mod h1:DdFNHjas9Xby/YNGwr5XWuD+8kyNvGmtozW4LiF3QF8 =
3
3
github.com/Postcord/objects v0.0.17 h1:S2Smapxv9da1hccKgTblXmVHGtuP1slXEZsrhVFivas =
4
4
github.com/Postcord/objects v0.0.17 /go.mod h1:DdFNHjas9Xby/YNGwr5XWuD+8kyNvGmtozW4LiF3QF8 =
5
+ github.com/Postcord/objects v0.0.18 h1:BFxlpJK7/mCcCUPPDz/OPgehpLwr6pym+Mi7fmqkGXA =
6
+ github.com/Postcord/objects v0.0.18 /go.mod h1:DdFNHjas9Xby/YNGwr5XWuD+8kyNvGmtozW4LiF3QF8 =
5
7
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE =
6
8
github.com/cespare/xxhash/v2 v2.1.2 /go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs =
7
9
github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
You can’t perform that action at this time.
0 commit comments