readstate

package
v0.0.0-...-52a80d5 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearReadStateFor

func ClearReadStateFor(channelID string)

ClearReadStateFor clears all entries for the given Channel.

func HasBeenMentioned

func HasBeenMentioned(channelID string) bool

HasBeenMentioned checks whether the currently logged in user has been mentioned in this channel.

func HasBeenRead

func HasBeenRead(channel *discordgo.Channel, lastMessageID string) bool

HasBeenRead checks whether the passed channel has an unread Message or not.

func HasGuildBeenMentioned

func HasGuildBeenMentioned(guildID string) bool

HasGuildBeenMentioned checks whether any channel in the guild mentioned the currently logged in user.

func HasGuildBeenRead

func HasGuildBeenRead(guildID string) bool

HasGuildBeenRead returns true if the guild has no unread messages or is muted.

func IsGuildChannelMuted

func IsGuildChannelMuted(channel *discordgo.Channel) bool

IsGuildChannelMuted checks whether a guild channel has been set to silent.

func IsGuildMuted

func IsGuildMuted(guildID string) bool

IsGuildMuted returns whether the user muted the given guild.

func IsPrivateChannelMuted

func IsPrivateChannelMuted(channel *discordgo.Channel) bool

IsPrivateChannelMuted checks whether a private channel has been set to silent.

func Load

func Load(sessionState *discordgo.State)

Load loads the locally saved readmarkers returning an error if this failed.

func MarkAsMentioned

func MarkAsMentioned(channelID string)

MarkAsMentioned sets the given channel ID to mentioned.

func UpdateRead

func UpdateRead(session *discordgo.Session, channel *discordgo.Channel, lastMessageID string) error

UpdateRead tells the discord server that a channel has been read. If the channel has already been read and this method was called needlessly, then this will be a No-OP.

func UpdateReadBuffered

func UpdateReadBuffered(session *discordgo.Session, channel *discordgo.Channel, lastMessageID string)

UpdateReadBuffered triggers an acknowledgement after a certain amount of seconds. If this message is called again during that time, the timer will be reset. This avoid unnecessarily many calls to the Discord servers.

func UpdateReadLocal

func UpdateReadLocal(channelID string, lastMessageID string) bool

UpdateReadLocal can be used to locally update the data without sending anything to the Discord API. The update will only be applied if the new message ID is greater than the old one.

Types

This section is empty.

Jump to

Keyboard shortcuts

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