Documentation
¶
Index ¶
Constants ¶
View Source
const ( BaseURL = "https://api.telegram.org/bot" StoreFile = "store.gob" PollTimeoutSec = 60 UserIdRegex = "(?m)^-?\\d+$" )
View Source
const ( KeyUpdateID = "latestUpdateId" KeyMessage = "message" KeyParams = "message_params" KeyRecipient = "recipient" )
View Source
const ( CmdPatternStart = `/start` CmdPatternRevoke = `/revoke\s?(\d*)$` CmdPatternHelp = `/help` )
View Source
const ( MessageDefaultResponse = "Please use the _/start_ command to fetch a new token.\n\nFurther information at https://github.com/muety/telepush." MessageTokenResponse = "Successfully created new token: `%s`." MessageRevokeList = "Currently active tokens:\n\n%s\n\nSend `/revoke <number>` to revoke a certain token." MessageRevokeListEmpty = "No active tokens. Send `/start` to generate new one." MessageRevokeSuccessful = "Token `%s` revoked." MessageRevokeInvalidIndex = "%d is not a valid token index." MessageHelpResponse = "" /* 173-byte string literal not displayed */ )
View Source
const ( EventOnRequestFailed = "on_request_failed" EventOnRequestSuccessful = "on_request_successful" EventOnMessageDelivered = "on_message_delivered" EventOnTokenIssued = "on_user_registered" )
View Source
const ( FieldMessageOrigin = "origin" FieldMessageType = "type" FieldMessageRecipient = "chat_id" FieldTokenToken = "token" FieldTokenChat = "chat_id" FieldTokenUser = "user_id" )
Variables ¶
View Source
var Version string
Functions ¶
Types ¶
type BotConfig ¶
type BotConfig struct {
Env string
Token string
Mode string
BaseUrl string
UseHTTPS bool
CertPath string
KeyPath string
ProxyURI *url.URL
Port int
UrlSecret string
ReqRateLimit int
CmdRateLimit int
TruncateMsgs bool
Address string
Address6 string
Disable6 bool
Metrics bool
DataDir string
InletsDir string
Blacklist []int64
Whitelist []int64
Version string
}
func (*BotConfig) GetStorePath ¶
func (*BotConfig) GetUpdatesPath ¶
Click to show internal directories.
Click to hide internal directories.