pins

package
v0.0.0-...-367965b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment = discord.Attachment

Attachment is a file attachment.

type Author

type Author struct {
	// Name is the name of the user.
	Name string `json:"name"`
	// ID is the unique identifier of the user.
	ID discord.UserID `json:"id"`
	// Avatar is the URL of the user's avatar.
	Avatar string `json:"avatar"`
}

Author is a user struct.

type Channel

type Channel struct {
	// ID is the unique identifier of the channel.
	ID discord.ChannelID `json:"id"`
	// Name is the name of the channel.
	Name string `json:"name"`
	// ParentID is the ID of the parent channel or category.
	ParentID discord.ChannelID `json:"parent_id"`
}

Channel is a channel struct.

type ChatProvider

type ChatProvider interface {
	// Pins reads the pins of a guild by guild ID.
	Pins(PinsOptions) (*Pins, error)
	// Channels gets all the channels from a guild including threads.
	Channels(guildID discord.GuildID) ([]Channel, error)
}

ChatProvider provides a channel by ID from any service.

type FilterExpr

type FilterExpr string

FilterExpr is a CEL expression for filtering.

type Pin

type Pin struct {
	// ChannelID is the channel the message was sent in.
	ChannelID discord.ChannelID `json:"channel_id"`
	// Timestamp is the time the message was sent.
	Timestamp time.Time `json:"timestamp"`
	// AuthorID is the user who sent the message.
	AuthorID discord.UserID `json:"author_id"`
	// Text is the content of the message.
	Text string `json:"text"`
	// Attachments is a list of attachments.
	Attachments []Attachment `json:"attachments"`
}

Pin is a pinned message struct.

type Pins

type Pins struct {
	// GuildID is the ID of the guild the pins are from.
	GuildID discord.GuildID `json:"guild_id"`
	// GuildName is the name of the guild the pins are from.
	GuildName string `json:"guild_name"`
	// ChannelNames is a map of channel IDs to names.
	ChannelNames map[discord.ChannelID]string `json:"channel_names"`
	// Authors is a map of user IDs to names.
	Authors map[discord.UserID]Author `json:"authors"`
	// Pins is a list of pins.
	Pins []Pin `json:"pins"`
}

type PinsOptions

type PinsOptions struct {
	// GuildID is the ID of the guild to get the pins from.
	GuildID discord.GuildID
	// CEL expression to filter pins.
	Expr FilterExpr
}

PinsOptions are the options for getting pins.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL