Documentation
¶
Index ¶
Constants ¶
const PackVersion int = 3
PackVersion is the version of the archive format, would be more accurately referred to as formatVersion but darchive v3 is already frozen
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArchiveData ¶
type ArchiveData struct {
PackVersion Version `json:"packVersion"` // note that via the data type this will always be marshaled to 4
Date time.Time `json:"timestamp"`
Messages []*Message `json:"messages,omitempty"`
Channel *Channel `json:"channel"`
}
ArchiveData contains the channel archive information
type ArchiveDataEncoding ¶
type ArchiveDataEncoding struct {
PackVersion Version `json:"packVersion"`
Date time.Time `json:"timestamp"`
Messages json.RawMessage `json:"messages,omitempty"`
Channel *Channel `json:"channel"`
}
ArchiveDataEncoding is an alternate version of ArchiveData that replaces the Messages field with a json.RawMessage for manual constructing of the messages json, used in the mojitree archiver to be able to build the messages field in chunks instead of all at once
type Channel ¶
type Channel struct {
ID string `json:"id"`
GuildID string `json:"guild_id,omitempty"`
Name string `json:"name"`
Topic string `json:"topic"`
Type discordgo.ChannelType `json:"type"`
NSFW bool `json:"nsfw"`
ParentID string `json:"parent_id"`
RateLimitPerUser int `json:"rate_limit_per_user"`
}
Channel is the channel data saved by darchive v3
func DgoToDcChannel ¶
DgoToDcChannel converts a discordgo channel struct to a darchive one
func DgoToDcChannels ¶
DgoToDcChannels converts a slice of discordgo channels to a slice of darchive ones
type Message ¶
type Message struct {
ID string `json:"id,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
GuildID string `json:"guild_id,omitempty"`
Content string `json:"content,omitempty"`
Timestamp time.Time `json:"timestamp,omitempty"`
EditedTimestamp *time.Time `json:"edited_timestamp,omitempty"`
TTS bool `json:"tts"`
Pinned bool `json:"pinned"`
MentionRoles []string `json:"mention_roles,omitempty"`
MentionEveryone bool `json:"mention_everyone"`
MentionUsers []*User `json:"mention_users,omitempty"`
MentionChannels []*Channel `json:"mention_channels,omitempty"`
Author *User `json:"author,omitempty"`
Attachments []*discordgo.MessageAttachment `json:"attachments,omitempty"`
Embeds []*discordgo.MessageEmbed `json:"embeds,omitempty"`
Reactions []*discordgo.MessageReactions `json:"reactions,omitempty"`
Type discordgo.MessageType `json:"type"`
WebhookID string `json:"webhook_id,omitempty"`
Activity *discordgo.MessageActivity `json:"activity,omitempty"`
Application *discordgo.MessageApplication `json:"application,omitempty"`
MessageReference *discordgo.MessageReference `json:"message_reference,omitempty"`
Flags discordgo.MessageFlags `json:"flags"`
}
Message is the message information saved and encoded by darchive v3
func DgoToDcMessage ¶
DgoToDcMessage converts a Discordgo message struct to the message struct used by the archiver
func DgoToDcMessages ¶
DgoToDcMessages converts a list of Discordgo message structs to the message struct used by the archiver
type User ¶
type User struct {
ID string `json:"id"`
Username string `json:"username"`
Avatar string `json:"avatar"`
Discriminator string `json:"discriminator"`
Bot bool `json:"bot"`
}
User is the user data saved by darchive v3
func DgoToDcUser ¶
DgoToDcUser converts a Discordgo user struct to the darchive user struct
func DgoToDcUsers ¶
DgoToDcUsers is like DgoToDcUser except plural, it takes a list of users