utils

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const RplTopic = "332"

RplTopic is the numeric TOPIC reply command (RFC 1459 section 6.2)

Variables

This section is empty.

Functions

func StoreTopic

func StoreTopic(irc *hbot.Bot, m *hbot.Message, db *sql.DB, c *bot.Configuration) bool

StoreTopic stores the topic of a channel when it changes.

Types

type Topic

type Topic struct {
	Channel string
	// contains filtered or unexported fields
}

Topic structure

func NewTopic

func NewTopic(db *sql.DB, channel string) *Topic

NewTopic returns a new topic.

func (*Topic) Clean

func (t *Topic) Clean() error

Clean removes the topic from the database

func (*Topic) Get

func (t *Topic) Get() (string, error)

Get returns the topic, fetching it from the database. It also returns any error found while fetching the data.

func (*Topic) Save

func (t *Topic) Save(topic *string) error

Save persists the topic to the database.

Jump to

Keyboard shortcuts

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