Documentation ¶
Index ¶
- Constants
- Variables
- func AdminSetNick(user *tgbotapi.User, nick string) error
- func FindQuoteById(recnum int, includeDeleted bool) (*quotes.Quote, error)
- func GetQuote(q string, offset int) (string, error)
- func Info(recnum int, text ...string) (*quotes.Quote, error)
- func Init()
- func InsertQuote(quote quotes.Quote) (quotes.Quote, error)
- func MarkQuoteAsDeleted(recnum int, user string) error
- func NickFromTGUser(user *tgbotapi.User) (string, error)
- func NickFromTGUserName(username string) (string, error)
- func SetNick(user *tgbotapi.User, nick string) error
- func TGUserFromNick(nick string) (string, error)
- func Top(i int) (string, error)
- func UnmarkQuoteAsDeleted(recnum int) error
- func UserNickIsAssociated(user *tgbotapi.User, nick string) error
Constants ¶
const UsersTable = "users"
Variables ¶
var ErrPandaExists = errors.New("This panda already exists")
ErrPandaExists error returned when a user or nick is not in the DB
var ErrPandaNotFound = errors.New("No such Panda")
ErrPandaNotFound error returned when a user or nick is not in the DB
Functions ¶
func AdminSetNick ¶
AdminSetNick associates the telegram user and given nick even if those are associated before
func FindQuoteById ¶
FindQuoteById Finds a quote by it's unique id recnum: quote id to find includeDeleted: true to inlcude deleted quotes in search
func InsertQuote ¶
InsertQuote adds a new quote record to the database
func MarkQuoteAsDeleted ¶
MarkQuoteAsDeleted marks a quote with identifier id as deleted
func NickFromTGUser ¶
NickFromTGUser return the nick for a given Telegram User
func NickFromTGUserName ¶
NickFromTGUserName return the nick for a given Telegram User
func TGUserFromNick ¶
TGUserFromNick return the Telegram user ID from a given nick
func UnmarkQuoteAsDeleted ¶
UnmarkQuoteAsDeleted marks a deleted quote with identifier id as undeleted
Types ¶
This section is empty.