extensions

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Extensions for papaBot.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterBuiltinExtensions

func RegisterBuiltinExtensions(bot *papaBot.Bot)

RegisterBuiltinExtensions will do exactly what you think it will do.

Types

type ExtensionAqicn

type ExtensionAqicn struct {
	// contains filtered or unexported fields
}

ExtensionAqicn - query Aqicn.org for air quality data.

Used custom variables: - AqicnToken- Your Aqicn token.

func (*ExtensionAqicn) Init

func (ext *ExtensionAqicn) Init(bot *papaBot.Bot) error

Init inits the extension.

func (*ExtensionAqicn) TickListener

func (ext *ExtensionAqicn) TickListener(message events.EventMessage)

TickListener will clear announce cache.

type ExtensionBtc

type ExtensionBtc struct {
	HourlyData map[string]interface{}

	LastAsk map[string]time.Time
	Warned  map[string]bool

	Texts *extensionBtcTexts
	// contains filtered or unexported fields
}

ExtensionBtc - extension for getting BTC price from BitStamp.com.

func (*ExtensionBtc) DailyTickListener

func (ext *ExtensionBtc) DailyTickListener(message events.EventMessage)

DailyTickListener announce the price.

func (*ExtensionBtc) Init

func (ext *ExtensionBtc) Init(bot *papaBot.Bot) error

func (*ExtensionBtc) TickListener

func (ext *ExtensionBtc) TickListener(message events.EventMessage)

TickListener will monitor BTC price and warn if anything serious happens.

type ExtensionCounters

type ExtensionCounters struct {
	// contains filtered or unexported fields
}

ExtensionCounters - enables the creation of custom counters.

func (*ExtensionCounters) Init

func (ext *ExtensionCounters) Init(bot *papaBot.Bot) error

Init initializes the extension.

func (*ExtensionCounters) TickListener

func (ext *ExtensionCounters) TickListener(message events.EventMessage)

TickListener will announce all the counters if needed.

type ExtensionDuplicates

type ExtensionDuplicates struct {
	Texts *extensionDuplicatesTexts
	// contains filtered or unexported fields
}

ExtensionDuplicates checks for duplicate URLs posted.

func (*ExtensionDuplicates) Init

func (ext *ExtensionDuplicates) Init(bot *papaBot.Bot) error

Init inits the extension.

func (*ExtensionDuplicates) ProcessURLListener

func (ext *ExtensionDuplicates) ProcessURLListener(message events.EventMessage)

checkForDuplicates checks for duplicates of the url in the database.

func (*ExtensionDuplicates) Tick

func (ext *ExtensionDuplicates) Tick(bot *papaBot.Bot, daily bool)

Tick will clean announces table once per day.

type ExtensionGitHub

type ExtensionGitHub struct {
	// contains filtered or unexported fields
}

ExtensionGitHub - extension for getting basic repository information.

func (*ExtensionGitHub) Init

func (ext *ExtensionGitHub) Init(bot *papaBot.Bot) error

Init inits the extension.

func (*ExtensionGitHub) UrlListener

func (ext *ExtensionGitHub) UrlListener(message events.EventMessage)

UrlListener will try to get more info on GitHub links.

type ExtensionLastSpoken

type ExtensionLastSpoken struct {
	LastAsk    map[string]map[string]time.Time
	LastSpoken map[string]map[string]time.Time

	Texts *ExtensionLastSpokenTexts
	// contains filtered or unexported fields
}

ExtensionLastSpoken tracks when a person has last spoken.

func (*ExtensionLastSpoken) ChatListener

func (ext *ExtensionLastSpoken) ChatListener(message events.EventMessage)

ChatListener listens to chat messages and records who has spoken.

func (*ExtensionLastSpoken) Init

func (ext *ExtensionLastSpoken) Init(bot *papaBot.Bot) error

Init inits the extension.

type ExtensionLastSpokenTexts

type ExtensionLastSpokenTexts struct {
	NeverSpoken    string
	TempLastSpoken *template.Template
}

type ExtensionMovies

type ExtensionMovies struct {
	// contains filtered or unexported fields
}

func (*ExtensionMovies) Init

func (ext *ExtensionMovies) Init(bot *papaBot.Bot) error

Init inits the extension.

type ExtensionReddit

type ExtensionReddit struct {
	Texts *extensionRedditTexts
	// contains filtered or unexported fields
}

ExtensionReddit - extension for getting link information from reddit.com.

This extension will automatically try to fetch Reddit information for each URL posted. It will also post a random link from one of the hot reddits once per day.

Used custom variables: - interestingReddits - space separated list of subreddits to use for hot links. - redditDaily - if set, show daily interesting link.

func (*ExtensionReddit) DailyTickListener

func (ext *ExtensionReddit) DailyTickListener(message events.EventMessage)

DailyTickListener will clear the announces table and give post of the day.

func (*ExtensionReddit) Init

func (ext *ExtensionReddit) Init(bot *papaBot.Bot) error

Init inits the extension.

func (*ExtensionReddit) ProcessURLListener

func (ext *ExtensionReddit) ProcessURLListener(message events.EventMessage)

ProcessURLListener will try to check if link was ever on reddit.

func (*ExtensionReddit) TickListener

func (ext *ExtensionReddit) TickListener(message events.EventMessage)

TickListener will check for reddit live pinned topics.

type ExtensionReminders

type ExtensionReminders struct {
	// contains filtered or unexported fields
}

ExtensionReminders - enables the creation of custom reminders.

func (*ExtensionReminders) Init

func (ext *ExtensionReminders) Init(bot *papaBot.Bot) error

Init initializes the extension.

func (*ExtensionReminders) TickListener

func (ext *ExtensionReminders) TickListener(message events.EventMessage)

TickListener will trigger the reminder if needed.

type ExtensionTalk

type ExtensionTalk struct {
	Texts *extensionTalkTexts
	// contains filtered or unexported fields
}

ExtensionTalk makes the bot a bit more talkative.

func (*ExtensionTalk) Init

func (ext *ExtensionTalk) Init(bot *papaBot.Bot) error

Init inits the extension.

func (*ExtensionTalk) JoinedListener

func (ext *ExtensionTalk) JoinedListener(message events.EventMessage)

JoinedListener says something when bot joins a channel.

func (*ExtensionTalk) ReJoinedListener

func (ext *ExtensionTalk) ReJoinedListener(message events.EventMessage)

ReJoinedListener says something when bot joins a channel.

type ExtensionTwitterThread

type ExtensionTwitterThread struct {
	// contains filtered or unexported fields
}

ExtensionTwitterThread - extension for getting thread links from tweets.

func (*ExtensionTwitterThread) Init

func (ext *ExtensionTwitterThread) Init(bot *papaBot.Bot) error

Init inits the extension.

func (*ExtensionTwitterThread) UrlListener

func (ext *ExtensionTwitterThread) UrlListener(message events.EventMessage)

UrlListener will check for Twitter links and store them.

type ExtensionWiki

type ExtensionWiki struct {
	Texts *extensionWikiTexts
	// contains filtered or unexported fields
}

ExtensionWiki - finds Wikipedia articles.

func (*ExtensionWiki) Init

func (ext *ExtensionWiki) Init(bot *papaBot.Bot) error

Init inits the extension.

type ExtensionWolfram

type ExtensionWolfram struct {
	Texts *extensionWolframTexts
	// contains filtered or unexported fields
}

ExtensionWolfram - query Wolfram Alpha.

Used custom variables: - WolframKey - Your Wolfram Alpha AppID key.

func (*ExtensionWolfram) Init

func (ext *ExtensionWolfram) Init(bot *papaBot.Bot) error

Init inits the extension.

type ExtensionYoutube

type ExtensionYoutube struct {
	Texts *ExtensionYoutubeTexts
	// contains filtered or unexported fields
}

ExtensionYoutube - extension for getting basic video information.

func (*ExtensionYoutube) Init

func (ext *ExtensionYoutube) Init(bot *papaBot.Bot) error

Init inits the extension.

func (*ExtensionYoutube) UrlListener

func (ext *ExtensionYoutube) UrlListener(message events.EventMessage)

UrlListener will try to get more info on GitHub links.

type ExtensionYoutubeTexts

type ExtensionYoutubeTexts struct {
	TempNotice *template.Template
}

type WikiPage

type WikiPage struct {
	Batchcomplete bool `json:"batchcomplete"`
	Query         struct {
		Normalized []struct {
			Fromencoded bool   `json:"fromencoded"`
			From        string `json:"from"`
			To          string `json:"to"`
		} `json:"normalized"`
		Pages []struct {
			Pageid  int    `json:"pageid"`
			Ns      int    `json:"ns"`
			Title   string `json:"title"`
			Extract string `json:"extract"`
			Missing bool   `json:"missing"`
		} `json:"pages"`
	} `json:"query"`
}

type WikiSearchResult

type WikiSearchResult struct {
	Batchcomplete string `json:"batchcomplete"`
	Query         struct {
		Search []struct {
			Ns     int    `json:"ns"`
			Title  string `json:"title"`
			Pageid int    `json:"pageid"`
		} `json:"search"`
	} `json:"query"`
}

Jump to

Keyboard shortcuts

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