telebot

package
v0.0.0-...-8e3a394 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bd

func Bd() string

Bd -- birthday handler

func CreateNewUser

func CreateNewUser(userid string, db *badger.DB, m *tele.Message)

CreateNewUser -> add user with key userid to badgerdB

func LocationHandler

func LocationHandler(db *badger.DB, m *tele.Message) string

LocationHandler handle incoming location

func LocationInfo

func LocationInfo(db *badger.DB, p Point) string

LocationInfo info about city you are currently in

func Start

func Start(db *badger.DB, m *tele.Message) string

Start initialize user(put user data to BadgerDB)

func UpdateLocationDB

func UpdateLocationDB(db *badger.DB, m *tele.Message, userid string, p Point) string

UpdateLocationDB change coordinates

func UpdateUser

func UpdateUser(userid string, userset UserSettings, db *badger.DB, m *tele.Message)

UpdateUser settings into badgerDB

func UserExists

func UserExists(db *badger.DB, userid string) bool

UserExists check if user exists in badgerDB

func Wc

func Wc(text string, prod bool) string

Wc get number of words

func Weather

func Weather() string

Weather -> show weather in form of text(html/md)

func WeatherGui

func WeatherGui() bool

WeatherGui generate and send path to image

func YtDownload

func YtDownload(command string) (string, error)

YtDownload handle video string and send path from saved file

Types

type Date

type Date struct {
	Countable bool
	Name      string
	Day       int
	Month     int
	Year      int
	FromToday int
	YearDiff  int
}

Date --

type Pair

type Pair struct {
	Key   string
	Value int
}

Pair -- Key & Value pair

type PairList

type PairList []Pair

PairList - list of pairs

func (PairList) Len

func (p PairList) Len() int

func (PairList) Less

func (p PairList) Less(i, j int) bool

func (PairList) Swap

func (p PairList) Swap(i, j int)

type Point

type Point struct {
	Lat float32
	Lon float32
}

Point - Gps point(Latitude, Longtitude)

type UserSettings

type UserSettings struct {
	Username           string
	LastLocation       Point
	LastWeatherRequest int32
}

UserSettings structure which will be saved as json to db

func GetUserSettings

func GetUserSettings(db *badger.DB, userid string) UserSettings

GetUserSettings TODO

Jump to

Keyboard shortcuts

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