read

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 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 added in v0.2.0

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 added in v0.2.0

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