Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { GetMe() (User, error) GetUpdates(int) []Update ProcessUpdates(chan *Message) SendMessage(*SendMessage) (*Message, error) }
API holds the API methods
func NewAPI ¶
func NewAPI(httpClient HTTPClient, conf Configuration) API
NewAPI creates a new api from a token
type AnswerBack ¶
type AnswerBack struct { *Message // contains filtered or unexported fields }
AnswerBack message helper to answer messages
func NewAnswerBack ¶
func NewAnswerBack(message *Message, sender messageSender) *AnswerBack
NewAnswerBack creates a new instance
type Chat ¶
type Chat struct { ID int `json:"id"` Type string `json:"type"` Title string `json:"title"` Username string `json:"username"` FirstName string `json:"first_name"` LastName string `json:"last_name"` }
Chat payload
type ForceReply ¶
ForceReply show reply interface
type GetUpdates ¶
GetUpdates action parameter
type HTTPClient ¶
type HTTPClient interface { Get(url string) (*http.Response, error) Post(url string, bodyType string, body io.Reader) (resp *http.Response, err error) }
HTTPClient Small interface for http
type Message ¶
type Message struct { MessageID int `json:"message_id"` From User `json:"from"` Text string `json:"text"` Date int `json:"date"` Chat Chat `json:"chat"` ReplyToMessage *Message `json:"reply_to_message"` }
Message payload
type ReplyKeyboardHide ¶
type ReplyKeyboardHide struct { HideKeyboard bool `json:"hide_keyboard"` Selective bool `json:"selective"` }
ReplyKeyboardHide hide the current keyboard
type ReplyKeyboardMarkup ¶
type ReplyKeyboardMarkup struct { Keyboard [][]string `json:"keyboard"` ResizeKeyboard bool `json:"resize_keyboard"` OneTimeKeyboard bool `json:"one_time_keyboard"` Selective bool `json:"selective"` }
ReplyKeyboardMarkup custom keyboard with reply options
type Request ¶
Request basic api requester
func NewRequest ¶
func NewRequest(client HTTPClient, baseURL string) Request
NewRequest Create a new request
type Response ¶
type Response struct { Ok bool `json:"ok"` Result json.RawMessage `json:"result"` }
Response payload
type SendMessage ¶
type SendMessage struct { ChatID int `json:"chat_id"` Text string `json:"text"` ParseMode string `json:"parse_mode"` ReplyTo int `json:"reply_to_message_id"` }
SendMessage action parameter
Click to show internal directories.
Click to hide internal directories.