utilities

package
v0.0.0-...-aa48d00 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: GPL-3.0 Imports: 11 Imported by: 3

Documentation

Overview

Package command contains all the commands

Package config holds everything related to configuration

Index

Constants

View Source
const BoltDBPath = "minolobot.db"

Variables

View Source
var (
	// BoltDB wrapper
	BoltDB *bolt.DB
)
View Source
var (
	ToStringTransformer transform.Transformer
)

Functions

func AnyInSliceIntoString

func AnyInSliceIntoString(a string, list []string) (string, bool)

AnyInSliceIntoString check if the string contains any string from the slice

func Delete

func Delete(bucketName string, key string) error

Delete removes a record from Bolt

func DeleteRedundantSpaces

func DeleteRedundantSpaces(a string) string

DeleteRedundantSpaces if the string contain more than a space, it replace it by 1 space

func IsChatAdminUser

func IsChatAdminUser(bot *tgbotapi.BotAPI, m tgbotapi.Message) bool

Check if the user that send the message is admin

func Update

func Update(bucketName string, key string, dataStruct interface{}) error

Update makes a modification to Bolt

func View

func View(bucketName string, key string, dataStruct interface{}) error

View retrieves a record in Bolt

func ViewAll

func ViewAll(bucketName string, dataStruct []interface{}) error

ViewAll retrieves all records in Bolt

Types

This section is empty.

Jump to

Keyboard shortcuts

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