bot

package
v0.0.0-...-f2b64ca Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetURLAndMentionFromMessage

func GetURLAndMentionFromMessage(m *telebot.Message) (url string, mention string)

GetURLAndMentionFromMessage get URL and mention from message

Types

type Bot

type Bot interface {

	// Start is used to start the bot
	Start()

	// Stop stops the bot
	Stop()

	// Bot return the original telebot.Bot object
	Bot() *telebot.Bot
}

Bot is the control interface provided to portier main instance

func NewBot

func NewBot(c *Config, app Portier) (Bot, error)

NewBot create a bot according to config

type Config

type Config struct {
	Token string
	MemDB *buntdb.DB
}

Config is a config bot used

type Portier

type Portier interface {
	Poller() feed.Poller
	Logger() log.Logger
	DB() *gorm.DB
}

Portier interface is used to communicate to main instance

Jump to

Keyboard shortcuts

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