read

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: ISC Imports: 9 Imported by: 1

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) 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) ReadState

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

ReadState gets the read state for a channel.

func (*State) SelfID

func (r *State) SelfID() discord.UserID

type UpdateEvent

type UpdateEvent struct {
	gateway.ReadState
	GuildID discord.GuildID
	Unread  bool
}

func (UpdateEvent) EventType

func (ev UpdateEvent) EventType() ws.EventType

func (UpdateEvent) Op

func (ev UpdateEvent) Op() ws.OpCode

Jump to

Keyboard shortcuts

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