@@ -31,7 +31,12 @@ import (
31
31
"github.com/veteran-software/discord-api-wrapper/routes"
32
32
)
33
33
34
- /* CHANNEL OBJECT */
34
+ const (
35
+ afterQsp = "after="
36
+ aroundQsp = "around="
37
+ beforeQsp = "before="
38
+ limitQsp = "limit="
39
+ )
35
40
36
41
// Channel - Represents a guild or DM channel within Discord.
37
42
type Channel struct {
@@ -544,16 +549,16 @@ SUPPORTS: "around : Snowflake"; "before : Snowflake"; "after : Snowflake"; "limi
544
549
func (c * Channel ) GetChannelMessages (around * Snowflake , before * Snowflake , after * Snowflake , limit * int ) (method , route string ) {
545
550
var qsp []string
546
551
if around != nil {
547
- qsp = append (qsp , "around=" + around .String ())
552
+ qsp = append (qsp , aroundQsp + around .String ())
548
553
}
549
554
if before != nil {
550
- qsp = append (qsp , "before=" + before .String ())
555
+ qsp = append (qsp , beforeQsp + before .String ())
551
556
}
552
557
if after != nil {
553
- qsp = append (qsp , "after=" + after .String ())
558
+ qsp = append (qsp , afterQsp + after .String ())
554
559
}
555
560
if limit != nil {
556
- qsp = append (qsp , "limit=" + strconv .Itoa (* limit ))
561
+ qsp = append (qsp , limitQsp + strconv .Itoa (* limit ))
557
562
}
558
563
var q string
559
564
if len (qsp ) > 0 {
@@ -710,10 +715,10 @@ OPTS SUPPORTS: "after : Snowflake"; "limit : int", nil
710
715
func (c * Channel ) GetReactions (messageID Snowflake , emoji string , after * Snowflake , limit * int ) (method , route string ) {
711
716
var qsp []string
712
717
if after != nil {
713
- qsp = append (qsp , "after=" + after .String ())
718
+ qsp = append (qsp , afterQsp + after .String ())
714
719
}
715
720
if limit != nil {
716
- qsp = append (qsp , "limit=" + strconv .Itoa (* limit ))
721
+ qsp = append (qsp , limitQsp + strconv .Itoa (* limit ))
717
722
}
718
723
var q string
719
724
if len (qsp ) > 0 {
@@ -1181,10 +1186,10 @@ Requires the READ_MESSAGE_HISTORY permission.
1181
1186
func (c * Channel ) ListPublicArchivedThreads (before * time.Time , limit * int ) (method , route string ) {
1182
1187
var qsp []string
1183
1188
if before != nil {
1184
- qsp = append (qsp , "before=" + before .Format (time .RFC3339 ))
1189
+ qsp = append (qsp , beforeQsp + before .Format (time .RFC3339 ))
1185
1190
}
1186
1191
if limit != nil {
1187
- qsp = append (qsp , "limit=" + strconv .Itoa (* limit ))
1192
+ qsp = append (qsp , limitQsp + strconv .Itoa (* limit ))
1188
1193
}
1189
1194
var q string
1190
1195
if len (qsp ) > 0 {
@@ -1205,10 +1210,10 @@ Requires both the READ_MESSAGE_HISTORY and MANAGE_THREADS permissions.
1205
1210
func (c * Channel ) ListPrivateArchivedThreads (before * time.Time , limit * int ) (method , route string ) {
1206
1211
var qsp []string
1207
1212
if before != nil {
1208
- qsp = append (qsp , "before=" + before .Format (time .RFC3339 ))
1213
+ qsp = append (qsp , beforeQsp + before .Format (time .RFC3339 ))
1209
1214
}
1210
1215
if limit != nil {
1211
- qsp = append (qsp , "limit=" + strconv .Itoa (* limit ))
1216
+ qsp = append (qsp , limitQsp + strconv .Itoa (* limit ))
1212
1217
}
1213
1218
var q string
1214
1219
if len (qsp ) > 0 {
@@ -1229,10 +1234,10 @@ Requires the READ_MESSAGE_HISTORY permission.
1229
1234
func (c * Channel ) ListJoinedPrivateArchivedThreads (before * Snowflake , limit * int ) (method , route string ) {
1230
1235
var qsp []string
1231
1236
if before != nil {
1232
- qsp = append (qsp , "before=" + before .String ())
1237
+ qsp = append (qsp , beforeQsp + before .String ())
1233
1238
}
1234
1239
if limit != nil {
1235
- qsp = append (qsp , "limit=" + strconv .Itoa (* limit ))
1240
+ qsp = append (qsp , limitQsp + strconv .Itoa (* limit ))
1236
1241
}
1237
1242
var q string
1238
1243
if len (qsp ) > 0 {
0 commit comments