Documentation ¶
Index ¶
- Constants
- func PuzzleSort(a, b PuzzleSortFields) int
- func RoundSort(a, b RoundSortFields) int
- type AblyKind
- type AblyMessage
- type Client
- func (c *Client) CheckDiscordPuzzle(ctx context.Context, puzzle state.Puzzle)
- func (c *Client) CheckDiscordRound(ctx context.Context, round state.Round)
- func (c *Client) CreateDiscordCategory(ctx context.Context, round state.Round) (string, error)
- func (c *Client) CreateDiscordChannel(ctx context.Context, puzzle state.RawPuzzle, round state.Round) (string, error)
- func (c *Client) CreateDriveFolder(ctx context.Context, round state.Round) (string, error)
- func (c *Client) CreateSpreadsheet(ctx context.Context, puzzle state.RawPuzzle) (string, error)
- func (c *Client) NotifyNewPuzzle(puzzle state.Puzzle) error
- func (c *Client) NotifyPuzzleWorking(puzzle state.Puzzle) error
- func (c *Client) NotifySolveInHangingOut(puzzle state.Puzzle) error
- func (c *Client) NotifySolveInPuzzleChannel(puzzle state.Puzzle) error
- func (c *Client) RestorePlaceholderEvent() error
- func (c *Client) RestoreSolvedCategories() error
- func (c *Client) SortDiscordCategories(ctx context.Context, round RoundSortFields) (int, error)
- func (c *Client) SortDiscordChannels(ctx context.Context, puzzle PuzzleSortFields) (int, error)
- func (c *Client) SyncVoiceRooms(ctx context.Context) error
- func (c *Client) TriggerDiscoveryEnabled(ctx context.Context) error
- func (c *Client) TriggerPuzzle(ctx context.Context, change state.PuzzleChange) error
- func (c *Client) TriggerRound(ctx context.Context, change state.RoundChange) error
- func (c *Client) UpdateDiscordCategory(ctx context.Context, fields DiscordCategoryFields) error
- func (c *Client) UpdateDiscordChannel(ctx context.Context, fields DiscordChannelFields) error
- func (c *Client) UpdateDiscordPin(ctx context.Context, fields DiscordPinFields) error
- func (c *Client) UpdateDriveFolder(ctx context.Context, fields DriveFolderFields) error
- func (c *Client) UpdateSpreadsheet(ctx context.Context, fields SpreadsheetFields) error
- func (c *Client) Watch(ctx context.Context)
- type DiscordCategoryFields
- type DiscordChannelFields
- type DiscordPinFields
- type DriveFolderFields
- type PuzzleSortFields
- type RoundSortFields
- type SpreadsheetFields
- type VoiceRoomFields
Constants ¶
const ( VoiceRoomEventDescription = "🤖 Event managed by Huntbot" VoiceRoomPlaceholderTitle = "🫥 Placeholder Event" )
Variables ¶
This section is empty.
Functions ¶
func PuzzleSort ¶
func PuzzleSort(a, b PuzzleSortFields) int
func RoundSort ¶
func RoundSort(a, b RoundSortFields) int
Types ¶
type AblyMessage ¶
type Client ¶
type Client struct { RestartDiscovery chan bool // contains filtered or unexported fields }
func (*Client) CheckDiscordPuzzle ¶
func (*Client) CheckDiscordRound ¶
func (*Client) CreateDiscordCategory ¶
CreateDiscordCategory creates a new Discord category and returns its ID.
func (*Client) CreateDiscordChannel ¶
func (c *Client) CreateDiscordChannel(ctx context.Context, puzzle state.RawPuzzle, round state.Round) (string, error)
CreateDiscordChannel creates a new Discord channel and returns its ID.
func (*Client) CreateDriveFolder ¶
CreateDriveFolder creates a new Google Drive folder and returns its ID.
func (*Client) CreateSpreadsheet ¶
CreateSpreadsheet creates a new Google Sheets spreadsheet and returns its ID.
func (*Client) NotifyNewPuzzle ¶
NotifyNewPuzzle sends the "New puzzle!" message to #more-eyes.
func (*Client) NotifyPuzzleWorking ¶
NotifyPuzzleWorking sends the "Work started on puzzle" message to #more-eyes.
func (*Client) NotifySolveInHangingOut ¶
NotifySolveInHangingOut sends the same message as above to #hanging-out. Unlike all of the other methods in this file, it does *not* require a puzzle channel to exist.
func (*Client) NotifySolveInPuzzleChannel ¶
NotifySolveInPuzzleChannel sends the "Puzzle solved!" (or "...backsolved!", etc.) message to the puzzle channel.
func (*Client) RestorePlaceholderEvent ¶
func (*Client) RestoreSolvedCategories ¶
func (*Client) SortDiscordCategories ¶
func (*Client) SortDiscordChannels ¶
func (*Client) SyncVoiceRooms ¶
SyncVoiceRooms synchronizes all Discord scheduled events, creating and deleting events so that Discord matches the database state.
func (*Client) TriggerDiscoveryEnabled ¶
func (*Client) TriggerPuzzle ¶
func (*Client) TriggerRound ¶
func (*Client) UpdateDiscordCategory ¶
func (c *Client) UpdateDiscordCategory(ctx context.Context, fields DiscordCategoryFields) error
UpdateDiscordCategory configures the name of the round category.
func (*Client) UpdateDiscordChannel ¶
func (c *Client) UpdateDiscordChannel(ctx context.Context, fields DiscordChannelFields) error
UpdateDiscordChannel configures the name and category of the puzzle channel. Categories are either in a round-specific category (if unsolved) or one of a few "Solved" categories (for solved puzzles), and the channel name is prefixed with a check mark when the puzzle is solved.
func (*Client) UpdateDiscordPin ¶
func (c *Client) UpdateDiscordPin(ctx context.Context, fields DiscordPinFields) error
UpdateDiscordPin creates or updates the pinned message at the top of the puzzle channel. This message contains information about the puzzle status as well as links to the puzzle and the spreadsheet.
func (*Client) UpdateDriveFolder ¶
func (c *Client) UpdateDriveFolder(ctx context.Context, fields DriveFolderFields) error
UpdateDriveFolder sets the Google Drive folder name.
func (*Client) UpdateSpreadsheet ¶
func (c *Client) UpdateSpreadsheet(ctx context.Context, fields SpreadsheetFields) error
UpdateSpreadsheet sets the spreadsheet's title and parent folder. The title is the name of the puzzle, plus a check mark if the puzzle has been solved. The folder is based on the round.
type DiscordCategoryFields ¶
type DiscordCategoryFields struct { RoundName string RoundCategory string RoundSortFields }
func NewDiscordCategoryFields ¶
func NewDiscordCategoryFields(round state.Round) DiscordCategoryFields
type DiscordChannelFields ¶
type DiscordChannelFields struct { PuzzleName string PuzzleChannel string RoundName string RoundCategory string IsSolved bool PuzzleSortFields }
func NewDiscordChannelFields ¶
func NewDiscordChannelFields(puzzle state.Puzzle) DiscordChannelFields
type DiscordPinFields ¶
type DiscordPinFields struct { RoundName string RoundEmoji string RoundHue int64 PuzzleName string Status status.Status Note string Location string PuzzleURL string SpreadsheetID string DiscordChannel string VoiceRoom string }
func NewDiscordPinFields ¶
func NewDiscordPinFields(puzzle state.Puzzle) DiscordPinFields
type DriveFolderFields ¶
func NewDriveFolderFields ¶
func NewDriveFolderFields(round state.Round) DriveFolderFields
type PuzzleSortFields ¶
type PuzzleSortFields struct { ID int64 DiscordChannel string IsSolved bool Name string Meta bool RoundSortFields }
func NewPuzzleSortFields ¶
func NewPuzzleSortFields(puzzle state.RawPuzzle, round state.Round) PuzzleSortFields
type RoundSortFields ¶
func NewRoundSortFields ¶
func NewRoundSortFields(round state.Round) RoundSortFields
type SpreadsheetFields ¶
type SpreadsheetFields struct { PuzzleName string SpreadsheetID string RoundDriveFolder string IsSolved bool }
func NewSpreadsheetFields ¶
func NewSpreadsheetFields(puzzle state.Puzzle) SpreadsheetFields
type VoiceRoomFields ¶
func NewVoiceRoomFields ¶
func NewVoiceRoomFields(puzzle state.Puzzle) VoiceRoomFields