Versions in this module Expand all Collapse all v0 v0.5.1 Nov 28, 2022 Changes in this version + const ITEM_TITLE_MAX_LENGTH + const InvoiceCallbackGenerateDalle + const InvoiceCallbackGeneric + const InvoiceCallbackGroupTicket + const InvoiceCallbackInlineReceive + const InvoiceCallbackLNURLPayReceive + const InvoiceCallbackSatdressProxy + const MAX_FILES_PER_ITEM + const MAX_ITEMS_PER_SHOP + const MAX_SHOPS + const MainMenuCommandBalance + const MainMenuCommandHelp + const MainMenuCommandInvoice + const MainMenuCommandSend + const MainMenuCommandWebApp + const SHOPS_DESCRIPTION_MAX_LENGTH + const SHOP_TITLE_MAX_LENGTH + const SendMenuCommandEnter + var BotProfilePicture []byte + var ShopsNoShopsText = "*There are no shops here yet.*" + var ShopsText = "" + var ShopsTextHelp = "⚠️ Shops are still in beta. Expect bugs." + var ShopsTextShopCount = "*Browse %d shops:*" + var ShopsTextWelcome = "*You are browsing %s shop.*" + func AssertEventType(event Event, eventType EventType) error + func DownloadProfilePicture(telegram *tb.Bot, user *tb.User) ([]byte, error) + func GetAmount(input string) (amount int64, err error) + func GetLnbitsUserWithSettings(u *tb.User, bot TipBot) (*lnbits.User, error) + func ProfilePhotosOf(bot *tb.Bot, user *tb.User) ([]tb.Photo, error) + func UserGetAnonLNURL(user *lnbits.User) (string, error) + type ChatInviteLink struct + Ok bool + Result Result + type CreateChatInviteLink struct + ChatID int64 + CreatesJoinRequest bool + ExpiryDate int + MemberLimit int + Name string + type Creator struct + Firstname string + ID int64 + IsBot bool + Username string + type Databases struct + Groups *gorm.DB + Transactions *gorm.DB + Users *gorm.DB + type EditSingleButtonParams struct + ButtonText string + Data string + Message string + URL string + type Event interface + Type func() EventType + type EventHandler struct + Function func(event Event) + Type EventType + type EventType string + const EventTypeInvoice + const EventTypeTicketInvoice + type Group struct + ID int64 + Name string + Owner *tb.User + Ticket *Ticket + Title string type InlineReceive + MessageText string + type InterceptionWrapper struct + Endpoints []interface{} + Handler intercept.Func + Interceptor *Interceptor type Interceptor + OnDefer []intercept.Func + type Invoice struct + Amount int64 + Memo string + PaymentHash string + PaymentRequest string + type InvoiceEvent struct + Callback int + CallbackData string + Chat *tb.Chat + InvoiceMessage *tb.Message + LanguageCode string + Message *tb.Message + Payer *lnbits.User + User *lnbits.User + func (invoiceEvent InvoiceEvent) Key() string + func (invoiceEvent InvoiceEvent) Type() EventType + type InvoiceEventCallback map[int]EventHandler + var InvoiceCallback InvoiceEventCallback + type InvoiceEventKey int + type LNURLInvoice struct + Comment string + CreatedAt time.Time + From string + Paid bool + PaidAt time.Time + User *lnbits.User + func (lnurlInvoice LNURLInvoice) Key() string + type LnurlAuthState struct + Comment string + From *lnbits.User + LNURLAuthParams lnurl.LNURLAuthParams + LanguageCode string + Message *tb.Message type LnurlPayState + DescriptionHash string + type Result struct + CreatesJoinRequest bool + Creator Creator + InviteLink string + IsPrimary bool + IsRevoked bool + Name string + type Shop struct + Description string + ItemIds []string + Items map[string]ShopItem + LanguageCode string + MaxItems int + Owner *lnbits.User + ShopsID string + Title string + Type string + type ShopItem struct + Description string + FileIDs []string + FileTypes []string + ID string + LanguageCode string + MaxFiles int + NSold int + Owner *lnbits.User + Price int64 + ShopID string + TbPhoto *tb.Photo + Title string + Type string + type ShopView struct + ID string + Message *tb.Message + Page int + ShopID string + ShopOwner *lnbits.User + StatusMessages []*tb.Message + type Shops struct + Description string + MaxShops int + Owner *lnbits.User + Shops []string + type StateCallbackMessage map[lnbits.UserStateKey]func(ctx intercept.Context) (intercept.Context, error) + type Ticket struct + BaseFee int64 + BaseFeeCheap int64 + Creator *lnbits.User + Cut int64 + CutCheap int64 + Memo string + Price int64 + type TicketEvent struct + Group *Group + func (ticketEvent TicketEvent) Key() string + func (ticketEvent TicketEvent) Type() EventType type TipBot + DB *Databases + ShopBunt *storage.DB + func (bot *TipBot) DescriptionHash(metadata lnurl.Metadata, payerData string) (string, error) + func (bot *TipBot) GracefulShutdown() + func (bot *TipBot) UserIsBanned(user *lnbits.User) bool type TipTooltip + ID string + type TransactionsList struct + CurrentPage int + ID string + LanguageCode string + MaxPages int + Payments lnbits.Payments + TxPerPage int + User *lnbits.User v0.4.2 Dec 6, 2021 Changes in this version + type EnterUserStateData struct + Amount int64 + AmountMax int64 + AmountMin int64 + ID string + OiringalCommand string + Type string type TipBot + func (bot TipBot) HandleLNURL(rawlnurl string) (string, lnurl.LNURLParams, error) type Transaction + Invoice lnbits.BitInvoice v0.4.1 Nov 15, 2021 Changes in this version + const MessageOrderedByReplyToFrom + const TipTooltipKeyPattern + func AutoMigration() (db *gorm.DB, txLogger *gorm.DB) + func ColumnMigrationTasks(db *gorm.DB) error + func GetLnbitsUser(u *tb.User, bot TipBot) (*lnbits.User, error) + func GetMemoFromCommand(command string, fromWord int) string + func GetUser(u *tb.User, bot TipBot) (*lnbits.User, error) + func GetUserByTelegramUsername(toUserStrWithoutAt string, bot TipBot) (*lnbits.User, error) + func GetUserStr(user *tb.User) string + func GetUserStrMd(user *tb.User) string + func LoadPublicLocalizer(ctx context.Context) *i18n2.Localizer + func LoadReplyToUser(ctx context.Context) *lnbits.User + func LoadUser(ctx context.Context) *lnbits.User + func LoadUserLocalizer(ctx context.Context) *i18n2.Localizer + func MakeProgressbar(current int, total int) string + func MakeTipjarbar(current int, total int) string + func RandStringRunes(n int) string + func ResetUserState(user *lnbits.User, bot *TipBot) + func SetUserState(user *lnbits.User, bot *TipBot, stateKey lnbits.UserStateKey, stateData string) + func TipCheckSyntax(ctx context.Context, m *tb.Message) (bool, string) + func Translate(ctx context.Context, MessgeID string) string + func TranslateUser(ctx context.Context, MessgeID string) string + func TryRecognizeQrCode(img image.Image) (*gozxing.Result, error) + func UpdateUserRecord(user *lnbits.User, bot TipBot) error + func UserGetLNURL(user *lnbits.User) (string, error) + type Cache struct + type EnterAmountStateData struct + Amount int64 + AmountMax int64 + AmountMin int64 + ID string + OiringalCommand string + Type string + type Handler struct + Endpoints []interface{} + Handler interface{} + Interceptor *Interceptor + type InlineFaucet struct + Amount int + From *lnbits.User + LanguageCode string + Memo string + Message string + NTaken int + NTotal int + PerUserAmount int + RemainingAmount int + To []*lnbits.User + UserNeedsWallet bool + type InlineReceive struct + Amount int + From *lnbits.User + From_SpecificUser bool + LanguageCode string + Memo string + Message string + To *lnbits.User + type InlineSend struct + Amount int + From *lnbits.User + LanguageCode string + Memo string + Message string + To *lnbits.User + To_SpecificUser bool + type InlineTipjar struct + Amount int + From []*lnbits.User + GivenAmount int + LanguageCode string + Memo string + Message string + NGiven int + NTotal int + PerUserAmount int + To *lnbits.User + type Interceptor struct + After []intercept.Func + Before []intercept.Func + Type InterceptorType + type InterceptorType int + const CallbackInterceptor + const MessageInterceptor + const QueryInterceptor + type LnurlPayState struct + Amount int + Comment string + From *lnbits.User + LNURLPayParams lnurl.LNURLPayParams + LNURLPayValues lnurl.LNURLPayValues + LanguageCode string + type LnurlWithdrawState struct + Amount int + Comment string + From *lnbits.User + Invoice lnbits.BitInvoice + LNURLWithdrawResponse lnurl.LNURLWithdrawResponse + LNURResponse lnurl.LNURLResponse + LanguageCode string + Message string + Success bool + type Message struct + Message *tb.Message + func NewMessage(m *tb.Message, opts ...MessageOption) *Message + func (msg Message) Key() string + type MessageOption func(m *Message) + func WithDuration(duration time.Duration, tipBot *TipBot) MessageOption + type PayData struct + Amount int64 + From *lnbits.User + Hash string + Invoice string + LanguageCode string + Memo string + Message string + Proof string + TelegramMessage *tb.Message + type SendData struct + Amount int64 + From *lnbits.User + LanguageCode string + Memo string + Message string + ToTelegramId int + ToTelegramUser string + type TipBot struct + Bunt *storage.DB + Client *lnbits.Client + Database *gorm.DB + Telegram *telebot.Bot + func NewBot() TipBot + func (bot *TipBot) CreateWalletForTelegramUser(tbUser *tb.User) (*lnbits.User, error) + func (bot *TipBot) GetHttpClient() (*http.Client, error) + func (bot *TipBot) GetUserBalance(user *lnbits.User) (amount int, err error) + func (bot *TipBot) GetUserBalanceCached(user *lnbits.User) (amount int, err error) + func (bot *TipBot) SendCheckSyntax(ctx context.Context, m *tb.Message) (bool, string) + func (bot *TipBot) UserExists(user *tb.User) (*lnbits.User, bool) + func (bot *TipBot) UserGetAnonLightningAddress(user *lnbits.User) (string, error) + func (bot *TipBot) UserGetLightningAddress(user *lnbits.User) (string, error) + func (bot TipBot) Start() + type TipTooltip struct + LastTip time.Time + Ntips int + TipAmount int + Tippers []*tb.User + func NewTipTooltip(m *tb.Message, opts ...TipTooltipOption) *TipTooltip + func (ttt TipTooltip) Key() string + type TipTooltipOption func(m *TipTooltip) + func TipAmount(amount int) TipTooltipOption + func Tips(nTips int) TipTooltipOption + type Transaction struct + Amount int + Bot *TipBot + ChatID int64 + ChatName string + From *lnbits.User + FromId int + FromLNbitsID string + FromUser string + FromWallet string + ID uint + Memo string + Success bool + Time time.Time + To *lnbits.User + ToId int + ToLNbitsID string + ToUser string + ToWallet string + Type string + func NewTransaction(bot *TipBot, from *lnbits.User, to *lnbits.User, amount int, ...) *Transaction + func (t *Transaction) Send() (success bool, err error) + func (t *Transaction) SendTransaction(bot *TipBot, from *lnbits.User, to *lnbits.User, amount int, memo string) (bool, error) + type TransactionOption func(t *Transaction) + func TransactionChat(chat *tb.Chat) TransactionOption + func TransactionType(transactionType string) TransactionOption