-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchannel.go
80 lines (71 loc) · 3.28 KB
/
channel.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
package httpcord
type ChannelType uint
const (
GuildTextChannelType ChannelType = iota
DMChannelType
GuildVoiceChannelType
GroupDMChannelType
GuildCategoryChannelType
GuildNewsChannelType
GuildStoreChannelType
)
type PermissionOverwrite struct {
ID Snowflake `json:"id"`
Type uint `json:"type"`
Allow string `json:"allow"`
Deny string `json:"deny"`
}
type AllowedMentions struct {
Parse []string `json:"parse"`
Roles []Snowflake `json:"roles,omitempty"`
Users []Snowflake `json:"users,omitempty"`
RepliedUser bool `json:"replied_user,omitempty"`
}
type FollowedChannel struct {
ChannelID Snowflake `json:"channel_id"`
WebhookID Snowflake `json:"webhook_id"`
}
type ThreadMember struct {
ID Snowflake `json:"id"`
UserID Snowflake `json:"user_id"`
JoinedAt Time `json:"join_timestamp"`
Flags uint `json:"flags"`
}
type ThreadMetadata struct {
Archived bool `json:"archived"`
AutoArchiveDuration int `json:"auto_archive_duration"`
ArchivedTimestamp Time `json:"archived_timestamp"`
Locked bool `json:"locked"`
Invitable bool `json:"invitable"`
}
type Channel struct {
ID Snowflake `json:"id"`
Type ChannelType `json:"type"`
GuildID Snowflake `json:"guild_id,omitempty"`
Position int `json:"position,omitempty"`
PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites,omitempty"`
Name string `json:"name,omitempty"`
Topic string `json:"topic,omitempty"`
NSFW bool `json:"nsfw,omitempty"`
LastMessageID Snowflake `json:"last_message_id,omitempty"`
Bitrate uint `json:"bitrate,omitempty"`
UserLimit uint `json:"user_limit,omitempty"`
RateLimitPerUser uint `json:"rate_limit_per_user,omitempty"`
Recipients []*User `json:"recipient,omitempty"`
Icon string `json:"icon,omitempty"`
OwnerID Snowflake `json:"owner_id,omitempty"`
ApplicationID Snowflake `json:"application_id,omitempty"`
ParentID Snowflake `json:"parent_id,omitempty"`
LastPinTimestamp Time `json:"last_pin_timestamp,omitempty"`
RtcRegion *string `json:"rtc_region,omitempty"`
VideoQualityMode *int `json:"video_quality_mode,omitempty"`
MessageCount *int `json:"message_count,omitempty"`
MemberCount *int `json:"member_count,omitempty"`
ThreadMetadata *ThreadMetadata `json:"thread_metadata,omitempty"`
Member *ThreadMember `json:"member,omitempty"`
DefaultAutoArchiveDuration *int `json:"default_auto_archive_duration,omitempty"`
Permissions *string `json:"permissions,omitempty"`
}
func (c *Channel) Mention() string {
return "<#" + c.ID.String() + ">"
}