bot

package
v0.0.0-...-0077de9 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GetTodaysQouteInlineKeyboardBtn = motivationInlineKeyboard.Data("Todays Quote", "seeQuote", "seeQuote")
	RandomQuotesInlineKeyboardBtn   = motivationInlineKeyboard.Data("Any quote", "anyQuote", "anyQuote")
	ImageQoutesOnInlineKeyboardBtn  = motivationInlineKeyboard.Data("Motivational Image", "QuoteOn", "image")
)
View Source
var (
	MotivationKeyboardBtn = startKeyboard.Text("Motivations \n 🧘‍♀️ 🧘‍♂️")
	ReligionKeyboardBtn   = startKeyboard.Text("Abba Father \n ✝️️ 🛐")
	TherapyKeyboardBtn    = startKeyboard.Text("Meet the Therapist \n 💆🏾‍♀️ 💗")
	RemindernKeyboardBtn  = startKeyboard.Text("Reminder \n 🕰")
	GameKeyboardBtn       = startKeyboard.Text("Games \n 🎮 🧩")
)
View Source
var (
	BibleTextReligionMessageKeyboardBtn    = religionMessagesKeyboard.Text("Today's Bible reading 🎚️")
	AudioReligionMessageKeyboardBtn        = religionMessagesKeyboard.Text("Today's Audio message 🎵")
	AudioAndTextReligionMessageKeyboardBtn = religionMessagesKeyboard.Text("Bible reading 🎚️ and Audio message🎵")
	BackToStartKeyboardBtn                 = religionMessagesKeyboard.Text("⬅⬅ Back to Start")
)
View Source
var FailedRequest string = fmt.Sprintf("<b>%v</b>\n\n<i>%v</i>", "unable to fetch request", "please do try again")

Functions

func MotivationInlineKeyboard

func MotivationInlineKeyboard() *tele.ReplyMarkup

func ReligionMessageKeyboard

func ReligionMessageKeyboard() *tele.ReplyMarkup

func ResolveAudioMessge

func ResolveAudioMessge() (*tele.Audio, error)

func ResolveImageMessage

func ResolveImageMessage() (*tele.Photo, error)

func StartKeyboard

func StartKeyboard() *tele.ReplyMarkup

func TextResponse

func TextResponse(v []string, err error) (string, error)

Types

type Application

type Application struct {
	// Bot holds the Bot instance
	Bot *tele.Bot
	// Storage holds the database instance
	Storage Database
	//Logger holds the logger instance
	Logger Logger
}

Application is the monolothic struct for the application

func (Application) BackToStartHanlerFunc

func (a Application) BackToStartHanlerFunc(c tele.Context) error

func (Application) CheckMemberShip

func (a Application) CheckMemberShip(next tele.HandlerFunc) tele.HandlerFunc

func (Application) GameKeyboardHandleFunc

func (a Application) GameKeyboardHandleFunc(c tele.Context) error

func (Application) GetAudioMessageHandlerFunc

func (a Application) GetAudioMessageHandlerFunc(c tele.Context) error

func (Application) GetBibleTextHandlerFunc

func (a Application) GetBibleTextHandlerFunc(c tele.Context) error

func (Application) GetBothAudioAndTextReligionMessageHandlerFunc

func (a Application) GetBothAudioAndTextReligionMessageHandlerFunc(c tele.Context) error

func (Application) GetRandomQuoteFunc

func (a Application) GetRandomQuoteFunc(c tele.Context) error

func (Application) GetRandomQuoteImageFunc

func (a Application) GetRandomQuoteImageFunc(c tele.Context) error

func (Application) GetTodaysQuoteFunc

func (a Application) GetTodaysQuoteFunc(c tele.Context) error

func (Application) MotivationKeyboardHandlerFunc

func (a Application) MotivationKeyboardHandlerFunc(c tele.Context) error

func (Application) ReligionKeyboardHandlerFunc

func (a Application) ReligionKeyboardHandlerFunc(c tele.Context) error

func (Application) RemainderyKeyboardHandleFunc

func (a Application) RemainderyKeyboardHandleFunc(c tele.Context) error

func (Application) ScheduledTaskMedia

func (a Application) ScheduledTaskMedia(bot *tele.Bot, media ...interface{})

func (Application) ScheduledTaskText

func (a Application) ScheduledTaskText(bot *tele.Bot, task func() ([]string, error))

func (Application) StartHandlerFunc

func (a Application) StartHandlerFunc(c tele.Context) error

func (Application) TherapyKeyboardHandleFunc

func (a Application) TherapyKeyboardHandleFunc(c tele.Context) error

type Database

type Database interface {
	// IsUser returns true if user is found in the db and false otherwise.
	IsUser(int64) bool
	Delete(int64) error
	Insert(int64, string) error
	//AllIDs returns a slice of all user id and an error
	AllIDs() ([]int64, error)
}

type Logger

type Logger interface {
	LogInfo(string, string)
	LogError(error, string)
	LogFatal(error, string)
	WriteToStandarOutput(string)
}

Jump to

Keyboard shortcuts

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