-
Notifications
You must be signed in to change notification settings - Fork 0
/
client_guild_rankings.go
103 lines (83 loc) · 4.57 KB
/
client_guild_rankings.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package tatsu_api
import (
"context"
"golang.org/x/xerrors"
)
// GetAllTimeGuildMemberRanking wraps around GetAllTimeGuildMemberRankingWithContext using the background context.
func (c *Client) GetAllTimeGuildMemberRanking(guildID string, userID string) (*GuildMemberRanking, error) {
return c.GetAllTimeGuildMemberRankingWithContext(context.Background(), guildID, userID)
}
// GetAllTimeGuildMemberRankingWithContext gets a guild member's all time ranking using the specified context.
func (c *Client) GetAllTimeGuildMemberRankingWithContext(ctx context.Context, guildID string,
userID string) (*GuildMemberRanking, error) {
ranking, err := c.rc.getAllTimeGuildMemberRanking(ctx, guildID, userID)
if err != nil {
return nil, xerrors.Errorf("failed to get all time guild member ranking: %w", err)
}
return ranking, err
}
// GetCurrentMonthGuildMemberRanking wraps around GetCurrentMonthGuildMemberRankingWithContext using the background context.
func (c *Client) GetCurrentMonthGuildMemberRanking(guildID string, userID string) (*GuildMemberRanking, error) {
return c.GetCurrentMonthGuildMemberRankingWithContext(context.Background(), guildID, userID)
}
// GetCurrentMonthGuildMemberRankingWithContext gets a guild member's current month ranking using the specified context.
func (c *Client) GetCurrentMonthGuildMemberRankingWithContext(ctx context.Context, guildID string,
userID string) (*GuildMemberRanking, error) {
ranking, err := c.rc.getCurrentMonthGuildMemberRanking(ctx, guildID, userID)
if err != nil {
return nil, xerrors.Errorf("failed to get current month guild member ranking: %w", err)
}
return ranking, err
}
// GetCurrentWeekGuildMemberRanking wraps around GetCurrentWeekGuildMemberRankingWithContext using the background context.
func (c *Client) GetCurrentWeekGuildMemberRanking(guildID string, userID string) (*GuildMemberRanking, error) {
return c.GetCurrentWeekGuildMemberRankingWithContext(context.Background(), guildID, userID)
}
// GetCurrentWeekGuildMemberRankingWithContext gets a guild member's current week ranking using the specified context.
func (c *Client) GetCurrentWeekGuildMemberRankingWithContext(ctx context.Context, guildID string,
userID string) (*GuildMemberRanking, error) {
ranking, err := c.rc.getCurrentWeekGuildMemberRanking(ctx, guildID, userID)
if err != nil {
return nil, xerrors.Errorf("failed to get current week guild member ranking: %w", err)
}
return ranking, err
}
// GetAllTimeGuildRankings wraps around GetAllTimeGuildRankingsWithContext using a background context.
func (c *Client) GetAllTimeGuildRankings(guildID string, offset uint64) (*GuildRankings, error) {
return c.GetAllTimeGuildRankingsWithContext(context.Background(), guildID, offset)
}
// GetAllTimeGuildRankingsWithContext gets a guild's all time rankings using the specified context.
func (c *Client) GetAllTimeGuildRankingsWithContext(ctx context.Context, guildID string,
offset uint64) (*GuildRankings, error) {
rankings, err := c.rc.getAllTimeGuildRankings(ctx, guildID, offset)
if err != nil {
return nil, xerrors.Errorf("failed to get all time guild rankings: %w", err)
}
return rankings, err
}
// GetCurrentMonthGuildRankings wraps around GetCurrentMonthGuildRankingsWithContext using a background context.
func (c *Client) GetCurrentMonthGuildRankings(guildID string, offset uint64) (*GuildRankings, error) {
return c.GetCurrentMonthGuildRankingsWithContext(context.Background(), guildID, offset)
}
// GetCurrentMonthGuildRankingsWithContext gets a guild's current month rankings using the specified context.
func (c *Client) GetCurrentMonthGuildRankingsWithContext(ctx context.Context, guildID string,
offset uint64) (*GuildRankings, error) {
rankings, err := c.rc.getCurrentMonthGuildRankings(ctx, guildID, offset)
if err != nil {
return nil, xerrors.Errorf("failed to get current month guild rankings: %w", err)
}
return rankings, err
}
// GetCurrentWeekGuildRankings wraps around GetCurrentWeekGuildRankingsWithContext using a background context.
func (c *Client) GetCurrentWeekGuildRankings(guildID string, offset uint64) (*GuildRankings, error) {
return c.GetCurrentWeekGuildRankingsWithContext(context.Background(), guildID, offset)
}
// GetCurrentWeekGuildRankingsWithContext gets a guild's current week rankings using the specified context.
func (c *Client) GetCurrentWeekGuildRankingsWithContext(ctx context.Context, guildID string,
offset uint64) (*GuildRankings, error) {
rankings, err := c.rc.getCurrentWeekGuildRankings(ctx, guildID, offset)
if err != nil {
return nil, xerrors.Errorf("failed to get current week guild rankings: %w", err)
}
return rankings, err
}