read

package
Version: v2.0.0-...-cab2337 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: ISC Imports: 7 Imported by: 0

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
}

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL