read

package
v2.0.0-...-9d96e6b Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: ISC Imports: 7 Imported by: 2

Documentation

Overview

Package read implements a read state with an event handler API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	// contains filtered or unexported fields
}

func NewState

func NewState(state *state.State, r handlerrepo.AddHandler) *State

func (*State) FindLast

func (r *State) FindLast(channelID discord.ChannelID) *gateway.ReadState

func (*State) MarkRead

func (r *State) MarkRead(chID discord.ChannelID, msgID discord.MessageID)

func (*State) MarkUnread

func (r *State) MarkUnread(chID discord.ChannelID, msgID discord.MessageID, mentions int)

func (*State) OnUpdate

func (r *State) OnUpdate(fn func(*UpdateEvent)) (rm func())

OnUpdate adds a read update callback into the list. This function is thread-safe. It is synchronous by default.

type UpdateEvent

type UpdateEvent struct {
	gateway.ReadState
	Unread bool
}

Jump to

Keyboard shortcuts

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