-
Notifications
You must be signed in to change notification settings - Fork 0
/
User.go
57 lines (45 loc) · 857 Bytes
/
User.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
package main
import (
discord "github.com/bwmarrin/discordgo"
)
type User struct {
at_cool_down bool
message_count int32
warn_count int32
User *discord.User
}
func NewUser(user *discord.User) *User {
return &User{
false,
0,
0,
user,
}
}
func (user *User) IsAtCoolDown() bool {
return user.at_cool_down
}
func (user *User) CoolDown() {
user.at_cool_down = true
}
func (user *User) ResetCoolDown() {
user.at_cool_down = false
}
func (user *User) GetMessageCount() int32 {
return user.message_count
}
func (user *User) AddMessageCount() {
user.message_count += 1
}
func (user *User) ResetMessageCount() {
user.message_count = 0
}
func (user *User) GetWarnCount() int32 {
return user.warn_count
}
func (user *User) Warn() {
user.warn_count += 1
}
func (user *User) IsWarned() bool {
return user.warn_count > 0
}